public class DiscreteParameter extends LXListenableNormalizedParameter
LXParameter.Formatter, LXParameter.Polarity, LXParameter.Units
description
Constructor and Description |
---|
DiscreteParameter(String label,
int range)
Parameter with values from [0, range-1], 0 by default
|
DiscreteParameter(String label,
int min,
int max)
Parameter with values from [min, max-1], min by default
|
DiscreteParameter(String label,
int value,
int min,
int max)
Parameter with values from [min, max-1], value by default
|
DiscreteParameter(String label,
String[] options)
Parameter with set of String label values
|
DiscreteParameter(String label,
String[] options,
int value)
Parameter with set of String label values, and a default
|
Modifier and Type | Method and Description |
---|---|
DiscreteParameter |
decrement() |
DiscreteParameter |
decrement(boolean wrap) |
DiscreteParameter |
decrement(int amt) |
DiscreteParameter |
decrement(int amt,
boolean wrap) |
int |
getMaxValue() |
int |
getMinValue() |
double |
getNormalized()
Gets the value of the parameter in a normalized space from 0 to 1
|
float |
getNormalizedf()
Gets the value of the parameter in a normalized space as a float
|
String |
getOption()
The currently selected option
|
String[] |
getOptions()
The set of string labels for these parameters
|
int |
getRange() |
int |
getValuei() |
DiscreteParameter |
increment() |
DiscreteParameter |
increment(boolean wrap) |
DiscreteParameter |
increment(int amt) |
DiscreteParameter |
increment(int amt,
boolean wrap) |
DiscreteParameter |
setDescription(String description) |
DiscreteParameter |
setNormalized(double normalized)
Sets the value or the parameter in normalized space from 0 to 1
|
DiscreteParameter |
setOptions(String[] options)
Set the range and option strings for the parameter
|
DiscreteParameter |
setRange(int range)
Sets range from [0, range-1] inclusive
|
DiscreteParameter |
setRange(int minValue,
int maxValue)
Sets the range from [minValue, maxValue-1] inclusive
|
protected double |
updateValue(double value)
Invoked when the value has changed.
|
getExponent, isMappable, setExponent, setMappable
addListener, bang, dispose, getDescription, getFormatter, getLabel, getParent, getPath, getPolarity, getUnits, getValue, getValuef, incrementValue, removeListener, reset, reset, setComponent, setFormatter, setPolarity, setUnits, setValue
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
dispose, getDescription, getFormatter, getLabel, getPolarity, getUnits, getValue, getValuef, reset, setComponent, setValue
get, get, getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, getComponent, getComponent, getParameter, getParameter, getParent, getPath
public DiscreteParameter(String label, int range)
label
- Name of parameterrange
- range of valuespublic DiscreteParameter(String label, int min, int max)
label
- Labelmin
- Minimum valuemax
- Maximum value is 1 less than thispublic DiscreteParameter(String label, int value, int min, int max)
label
- Labelvalue
- Default valuemin
- Minimum value (inclusive)max
- Maximum value (exclusive)public DiscreteParameter(String label, String[] options)
label
- Labeloptions
- Valuespublic DiscreteParameter setDescription(String description)
setDescription
in class LXListenableParameter
protected double updateValue(double value)
LXListenableParameter
updateValue
in class LXListenableParameter
value
- New valuepublic int getMinValue()
public int getMaxValue()
public int getRange()
public String[] getOptions()
public String getOption()
public DiscreteParameter setOptions(String[] options)
options
- Array of string labelspublic DiscreteParameter setRange(int minValue, int maxValue)
minValue
- Minimum valuemaxValue
- Maximum value, exclusivepublic DiscreteParameter setRange(int range)
range
- Number of discrete valuespublic DiscreteParameter increment()
public DiscreteParameter increment(boolean wrap)
public DiscreteParameter increment(int amt)
public DiscreteParameter increment(int amt, boolean wrap)
public DiscreteParameter decrement()
public DiscreteParameter decrement(boolean wrap)
public DiscreteParameter decrement(int amt)
public DiscreteParameter decrement(int amt, boolean wrap)
public int getValuei()
public double getNormalized()
LXNormalizedParameter
public float getNormalizedf()
LXNormalizedParameter
public DiscreteParameter setNormalized(double normalized)
LXNormalizedParameter
normalized
- The normalized value, from 0 to 1LX library by Mark C. Slee. © 2012-2020