public class ColorProperty extends Property
PropertiesList
.
Property
Constructor and Description |
---|
ColorProperty(java.lang.String name,
java.lang.String description)
Creates a new color property.
|
ColorProperty(java.lang.String name,
java.lang.String description,
boolean displayRGB)
Creates a new color property.
|
ColorProperty(java.lang.String name,
java.lang.String description,
java.awt.Color initialValue)
Creates a new color property.
|
ColorProperty(java.lang.String name,
java.lang.String description,
java.awt.Color initialValue,
boolean displayRGB)
Creates a new color property.
|
Modifier and Type | Method and Description |
---|---|
protected javax.swing.table.TableCellEditor |
createEditor(java.lang.Object[] arguments)
Creates the editor of the property.
|
protected javax.swing.table.TableCellRenderer |
createRenderer(java.lang.Object[] arguments)
Creates the renderer of the property.
|
java.awt.Color |
getValue()
Gets the value of the property.
|
protected java.lang.Class<?> |
getValueClass()
Gets the class of the value.
|
protected java.lang.Object |
onEditStop(java.lang.Object value)
Checks if the committed value is valid.
|
void |
setValue(java.awt.Color value)
Sets the value of the color property.
|
void |
setValue(java.lang.Object value)
Sets the value of the property.
|
getDescription, getName, toString
public ColorProperty(java.lang.String name, java.lang.String description) throws java.lang.IllegalArgumentException
name
- the name of the propertydescription
- the description of the property (the description can contain html tags to format the text)java.lang.IllegalArgumentException
- public ColorProperty(java.lang.String name, java.lang.String description, java.awt.Color initialValue) throws java.lang.IllegalArgumentException
name
- the name of the propertydescription
- the description of the property (the description can contain html tags to format the text)initialValue
- the initial value of the propertyjava.lang.IllegalArgumentException
- public ColorProperty(java.lang.String name, java.lang.String description, boolean displayRGB) throws java.lang.IllegalArgumentException
name
- the name of the propertydescription
- the description of the property (the description can contain html tags to format the text)displayRGB
- true
if the rgb value of the color should be displayed otherwise false
java.lang.IllegalArgumentException
- public ColorProperty(java.lang.String name, java.lang.String description, java.awt.Color initialValue, boolean displayRGB) throws java.lang.IllegalArgumentException
name
- the name of the propertydescription
- the description of the property (the description can contain html tags to format the text)initialValue
- the initial value of the propertydisplayRGB
- true
if the rgb value of the color should be displayed otherwise false
java.lang.IllegalArgumentException
- public java.awt.Color getValue()
public void setValue(java.lang.Object value) throws java.lang.IllegalArgumentException
public void setValue(java.awt.Color value) throws java.lang.IllegalArgumentException
value
- the valuejava.lang.IllegalArgumentException
- protected javax.swing.table.TableCellEditor createEditor(java.lang.Object[] arguments)
Property
IllegalStateException
is thrown.createEditor
in class Property
arguments
- the arguments list which is committed by the constructor or null
DefaultCellEditor
,
ColorCellEditor
,
SliderCellEditor
protected javax.swing.table.TableCellRenderer createRenderer(java.lang.Object[] arguments)
Property
null
) the value class
(Property.getValueClass()
) is used to find a default cell renderer for this property (see DefaultTableCellRenderer
) .createRenderer
in class Property
arguments
- the arguments list which is committed by the constructor or null
null
if the default renderer should be usedprotected java.lang.Class<?> getValueClass()
Property
String.class
or if you have
a numeric property the return value should be Number.class
and so on.
Property.createRenderer(Object[])
returns null
) the value class is used to set the default cell renderer for this property.getValueClass
in class Property
protected java.lang.Object onEditStop(java.lang.Object value)
Property
onEditStop
in class Property
value
- the edit valueProperty.setValue(Object)