net.ctdp.rfdynhud.properties
Class FactoredFloatProperty
java.lang.Object
net.ctdp.rfdynhud.properties.Property
net.ctdp.rfdynhud.properties.FloatProperty
net.ctdp.rfdynhud.properties.FactoredFloatProperty
public class FactoredFloatProperty
- extends FloatProperty
The FactoredFloatProperty
serves for customizing a primitive float value multiplied by a factor.
- Author:
- Marvin Froehlich (CTDP)
Constructor Summary |
FactoredFloatProperty(java.lang.String name,
float factor,
float defaultValue,
float minValue,
float maxValue)
|
FactoredFloatProperty(java.lang.String name,
float factor,
int defaultValue,
float minValue,
float maxValue,
boolean readonly)
|
FactoredFloatProperty(java.lang.String name,
java.lang.String nameForDisplay,
float factor,
float defaultValue,
float minValue,
float maxValue)
|
FactoredFloatProperty(java.lang.String name,
java.lang.String nameForDisplay,
float factor,
float defaultValue,
float minValue,
float maxValue,
boolean readonly)
|
Method Summary |
protected float |
deriveValue(float value,
float factor)
This method is utilized to derive the factored value from the property value. |
float |
getFactor()
Gets the factor. |
float |
getFactoredValue()
Gets the value multiplied by the factor. |
Methods inherited from class net.ctdp.rfdynhud.properties.FloatProperty |
fixValue, getDefaultValue, getFloatValue, getIntValue, getIntValue, getMaxValue, getMinValue, getValue, loadValue, onKeeperSet, onValueChanged, setFloatValue, setFloatValue, setValue |
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 |
FACTOR_DEGREES_TO_RADIANS
public static final float FACTOR_DEGREES_TO_RADIANS
- See Also:
- Constant Field Values
FactoredFloatProperty
public FactoredFloatProperty(java.lang.String name,
java.lang.String nameForDisplay,
float factor,
float defaultValue,
float minValue,
float maxValue,
boolean readonly)
- Parameters:
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.factor
- the factordefaultValue
- the default valueminValue
- the minimum valuemaxValue
- the maximum valuereadonly
- read only property?
FactoredFloatProperty
public FactoredFloatProperty(java.lang.String name,
java.lang.String nameForDisplay,
float factor,
float defaultValue,
float minValue,
float maxValue)
- Parameters:
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.factor
- the factordefaultValue
- the default valueminValue
- the minimum valuemaxValue
- the maximum value
FactoredFloatProperty
public FactoredFloatProperty(java.lang.String name,
float factor,
int defaultValue,
float minValue,
float maxValue,
boolean readonly)
- Parameters:
name
- the technical name used internally. See Property.getName()
. 'nameForDisplay' is set to the same value.factor
- the factordefaultValue
- the default valueminValue
- the minimum valuemaxValue
- the maximum valuereadonly
- read only property?
FactoredFloatProperty
public FactoredFloatProperty(java.lang.String name,
float factor,
float defaultValue,
float minValue,
float maxValue)
- Parameters:
name
- the technical name used internally. See Property.getName()
. 'nameForDisplay' is set to the same value.factor
- the factordefaultValue
- the default valueminValue
- the minimum valuemaxValue
- the maximum value
getFactor
public final float getFactor()
- Gets the factor.
- Returns:
- the factor.
deriveValue
protected float deriveValue(float value,
float factor)
- This method is utilized to derive the factored value from the property value.
- Parameters:
value
- the property valuefactor
- the factor
- Returns:
- the derived value.
getFactoredValue
public final float getFactoredValue()
- Gets the value multiplied by the factor.
- Returns:
- the value multiplied by the factor.