net.ctdp.rfdynhud.properties
Class TimeProperty

java.lang.Object
  extended by net.ctdp.rfdynhud.properties.Property
      extended by net.ctdp.rfdynhud.properties.TimeProperty

public class TimeProperty
extends Property

The TimeProperty serves for customizing a time value.

Author:
Marvin Froehlich (CTDP)

Constructor Summary
TimeProperty(java.lang.String name, java.lang.String defaultValue)
           
TimeProperty(java.lang.String name, java.lang.String defaultValue, boolean readonly)
           
TimeProperty(java.lang.String name, java.lang.String nameForDisplay, java.lang.String defaultValue)
           
TimeProperty(java.lang.String name, java.lang.String nameForDisplay, java.lang.String defaultValue, boolean readonly)
           
 
Method Summary
 long getNanoValue()
          Gets the current value as nano seconds.
 java.lang.String getTimeValue()
          Gets the current value as a time string.
 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(java.lang.Long oldValue, long newValue)
          Invoked when the value has changed.
 boolean setNanoValue(long nanos)
          Sets the property's value.
protected  boolean setNanoValue(long nanos, boolean firstTime)
          Sets the property's value.
 boolean setTimeValue(java.lang.String time)
          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, isMatchingKey, isReadOnly, onButtonClicked, quoteValueInConfigurationFile, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimeProperty

public TimeProperty(java.lang.String name,
                    java.lang.String nameForDisplay,
                    java.lang.String 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.
defaultValue - the default value
readonly - read only property?

TimeProperty

public TimeProperty(java.lang.String name,
                    java.lang.String nameForDisplay,
                    java.lang.String 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.
defaultValue - the default value

TimeProperty

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

TimeProperty

public TimeProperty(java.lang.String name,
                    java.lang.String defaultValue)
Parameters:
name - the technical name used internally. See Property.getName(). 'nameForDisplay' is set to the same value.
defaultValue - the default value
Method Detail

onKeeperSet

protected void onKeeperSet()

Overrides:
onKeeperSet in class Property

onValueChanged

protected void onValueChanged(java.lang.Long oldValue,
                              long newValue)
Invoked when the value has changed.

Parameters:
oldValue - the old value
newValue - the new value

setNanoValue

protected final boolean setNanoValue(long nanos,
                                     boolean firstTime)
Sets the property's value.

Parameters:
nanos - the time in nano seconds
firstTime -
Returns:
changed?

setNanoValue

public final boolean setNanoValue(long nanos)
Sets the property's value.

Parameters:
nanos - the time in nano seconds
Returns:
changed?

getNanoValue

public final long getNanoValue()
Gets the current value as nano seconds.

Returns:
the current value as nano seconds.

setTimeValue

public final boolean setTimeValue(java.lang.String time)
Sets the property's value.

Parameters:
time - the new value in the format "00:00:00".
Returns:
changed?

getTimeValue

public final java.lang.String getTimeValue()
Gets the current value as a time string.

Returns:
the current value as a time string.

setValue

public void setValue(java.lang.Object value)
Sets the new value for this property.

Specified by:
setValue in class Property
Parameters:
value - the new value

getValue

public java.lang.String getValue()
Gets the current value fo this property.

Specified by:
getValue in class Property
Returns:
the current value fo this property.

loadValue

public void loadValue(PropertyLoader loader,
                      java.lang.String value)
Loads the value from the configuration file.

Specified by:
loadValue in class Property
Parameters:
loader - the loader
value - the value to load