public class ColorProperty extends AbstractToStringProperty<java.awt.Color>
Color value.AbstractToStringProperty.ChildProperty<T>AbstractProperty.InvalidPreferenceValueException, AbstractProperty.ValueChangeEvent<T>, AbstractProperty.ValueChangeListener<T>| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
name |
defaultValue, key, preferences| Constructor and Description |
|---|
ColorProperty(java.lang.String colName,
java.awt.Color defaultValue)
Constructs a new
ColorProperty. |
ColorProperty(java.lang.String colName,
java.lang.String defaultValue)
Constructs a new
ColorProperty. |
| Modifier and Type | Method and Description |
|---|---|
protected java.awt.Color |
fromString(java.lang.String string)
Converts the string to an object of the given type.
|
java.awt.Color |
get()
Replies the value of this property.
|
AbstractToStringProperty<java.awt.Color> |
getChildColor(java.lang.String colorName)
Gets a color of which the value can be set.
|
static java.lang.String |
getColorKey(java.lang.String colName)
Replies the color key used in JOSM preferences for this property.
|
java.lang.String |
getName()
Gets the name this color was registered with.
|
boolean |
put(java.awt.Color value)
Sets this property to the specified value.
|
java.lang.String |
toString() |
protected java.lang.String |
toString(java.awt.Color t)
Converts the string to an object of the given type.
|
cached, getAsString, getChildProperty, getSpecializedaddListener, addListenerImpl, addWeakListener, addWeakListenerImpl, equals, getDefaultValue, getKey, getPreferences, hashCode, isSet, remove, removeListener, removeListenerImpl, storeDefaultValueprivate final java.lang.String name
public ColorProperty(java.lang.String colName, java.lang.String defaultValue)
ColorProperty.colName - The color namedefaultValue - The default value as HTML stringpublic ColorProperty(java.lang.String colName, java.awt.Color defaultValue)
ColorProperty.colName - The color namedefaultValue - The default valuepublic java.awt.Color get()
AbstractPropertyget in class AbstractToStringProperty<java.awt.Color>public boolean put(java.awt.Color value)
AbstractPropertyput in class AbstractToStringProperty<java.awt.Color>value - The new value of this propertyprotected java.awt.Color fromString(java.lang.String string)
AbstractToStringPropertyfromString in class AbstractToStringProperty<java.awt.Color>string - The stringprotected java.lang.String toString(java.awt.Color t)
AbstractToStringPropertytoString in class AbstractToStringProperty<java.awt.Color>t - The object.public AbstractToStringProperty<java.awt.Color> getChildColor(java.lang.String colorName)
colorName - the name of the color.public java.lang.String getName()
public static java.lang.String getColorKey(java.lang.String colName)
colName - The color namepublic java.lang.String toString()
toString in class java.lang.Object