net.ctdp.rfdynhud.properties
Class DelayProperty

java.lang.Object
  extended by net.ctdp.rfdynhud.properties.Property
      extended by net.ctdp.rfdynhud.properties.IntProperty
          extended by net.ctdp.rfdynhud.properties.DelayProperty

public class DelayProperty
extends IntProperty

The DelayProperty serves for customizing a time delay. A time delay is always measured in nano seconds internally. This property provides the value in other units like milliseconds for easier use.

Author:
Marvin Froehlich (CTDP)

Nested Class Summary
static class DelayProperty.DisplayUnits
           
 
Constructor Summary
DelayProperty(java.lang.String name, DelayProperty.DisplayUnits displayUnits, int defaultValue)
           
DelayProperty(java.lang.String name, DelayProperty.DisplayUnits displayUnits, int defaultValue, boolean readonly)
           
DelayProperty(java.lang.String name, DelayProperty.DisplayUnits displayUnits, int defaultValue, int minValue, int maxValue)
           
DelayProperty(java.lang.String name, java.lang.String nameForDisplay, DelayProperty.DisplayUnits displayUnits, int defaultValue)
           
DelayProperty(java.lang.String name, java.lang.String nameForDisplay, DelayProperty.DisplayUnits displayUnits, int defaultValue, boolean readonly)
           
DelayProperty(java.lang.String name, java.lang.String nameForDisplay, DelayProperty.DisplayUnits displayUnits, int defaultValue, int minValue, int maxValue, boolean readonly)
           
 
Method Summary
protected  long deriveDelay(int value, DelayProperty.DisplayUnits displayUnits)
          This method is utilized to derive the delay value from the property value.
 long getDelayNanos()
          The actual delay values in nanoseconds.
 float getDelaySeconds()
          The actual delay values in seconds.
 DelayProperty.DisplayUnits getDisplayUnits()
          Gets the used DelayProperty.DisplayUnits.
 
Methods inherited from class net.ctdp.rfdynhud.properties.IntProperty
fixValue, getDefaultValue, getFloatValue, getIntValue, getMaxValue, getMinValue, getValue, loadValue, onKeeperSet, onValueChanged, setIntValue, setIntValue, 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
 

Constructor Detail

DelayProperty

public DelayProperty(java.lang.String name,
                     java.lang.String nameForDisplay,
                     DelayProperty.DisplayUnits displayUnits,
                     int defaultValue,
                     int minValue,
                     int 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.
displayUnits - the units to display the value in
defaultValue - the default value
minValue - the minimum value
maxValue - the maximum value
readonly - read only property?

DelayProperty

public DelayProperty(java.lang.String name,
                     java.lang.String nameForDisplay,
                     DelayProperty.DisplayUnits displayUnits,
                     int defaultValue,
                     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.
displayUnits - the units to display the value in
defaultValue - the default value
readonly - read only property?

DelayProperty

public DelayProperty(java.lang.String name,
                     java.lang.String nameForDisplay,
                     DelayProperty.DisplayUnits displayUnits,
                     int defaultValue)
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.
displayUnits - the units to display the value in
defaultValue - the default value

DelayProperty

public DelayProperty(java.lang.String name,
                     DelayProperty.DisplayUnits displayUnits,
                     int defaultValue,
                     boolean readonly)
Parameters:
name - the technical name used internally. See Property.getName(). 'nameForDisplay' is set to the same value.
displayUnits - the units to display the value in
defaultValue - the default value
readonly - read only property?

DelayProperty

public DelayProperty(java.lang.String name,
                     DelayProperty.DisplayUnits displayUnits,
                     int defaultValue)
Parameters:
name - the technical name used internally. See Property.getName(). 'nameForDisplay' is set to the same value.
displayUnits - the units to display the value in
defaultValue - the default value

DelayProperty

public DelayProperty(java.lang.String name,
                     DelayProperty.DisplayUnits displayUnits,
                     int defaultValue,
                     int minValue,
                     int maxValue)
Parameters:
name - the technical name used internally. See Property.getName(). 'nameForDisplay' is set to the same value.
displayUnits - the units to display the value in
defaultValue - the default value
minValue - the minimum value
maxValue - the maximum value
Method Detail

getDisplayUnits

public final DelayProperty.DisplayUnits getDisplayUnits()
Gets the used DelayProperty.DisplayUnits.

Returns:
the used DelayProperty.DisplayUnits.

deriveDelay

protected long deriveDelay(int value,
                           DelayProperty.DisplayUnits displayUnits)
This method is utilized to derive the delay value from the property value.

Parameters:
value - the property value
displayUnits - the used DelayProperty.DisplayUnits
Returns:
the derived delay value.

getDelayNanos

public final long getDelayNanos()
The actual delay values in nanoseconds.

Returns:
actual delay values in nanoseconds.

getDelaySeconds

public final float getDelaySeconds()
The actual delay values in seconds.

Returns:
actual delay values in seconds.