|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.ctdp.rfdynhud.properties.Property
net.ctdp.rfdynhud.properties.ColorProperty
public class ColorProperty
The ColorProperty
serves for customizing a color value.
Field Summary | |
---|---|
static java.awt.Color |
FALLBACK_COLOR
|
static java.lang.String |
STANDARD_BACKGROUND_COLOR_NAME
|
static java.lang.String |
STANDARD_FONT_COLOR_NAME
|
Constructor Summary | |
---|---|
ColorProperty(java.lang.String name,
java.lang.String defaultValue)
|
|
ColorProperty(java.lang.String name,
java.lang.String defaultValue,
boolean readonly)
|
|
ColorProperty(java.lang.String name,
java.lang.String nameForDisplay,
java.lang.String defaultValue)
|
|
ColorProperty(java.lang.String name,
java.lang.String nameForDisplay,
java.lang.String defaultValue,
boolean readonly)
|
Method Summary | |
---|---|
java.awt.Color |
getColor()
Gets the property's current value. |
java.lang.String |
getColorKey()
Gets the property's current value. |
static java.lang.String |
getDefaultNamedColorValue(java.lang.String name)
|
java.lang.String |
getValue()
Gets the current value fo this property. |
boolean |
hasVisibleColor()
Gets, whether this ColorProperty hosts a visible color value. |
void |
loadValue(PropertyLoader loader,
java.lang.String value)
Loads the value from the configuration file. |
protected void |
onKeeperSet()
|
protected void |
onValueChanged(java.lang.String oldValue,
java.lang.String newValue)
Invoked when the value has changed. |
void |
refresh()
Must be called after color names have changed in the editor. |
boolean |
setColor(java.awt.Color color)
Sets the new property's value. |
boolean |
setColor(int red,
int green,
int blue)
Sets the new property's value. |
boolean |
setColor(java.lang.String colorKey)
Sets the new property's value. |
protected boolean |
setColor(java.lang.String colorKey,
boolean firstTime)
Sets the new property's value. |
void |
setValue(java.lang.Object value)
Sets the new value for this property. |
Methods inherited from class net.ctdp.rfdynhud.properties.Property |
---|
getButtonText, getButtonTooltip, getDocumentationSource, getEditorType, getKeeper, getName, getNameForDisplay, getValueForConfigurationFile, isMatchingKey, isReadOnly, onButtonClicked, quoteValueInConfigurationFile, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String STANDARD_BACKGROUND_COLOR_NAME
public static final java.lang.String STANDARD_FONT_COLOR_NAME
public static final java.awt.Color FALLBACK_COLOR
Constructor Detail |
---|
public ColorProperty(java.lang.String name, java.lang.String nameForDisplay, java.lang.String defaultValue, boolean readonly)
name
- the technical name used internally. See Property.getName()
.nameForDisplay
- the name displayed in the editor. See Property.getNameForDisplay()
. If null
is passed, the value of the name parameter is used.defaultValue
- the default valuereadonly
- read only property?public ColorProperty(java.lang.String name, java.lang.String nameForDisplay, java.lang.String defaultValue)
name
- the technical name used internally. See Property.getName()
.nameForDisplay
- the name displayed in the editor. See Property.getNameForDisplay()
. If null
is passed, the value of the name parameter is used.defaultValue
- the default valuepublic ColorProperty(java.lang.String name, java.lang.String defaultValue, boolean readonly)
name
- the technical name used internally. See Property.getName()
. 'nameForDisplay' is set to the same value.defaultValue
- the default valuereadonly
- read only property?public ColorProperty(java.lang.String name, java.lang.String defaultValue)
name
- the technical name used internally. See Property.getName()
. 'nameForDisplay' is set to the same value.defaultValue
- the default valueMethod Detail |
---|
public static java.lang.String getDefaultNamedColorValue(java.lang.String name)
protected void onKeeperSet()
onKeeperSet
in class Property
protected void onValueChanged(java.lang.String oldValue, java.lang.String newValue)
oldValue
- the old valuenewValue
- the new valuepublic void refresh()
protected final boolean setColor(java.lang.String colorKey, boolean firstTime)
colorKey
- the new valuefirstTime
-
public final boolean setColor(java.lang.String colorKey)
colorKey
- the new value
public final boolean setColor(java.awt.Color color)
color
- the new value
public final boolean setColor(int red, int green, int blue)
red
- green
- blue
-
public final java.lang.String getColorKey()
public final java.awt.Color getColor()
public final boolean hasVisibleColor()
ColorProperty
hosts a visible color value.
true
, if and only if getColor()
returns a non null
value with an alpha channel > 0.public void setValue(java.lang.Object value)
setValue
in class Property
value
- the new valuepublic java.lang.String getValue()
getValue
in class Property
public void loadValue(PropertyLoader loader, java.lang.String value)
loadValue
in class Property
loader
- the loadervalue
- the value to load
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |