Package heronarts.lx.parameter
Class BooleanParameter
java.lang.Object
heronarts.lx.parameter.LXListenableParameter
heronarts.lx.parameter.LXListenableNormalizedParameter
heronarts.lx.parameter.BooleanParameter
- All Implemented Interfaces:
LXPath
,LXNormalizedParameter
,LXParameter
- Direct Known Subclasses:
TriggerParameter
A simple parameter that has a binary value of off or on
-
Nested Class Summary
Nested classes/interfaces inherited from interface heronarts.lx.parameter.LXNormalizedParameter
LXNormalizedParameter.OscMode
Nested classes/interfaces inherited from interface heronarts.lx.parameter.LXParameter
LXParameter.Collection, LXParameter.Formatter, LXParameter.Monitor, LXParameter.MultiMonitor, LXParameter.Polarity, LXParameter.Units
-
Field Summary
Fields inherited from class heronarts.lx.parameter.LXListenableParameter
description
Fields inherited from interface heronarts.lx.LXPath
ROOT, ROOT_PREFIX, ROOT_SLASH
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetMode()
double
Gets the value of the parameter in a normalized space from 0 to 1float
Gets the value of the parameter in a normalized space as a floatboolean
boolean
isOn()
setDescription
(String description) setMappable
(boolean mappable) Sets whether this parameter should be eligible for MIDI/modulation mapping or not.setMode
(BooleanParameter.Mode mode) setNormalized
(double normalized) Sets the value or the parameter in normalized space from 0 to 1setValue
(boolean value) toggle()
protected double
updateValue
(double value) Invoked when the value has changed.Methods inherited from class heronarts.lx.parameter.LXListenableNormalizedParameter
getExponent, getNormalizedWithModulation, getOscMode, incrementNormalized, incrementNormalized, isWrappable, setExponent, setOscMode, setUnits, setWrappable
Methods inherited from class heronarts.lx.parameter.LXListenableParameter
addListener, addListener, bang, dispose, getDescription, getFormatter, getLabel, getParent, getParentParameter, getPath, getPolarity, getUnits, getValue, incrementValue, isDefault, isMappable, removeListener, reset, reset, setComponent, setFormatter, setPolarity, setValue, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface heronarts.lx.parameter.LXNormalizedParameter
getBaseNormalized, getBaseNormalizedf, getValueFromNormalized
Methods inherited from interface heronarts.lx.parameter.LXParameter
dispose, getBaseValue, getBaseValuef, getFormatter, getLabel, getParentParameter, getPolarity, getUnits, getValue, getValuef, isMappable, reset, setComponent, setFormatter, setValue
Methods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, getDescription, getParent, getPath, isDescendant
-
Constructor Details
-
BooleanParameter
-
BooleanParameter
-
-
Method Details
-
setMappable
Description copied from interface:LXParameter
Sets whether this parameter should be eligible for MIDI/modulation mapping or not.- Specified by:
setMappable
in interfaceLXParameter
- Overrides:
setMappable
in classLXListenableParameter
- Parameters:
mappable
- Whether parameter should be available for mapping- Returns:
- this
-
setDescription
- Overrides:
setDescription
in classLXListenableParameter
-
setMode
-
getMode
-
isOn
public boolean isOn() -
getValueb
public boolean getValueb() -
setValue
-
toggle
-
updateValue
protected double updateValue(double value) Description copied from class:LXListenableParameter
Invoked when the value has changed. Subclasses should update any special internal state according to this new value.- Specified by:
updateValue
in classLXListenableParameter
- Parameters:
value
- New value- Returns:
- this
-
getNormalized
public double getNormalized()Description copied from interface:LXNormalizedParameter
Gets the value of the parameter in a normalized space from 0 to 1- Returns:
- Value of parameter, normalized to range from 0 to 1
-
getNormalizedf
public float getNormalizedf()Description copied from interface:LXNormalizedParameter
Gets the value of the parameter in a normalized space as a float- Returns:
- Normalized value of parameter, in range from 0 to 1
-
setNormalized
Description copied from interface:LXNormalizedParameter
Sets the value or the parameter in normalized space from 0 to 1- Parameters:
normalized
- The normalized value, from 0 to 1- Returns:
- this, for method chaining
-