org.openstreetmap.josm.data.preferences
Class ColorProperty

java.lang.Object
  extended by org.openstreetmap.josm.data.preferences.AbstractProperty<java.awt.Color>
      extended by org.openstreetmap.josm.data.preferences.ColorProperty
All Implemented Interfaces:
Preferences.ColorKey

public class ColorProperty
extends AbstractProperty<java.awt.Color>
implements Preferences.ColorKey

A property containing a Color value.

Since:
5464

Field Summary
private  java.lang.String name
           
 
Fields inherited from class org.openstreetmap.josm.data.preferences.AbstractProperty
defaultValue, key
 
Constructor Summary
ColorProperty(java.lang.String colName, java.awt.Color defaultValue)
          Constructs a new ColorProperty.
 
Method Summary
 java.awt.Color get()
          Replies the value of this property.
static java.lang.String getColorKey(java.lang.String colName)
          Replies the color key used in JOSM preferences for this property.
 java.lang.String getColorName()
           
 java.lang.String getSpecialName()
           
 boolean put(java.awt.Color value)
          Sets this property to the specified value.
 
Methods inherited from class org.openstreetmap.josm.data.preferences.AbstractProperty
getDefaultValue, getKey, isSet, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openstreetmap.josm.data.Preferences.ColorKey
getDefaultValue
 

Field Detail

name

private final java.lang.String name
Constructor Detail

ColorProperty

public ColorProperty(java.lang.String colName,
                     java.awt.Color defaultValue)
Constructs a new ColorProperty.

Parameters:
colName - The color name
defaultValue - The default value
Method Detail

get

public java.awt.Color get()
Description copied from class: AbstractProperty
Replies the value of this property.

Specified by:
get in class AbstractProperty<java.awt.Color>
Returns:
the value of this property

put

public boolean put(java.awt.Color value)
Description copied from class: AbstractProperty
Sets this property to the specified value.

Specified by:
put in class AbstractProperty<java.awt.Color>
Parameters:
value - The new value of this property
Returns:
true if something has changed (i.e. value is different than before)

getColorKey

public static java.lang.String getColorKey(java.lang.String colName)
Replies the color key used in JOSM preferences for this property.

Parameters:
colName - The color name
Returns:
The color key for this property

getColorName

public java.lang.String getColorName()
Specified by:
getColorName in interface Preferences.ColorKey

getSpecialName

public java.lang.String getSpecialName()
Specified by:
getSpecialName in interface Preferences.ColorKey


JOSM