Package heronarts.lx.parameter
Class LXListenableParameter
java.lang.Object
heronarts.lx.parameter.LXListenableParameter
- All Implemented Interfaces:
- LXPath,- LXParameter
- Direct Known Subclasses:
- AggregateParameter,- LXListenableNormalizedParameter,- MutableParameter,- StringParameter
This is a parameter instance that can be listened to, meaning we are able to
 deterministically know when the value has changed. This means that all
 modifications *must* come through setValue().
- 
Nested Class SummaryNested classes/interfaces inherited from interface heronarts.lx.parameter.LXParameterLXParameter.Collection, LXParameter.Formatter, LXParameter.Monitor, LXParameter.MultiMonitor, LXParameter.Polarity, LXParameter.Units
- 
Field SummaryFieldsFields inherited from interface heronarts.lx.LXPathDEFAULT_SEPARATOR, ROOT, ROOT_PREFIX, ROOT_SLASH
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedprotectedLXListenableParameter(double value) protectedLXListenableParameter(String label) protectedLXListenableParameter(String label, double value) 
- 
Method SummaryModifier and TypeMethodDescriptionaddListener(LXParameterListener listener) addListener(LXParameterListener listener, boolean fireImmediately) bang()Manually notify all listeners of this parameter's current value.voiddispose()Invoked when the parameter is done being used and none of its resources are needed anymore.Returns a contextual help message explaining the purpose of this parameter or component to the user, or null if none is available.Gets the formatter to be used for printing this parameter's valuegetLabel()Gets the label for this parameterReturns the component that this object belongs toReturns the parent aggregate parameter that this parameter belongs togetPath()Returns the immediate path of this component, relative to its parentGets the polarity of this parameter.getUnits()Gets the unit format that this parameter's value stores.doublegetValue()Retrieves the value of the parameterincrementValue(double amount) final booleanbooleanWhether this parameter should be eligible for mapping via MIDI or modulation control.final LXListenableParameterremoveListener(LXParameterListener listener) reset()A method to reset the value of the parameter, if a default is available.reset(double value) Resets the value of the parameter, giving it a new default.setComponent(LXComponent component, String path) Sets the component that owns this parametersetDescription(String description) setFormatter(LXParameter.Formatter formatter) Sets the formatter used for printing this parameter's valuesetMappable(boolean mappable) Sets whether this parameter should be eligible for MIDI/modulation mapping or not.setPolarity(LXParameter.Polarity polarity) setUnits(LXParameter.Units units) final LXParametersetValue(double value) Sets the value of the parameter.final LXParametersetValue(double value, boolean notifyListeners) protected abstract doubleupdateValue(double value) Invoked when the value has changed.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface heronarts.lx.parameter.LXParametergetBaseValue, getBaseValuef, getValuefMethods inherited from interface heronarts.lx.LXPathgetCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, isDescendant
- 
Field Details- 
description
 
- 
- 
Constructor Details- 
LXListenableParameterprotected LXListenableParameter()
- 
LXListenableParameter
- 
LXListenableParameterprotected LXListenableParameter(double value) 
- 
LXListenableParameter
 
- 
- 
Method Details- 
getFormatterDescription copied from interface:LXParameterGets the formatter to be used for printing this parameter's value- Specified by:
- getFormatterin interface- LXParameter
- Returns:
- Formatter
 
- 
setFormatterDescription copied from interface:LXParameterSets the formatter used for printing this parameter's value- Specified by:
- setFormatterin interface- LXParameter
- Parameters:
- formatter- Formatter
- Returns:
- The parameter
 
- 
getUnitsDescription copied from interface:LXParameterGets the unit format that this parameter's value stores.- Specified by:
- getUnitsin interface- LXParameter
- Returns:
- Units
 
- 
setUnits
- 
getPolarityDescription copied from interface:LXParameterGets the polarity of this parameter.- Specified by:
- getPolarityin interface- LXParameter
- Returns:
- polarity of this parameter
 
- 
setPolarity
- 
addListener
- 
addListener
- 
removeListener
- 
setDescription
- 
getDescriptionDescription copied from interface:LXPathReturns a contextual help message explaining the purpose of this parameter or component to the user, or null if none is available.- Specified by:
- getDescriptionin interface- LXPath
- Returns:
- Contextual help string explaining purpose of the element
 
- 
setComponentDescription copied from interface:LXParameterSets the component that owns this parameter- Specified by:
- setComponentin interface- LXParameter
- Parameters:
- component- Component
- path- Path name for parameter
- Returns:
- this
 
- 
getParentParameterDescription copied from interface:LXParameterReturns the parent aggregate parameter that this parameter belongs to- Specified by:
- getParentParameterin interface- LXParameter
- Returns:
- Parent aggregate parameter, or null
 
- 
getParentDescription copied from interface:LXPathReturns the component that this object belongs to
- 
getPathDescription copied from interface:LXPathReturns the immediate path of this component, relative to its parent
- 
disposepublic void dispose()Description copied from interface:LXParameterInvoked when the parameter is done being used and none of its resources are needed anymore.- Specified by:
- disposein interface- LXParameter
 
- 
resetDescription copied from interface:LXParameterA method to reset the value of the parameter, if a default is available. Not necessarily defined for all parameters, may be ignored.- Specified by:
- resetin interface- LXParameter
- Returns:
- this
 
- 
resetResets the value of the parameter, giving it a new default. Future calls to reset() with no parameter will use this value.- Parameters:
- value- New default value
- Returns:
- this
 
- 
incrementValue
- 
setValueDescription copied from interface:LXParameterSets the value of the parameter.- Specified by:
- setValuein interface- LXParameter
- Parameters:
- value- The value
- Returns:
- this
 
- 
setValue
- 
getValuepublic double getValue()Description copied from interface:LXParameterRetrieves the value of the parameter- Specified by:
- getValuein interface- LXParameter
- Returns:
- Parameter value
 
- 
isDefaultpublic final boolean isDefault()
- 
getLabelDescription copied from interface:LXParameterGets the label for this parameter- Specified by:
- getLabelin interface- LXParameter
- Specified by:
- getLabelin interface- LXPath
- Returns:
- Label of parameter
 
- 
bangManually notify all listeners of this parameter's current value. Useful in some situations to force state reset.- Returns:
- this
 
- 
setMappableDescription copied from interface:LXParameterSets whether this parameter should be eligible for MIDI/modulation mapping or not.- Specified by:
- setMappablein interface- LXParameter
- Parameters:
- mappable- Whether parameter should be available for mapping
- Returns:
- this
 
- 
isMappablepublic boolean isMappable()Description copied from interface:LXParameterWhether this parameter should be eligible for mapping via MIDI or modulation control.- Specified by:
- isMappablein interface- LXParameter
- Returns:
- trueif mappable, false if otherwise
 
- 
updateValueprotected abstract double updateValue(double value) Invoked when the value has changed. Subclasses should update any special internal state according to this new value.- Parameters:
- value- New value
- Returns:
- this
 
 
-