|
||||||||||
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.BackgroundProperty
public class BackgroundProperty
The BackgroundProperty
unites ColorProperty
and ImageProperty
to select something for a Widget's background.
Nested Class Summary | |
---|---|
static class |
BackgroundProperty.BackgroundType
|
Field Summary | |
---|---|
static java.lang.String |
COLOR_INDICATOR
|
static java.lang.String |
IMAGE_INDICATOR
|
Constructor Summary | |
---|---|
BackgroundProperty(java.lang.String name,
java.lang.String defaultValue)
|
|
BackgroundProperty(java.lang.String name,
java.lang.String nameForDisplay,
java.lang.String defaultValue)
|
Method Summary | |
---|---|
BackgroundProperty.BackgroundType |
getBackgroundType()
Gets the current type of this background. |
ColorProperty |
getColorProperty()
Gets the encapsulated ColorProperty . |
java.awt.Color |
getColorValue()
Gets the Color from this BackgroundProperty . |
ImageProperty |
getImageProperty()
Gets the encapsulated ImageProperty . |
ImageTemplate |
getImageValue()
Gets the Color from this BackgroundProperty . |
java.lang.String |
getValue()
Gets the current value fo this property. |
void |
loadValue(PropertyLoader loader,
java.lang.String value)
Loads the value from the configuration file. |
protected void |
onKeeperSet()
|
protected void |
onValueChanged(BackgroundProperty.BackgroundType oldBGType,
BackgroundProperty.BackgroundType newBGType,
java.lang.String oldValue,
java.lang.String newValue)
Invoked when the value has changed. |
boolean |
setColorValue(java.lang.String value)
Sets this property to a color of the given value. |
boolean |
setImageValue(java.lang.String value)
Sets this property to an image of the given value. |
void |
setValue(java.lang.Object value)
Sets the new value for this property. |
void |
setValues(BackgroundProperty.BackgroundType type,
java.lang.String colorValue,
java.lang.String imageValue)
Sets the current value. |
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 COLOR_INDICATOR
public static final java.lang.String IMAGE_INDICATOR
Constructor Detail |
---|
public BackgroundProperty(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 BackgroundProperty(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 final BackgroundProperty.BackgroundType getBackgroundType()
protected void onKeeperSet()
onKeeperSet
in class Property
protected void onValueChanged(BackgroundProperty.BackgroundType oldBGType, BackgroundProperty.BackgroundType newBGType, java.lang.String oldValue, java.lang.String newValue)
oldBGType
- the old background typenewBGType
- thew new background typeoldValue
- the old valuenewValue
- the new valuepublic final ColorProperty getColorProperty()
ColorProperty
.
ColorProperty
.public final ImageProperty getImageProperty()
ImageProperty
.
ImageProperty
.public void setValue(java.lang.Object value)
setValue
in class Property
value
- the new valuepublic boolean setColorValue(java.lang.String value)
value
- the new color value/name
public boolean setImageValue(java.lang.String value)
value
- the new image name
public void setValues(BackgroundProperty.BackgroundType type, java.lang.String colorValue, java.lang.String imageValue)
type
- colorValue
- imageValue
- public java.lang.String getValue()
getValue
in class Property
public final java.awt.Color getColorValue()
Color
from this BackgroundProperty
.
The result is only valid, if the BackgroundProperty.BackgroundType
(getBackgroundType()
) is BackgroundProperty.BackgroundType.COLOR
.
Color
from this BackgroundProperty
.public final ImageTemplate getImageValue()
Color
from this BackgroundProperty
.
The result is only valid, if the BackgroundProperty.BackgroundType
(getBackgroundType()
) is BackgroundProperty.BackgroundType.COLOR
.
Color
from this BackgroundProperty
.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 |