net.infonode.properties.gui.util

Class ComponentProperties

public class ComponentProperties extends PropertyMapContainer

Properties and property values for a JComponent.

Version: $Revision: 1.17 $

Author: $Author: jesper $

Field Summary
static ColorPropertyBACKGROUND_COLOR
Component background color.
static BorderPropertyBORDER
Component border.
static FontPropertyFONT
Component text font.
static ColorPropertyFOREGROUND_COLOR
Component foreground color.
static InsetsPropertyINSETS
Component insets inside the border.
static PropertyMapGroupPROPERTIES
Property group for all component properties.
Constructor Summary
ComponentProperties()
Creates an empty property object.
ComponentProperties(PropertyMap map)
Creates a property map containing the map.
ComponentProperties(ComponentProperties inheritFrom)
Creates a property object that inherit values from another property object.
Method Summary
ComponentPropertiesaddSuperObject(ComponentProperties properties)
Adds a super object from which property values are inherited.
voidapplyTo(JComponent component)
Applies the property values to a component.
voidapplyTo(JComponent component, Direction insetsDirection)
Applies the property values to a component and rotates the insets in the given direction.
ColorgetBackgroundColor()
Returns the component background color.
BordergetBorder()
Returns the component border.
FontgetFont()
Returns the component text font.
ColorgetForegroundColor()
Returns the component foreground color.
InsetsgetInsets()
Returns the component insets inside the border.
ComponentPropertiesremoveSuperObject()
Removes the last added super object.
ComponentPropertiesremoveSuperObject(ComponentProperties superObject)
Removes the given super object.
ComponentPropertiessetBackgroundColor(Color color)
Sets the component background color.
ComponentPropertiessetBorder(Border border)
Sets the component border.
ComponentPropertiessetFont(Font font)
Sets the component text font.
ComponentPropertiessetForegroundColor(Color foregroundColor)
Sets the component foreground color.
ComponentPropertiessetInsets(Insets insets)
Sets the component insets inside the border.

Field Detail

BACKGROUND_COLOR

public static final ColorProperty BACKGROUND_COLOR
Component background color. A null value means that no background will be painted.

BORDER

public static final BorderProperty BORDER
Component border.

FONT

public static final FontProperty FONT
Component text font.

FOREGROUND_COLOR

public static final ColorProperty FOREGROUND_COLOR
Component foreground color.

INSETS

public static final InsetsProperty INSETS
Component insets inside the border.

PROPERTIES

public static final PropertyMapGroup PROPERTIES
Property group for all component properties.

Constructor Detail

ComponentProperties

public ComponentProperties()
Creates an empty property object.

ComponentProperties

public ComponentProperties(PropertyMap map)
Creates a property map containing the map.

Parameters: map the property map

ComponentProperties

public ComponentProperties(ComponentProperties inheritFrom)
Creates a property object that inherit values from another property object.

Parameters: inheritFrom the object from which to inherit property values

Method Detail

addSuperObject

public ComponentProperties addSuperObject(ComponentProperties properties)
Adds a super object from which property values are inherited.

Parameters: properties the object from which to inherit property values

Returns: this

applyTo

public void applyTo(JComponent component)
Applies the property values to a component.

Parameters: component the component on which to apply the property values

applyTo

public void applyTo(JComponent component, Direction insetsDirection)
Applies the property values to a component and rotates the insets in the given direction.

Parameters: component the component on which to apply the property values insetsDirection insets direction

getBackgroundColor

public Color getBackgroundColor()
Returns the component background color.

Returns: the component background color

getBorder

public Border getBorder()
Returns the component border.

Returns: the component border

getFont

public Font getFont()
Returns the component text font.

Returns: the component text font

getForegroundColor

public Color getForegroundColor()
Returns the component foreground color.

Returns: the component foreground color

getInsets

public Insets getInsets()
Returns the component insets inside the border.

Returns: the component insets inside the border

removeSuperObject

public ComponentProperties removeSuperObject()
Removes the last added super object.

Returns: this

removeSuperObject

public ComponentProperties removeSuperObject(ComponentProperties superObject)
Removes the given super object.

Parameters: superObject super object to remove

Returns: this

setBackgroundColor

public ComponentProperties setBackgroundColor(Color color)
Sets the component background color.

Parameters: color the background color, null means no background

Returns: this

setBorder

public ComponentProperties setBorder(Border border)
Sets the component border.

Parameters: border the component border

Returns: this

setFont

public ComponentProperties setFont(Font font)
Sets the component text font.

Parameters: font the component text font

Returns: this

setForegroundColor

public ComponentProperties setForegroundColor(Color foregroundColor)
Sets the component foreground color.

Parameters: foregroundColor the component foreground color

Returns: this

setInsets

public ComponentProperties setInsets(Insets insets)
Sets the component insets inside the border.

Parameters: insets the component insets

Returns: this