public class NumericProperty extends Property
PropertiesList
.
setMinimum(int)
/setMaximum(int)
.Property
Constructor and Description |
---|
NumericProperty(java.lang.String name,
java.lang.String description)
Creates a new numeric property.
|
NumericProperty(java.lang.String name,
java.lang.String description,
boolean sliderEditor)
Creates a new numeric property.
|
NumericProperty(java.lang.String name,
java.lang.String description,
java.lang.Number initialValue)
Creates a new numeric property.
|
NumericProperty(java.lang.String name,
java.lang.String description,
java.lang.Number initialValue,
boolean sliderEditor)
Creates a new numeric 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.
|
int |
getMaximum()
Gets the maximum of the slider.
|
int |
getMinimum()
Gets the minimum of the slider.
|
java.lang.Number |
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 |
setMaximum(int maximum)
Sets the maximum of the slider.
|
void |
setMinimum(int minimum)
Sets the minimum of the slider.
|
void |
setValue(java.lang.Number value)
Sets the value of the numeric property.
|
void |
setValue(java.lang.Object value)
Sets the value of the property.
|
getDescription, getName, toString
public NumericProperty(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 NumericProperty(java.lang.String name, java.lang.String description, java.lang.Number initialValue) throws java.lang.IllegalArgumentException
NumericProperty(String, String, boolean)
.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 NumericProperty(java.lang.String name, java.lang.String description, boolean sliderEditor) 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)sliderEditor
- true
if the property should use a slider as editor or false
if a numeric field should be used as editorjava.lang.IllegalArgumentException
- public NumericProperty(java.lang.String name, java.lang.String description, java.lang.Number initialValue, boolean sliderEditor) 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 propertysliderEditor
- true
if the property should use a slider as editor or false
if a numeric field should be used as editorjava.lang.IllegalArgumentException
- public java.lang.Number getValue()
public void setValue(java.lang.Object value) throws java.lang.IllegalArgumentException
public void setValue(java.lang.Number value) throws java.lang.IllegalArgumentException
value
- the valuejava.lang.IllegalArgumentException
- public int getMinimum()
public void setMinimum(int minimum)
minimum
- the minimumpublic int getMaximum()
public void setMaximum(int maximum)
maximum
- the maximumprotected 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)