|
||||||||||
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.FloatProperty
public class FloatProperty
The FloatProperty
serves for customizing a primitive float value.
Constructor Summary | |
---|---|
FloatProperty(java.lang.String name,
float defaultValue)
|
|
FloatProperty(java.lang.String name,
float defaultValue,
boolean readonly)
|
|
FloatProperty(java.lang.String name,
float defaultValue,
float minValue,
float maxValue)
|
|
FloatProperty(java.lang.String name,
java.lang.String nameForDisplay,
float defaultValue)
|
|
FloatProperty(java.lang.String name,
java.lang.String nameForDisplay,
float defaultValue,
boolean readonly)
|
|
FloatProperty(java.lang.String name,
java.lang.String nameForDisplay,
float defaultValue,
float minValue,
float maxValue,
boolean readonly)
|
Method Summary | |
---|---|
protected float |
fixValue(float value)
Fixes the value to stick to the limits. |
java.lang.Float |
getDefaultValue()
Gets the default (initial) value fo this property. |
float |
getFloatValue()
Gets the property's current value. |
int |
getIntValue()
Gets the property's current value as a floored int. |
int |
getIntValue(boolean round)
Gets the property's current value as an int. |
float |
getMaxValue()
Gets the maximum value. |
float |
getMinValue()
Gets the minimum value. |
java.lang.Float |
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(java.lang.Float oldValue,
float newValue)
Invoked when the value has changed. |
boolean |
setFloatValue(float value)
Sets the property's value. |
protected boolean |
setFloatValue(float value,
boolean firstTime)
Sets the 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, hasDefaultValue, isMatchingKey, isReadOnly, onButtonClicked, quoteValueInConfigurationFile, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FloatProperty(java.lang.String name, java.lang.String nameForDisplay, float defaultValue, float minValue, float maxValue, 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 valueminValue
- the minimum valuemaxValue
- the maximum valuereadonly
- read only property?public FloatProperty(java.lang.String name, java.lang.String nameForDisplay, float 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 FloatProperty(java.lang.String name, java.lang.String nameForDisplay, float 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 FloatProperty(java.lang.String name, float 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 FloatProperty(java.lang.String name, float defaultValue)
name
- the technical name used internally. See Property.getName()
. 'nameForDisplay' is set to the same value.defaultValue
- the default valuepublic FloatProperty(java.lang.String name, float defaultValue, float minValue, float maxValue)
name
- the technical name used internally. See Property.getName()
. 'nameForDisplay' is set to the same value.defaultValue
- the default valueminValue
- the minimum valuemaxValue
- the maximum valueMethod Detail |
---|
public java.lang.Float getDefaultValue()
getDefaultValue
in class Property
public final float getMinValue()
public final float getMaxValue()
protected float fixValue(float value)
value
- the unfixed value
protected void onKeeperSet()
onKeeperSet
in class Property
protected void onValueChanged(java.lang.Float oldValue, float newValue)
oldValue
- the old valuenewValue
- the new valueprotected final boolean setFloatValue(float value, boolean firstTime)
value
- the new valuefirstTime
-
public final boolean setFloatValue(float value)
value
- the new value
public final float getFloatValue()
public final int getIntValue(boolean round)
round
- if true
the value is rounded, otherwise it is floored.
public final int getIntValue()
public void setValue(java.lang.Object value)
setValue
in class Property
value
- the new valuepublic java.lang.Float 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 |