Package heronarts.lx.parameter
Class TimeParameter
java.lang.Object
heronarts.lx.parameter.LXListenableParameter
heronarts.lx.parameter.AggregateParameter
heronarts.lx.parameter.TimeParameter
- All Implemented Interfaces:
LXPath,LXParameter
A time parameter is a utility for specifying a time of day in discrete
hours, minutes, and seconds components.
-
Nested Class Summary
Nested classes/interfaces inherited from interface heronarts.lx.parameter.LXParameter
LXParameter.Collection, LXParameter.Formatter, LXParameter.Monitor, LXParameter.MultiMonitor, LXParameter.Polarity, LXParameter.Units -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal DiscreteParameterstatic final intfinal DiscreteParameterstatic final intfinal DiscreteParameterstatic final intstatic final intstatic final intFields inherited from class heronarts.lx.parameter.AggregateParameter
subparametersFields inherited from class heronarts.lx.parameter.LXListenableParameter
descriptionFields inherited from interface heronarts.lx.LXPath
DEFAULT_SEPARATOR, ROOT, ROOT_PREFIX, ROOT_SLASH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the stored time value as a number of seconds elapsed in the daystatic intgetSecondsOfDay(int hours, int minutes, int seconds) static intgetSecondsOfDay(Calendar calendar) protected voidSubclasses should update the main parameter value when a sub-parameter has changedsetDescription(String description) setTime(int secondsOfDay) Sets the time parameter to the given number of seconds in the daysetTime(int hours, int minutes, int seconds) Sets the value of the time parameterprotected voidupdateSubparameters(double value) Subclasses should update the subparameter values based upon the raw parameter value if it has been set directly.Methods inherited from class heronarts.lx.parameter.AggregateParameter
addSubparameter, dispose, getRemoteControl, onUpdateValue, updateValueMethods inherited from class heronarts.lx.parameter.LXListenableParameter
addListener, addListener, bang, getDescription, getFormatter, getLabel, getParent, getParentParameter, getPath, getPolarity, getUnits, getValue, incrementValue, isDefault, isMappable, removeListener, reset, reset, setComponent, setFormatter, setMappable, setPolarity, setUnits, setValue, setValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface heronarts.lx.parameter.LXParameter
getBaseValue, getBaseValuef, getValuefMethods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, isDescendant
-
Field Details
-
HOURS_PER_DAY
public static final int HOURS_PER_DAY- See Also:
-
MINUTES_PER_HOUR
public static final int MINUTES_PER_HOUR- See Also:
-
SECONDS_PER_MINUTE
public static final int SECONDS_PER_MINUTE- See Also:
-
SECONDS_PER_HOUR
public static final int SECONDS_PER_HOUR- See Also:
-
SECONDS_PER_DAY
public static final int SECONDS_PER_DAY- See Also:
-
hours
-
minutes
-
seconds
-
-
Constructor Details
-
TimeParameter
-
-
Method Details
-
setDescription
- Overrides:
setDescriptionin classLXListenableParameter
-
setTime
Sets the value of the time parameter- Parameters:
hours- Hours of day (0-23)minutes- Minutes of the hour (0-59)seconds- Seconds of the hour (0-59)- Returns:
- this
-
setTime
Sets the time parameter to the given number of seconds in the day- Parameters:
secondsOfDay- Seconds in the day (0 - TimeParameter.SECONDS_PER_DAY - 1)- Returns:
- this
-
getSecondsOfDay
public int getSecondsOfDay()Returns the stored time value as a number of seconds elapsed in the day- Returns:
- Number of seconds in the day this time represents
-
getSecondsOfDay
public static int getSecondsOfDay(int hours, int minutes, int seconds) -
getSecondsOfDay
-
updateSubparameters
protected void updateSubparameters(double value) Description copied from class:AggregateParameterSubclasses should update the subparameter values based upon the raw parameter value if it has been set directly.- Specified by:
updateSubparametersin classAggregateParameter
-
onSubparameterUpdate
Description copied from class:AggregateParameterSubclasses should update the main parameter value when a sub-parameter has changed- Specified by:
onSubparameterUpdatein classAggregateParameter- Parameters:
p- Subparameter that has changed
-