Package net.infonode.properties.gui.util
Class ComponentProperties
java.lang.Object
net.infonode.properties.propertymap.PropertyMapContainer
net.infonode.properties.gui.util.ComponentProperties
Properties and property values for a
JComponent
.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ColorProperty
Component background color.static final BorderProperty
Component border.static final FontProperty
Component text font.static final ColorProperty
Component foreground color.static final InsetsProperty
Component insets inside the border.static final PropertyMapGroup
Property group for all component properties. -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty property object.ComponentProperties
(ComponentProperties inheritFrom) Creates a property object that inherit values from another property object.Creates a property map containing the map. -
Method Summary
Modifier and TypeMethodDescriptionaddSuperObject
(ComponentProperties properties) Adds a super object from which property values are inherited.void
applyTo
(JComponent component) Applies the property values to a component.void
applyTo
(JComponent component, Direction insetsDirection) Applies the property values to a component and rotates the insets in the given direction.Returns the component background color.Returns the component border.getFont()
Returns the component text font.Returns the component foreground color.Returns the component insets inside the border.Removes the last added super object.removeSuperObject
(ComponentProperties superObject) Removes the given super object.setBackgroundColor
(Color color) Sets the component background color.Sets the component border.Sets the component text font.setForegroundColor
(Color foregroundColor) Sets the component foreground color.Sets the component insets inside the border.Methods inherited from class net.infonode.properties.propertymap.PropertyMapContainer
getMap
-
Field Details
-
PROPERTIES
Property group for all component properties. -
BORDER
Component border. -
INSETS
Component insets inside the border. -
FOREGROUND_COLOR
Component foreground color. -
FONT
Component text font. -
BACKGROUND_COLOR
Component background color. A null value means that no background will be painted.
-
-
Constructor Details
-
ComponentProperties
public ComponentProperties()Creates an empty property object. -
ComponentProperties
Creates a property map containing the map.- Parameters:
map
- the property map
-
ComponentProperties
Creates a property object that inherit values from another property object.- Parameters:
inheritFrom
- the object from which to inherit property values
-
-
Method Details
-
addSuperObject
Adds a super object from which property values are inherited.- Parameters:
properties
- the object from which to inherit property values- Returns:
- this
-
removeSuperObject
Removes the last added super object.- Returns:
- this
-
removeSuperObject
Removes the given super object.- Parameters:
superObject
- super object to remove- Returns:
- this
-
setBorder
Sets the component border.- Parameters:
border
- the component border- Returns:
- this
-
setInsets
Sets the component insets inside the border.- Parameters:
insets
- the component insets- Returns:
- this
-
setBackgroundColor
Sets the component background color.- Parameters:
color
- the background color, null means no background- Returns:
- this
-
getInsets
Returns the component insets inside the border.- Returns:
- the component insets inside the border
-
getBorder
Returns the component border.- Returns:
- the component border
-
getBackgroundColor
Returns the component background color.- Returns:
- the component background color
-
getFont
Returns the component text font.- Returns:
- the component text font
-
getForegroundColor
Returns the component foreground color.- Returns:
- the component foreground color
-
setForegroundColor
Sets the component foreground color.- Parameters:
foregroundColor
- the component foreground color- Returns:
- this
-
setFont
Sets the component text font.- Parameters:
font
- the component text font- Returns:
- this
-
applyTo
Applies the property values to a component.- Parameters:
component
- the component on which to apply the property values
-
applyTo
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 valuesinsetsDirection
- insets direction
-