public class DefaultBoundedRangeModel extends java.lang.Object implements BoundedRangeModel
Constructor and Description |
---|
DefaultBoundedRangeModel(int minimum,
int maximum,
int initialValue)
Creates a default bounded range model with the given minimum value, maximum value and initial value.
|
Modifier and Type | Method and Description |
---|---|
void |
addOnValueChangeListener(OnValueChangeListener onValueChangeListener)
Adds a listener on the value change events of the range.
|
int |
getMaximum()
Gets the range maximum.
|
int |
getMinimum()
Gets the range minimum.
|
float |
getPercentComplete()
Gets the percent complete for the range.
|
int |
getValue()
Gets the current value.
|
void |
removeOnValueChangeListener(OnValueChangeListener onValueChangeListener)
Removes a listener on the value change events of the range.
|
void |
setMaximum(int maximum)
Sets the range maximum.
|
void |
setMinimum(int minimum)
Sets the range minimum.
|
void |
setValue(int value)
Sets the current value.
|
public DefaultBoundedRangeModel(int minimum, int maximum, int initialValue)
minimum
- the minimum value of the model.maximum
- the maximum value of the model.initialValue
- the initial value of the model.java.lang.IllegalArgumentException
- if the constraint minimum <= initialValue <= maximum
is not satisfied.public int getMaximum()
BoundedRangeModel
getMaximum
in interface BoundedRangeModel
public int getMinimum()
BoundedRangeModel
getMinimum
in interface BoundedRangeModel
public int getValue()
BoundedRangeModel
getValue
in interface BoundedRangeModel
public float getPercentComplete()
BoundedRangeModel
getPercentComplete
in interface BoundedRangeModel
public void setMaximum(int maximum)
BoundedRangeModel
minimum <= value <= maximum
. Notifies the listener if the model changes.setMaximum
in interface BoundedRangeModel
maximum
- the maximum to set.public void setMinimum(int minimum)
BoundedRangeModel
minimum <= value <= maximum
. Notifies the listener if the model changes.setMinimum
in interface BoundedRangeModel
minimum
- the minimum to set.public void setValue(int value)
BoundedRangeModel
minimum <= value <= maximum
. That means that the value will be bounded to
the range [minimum; maximum]. Notifies the listener if the model changes.setValue
in interface BoundedRangeModel
value
- the value to set.public void addOnValueChangeListener(OnValueChangeListener onValueChangeListener)
BoundedRangeModel
addOnValueChangeListener
in interface BoundedRangeModel
onValueChangeListener
- the value listener to add.public void removeOnValueChangeListener(OnValueChangeListener onValueChangeListener)
BoundedRangeModel
removeOnValueChangeListener
in interface BoundedRangeModel
onValueChangeListener
- the value listener to remove.