|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.opengl.gui.BoundedRangeModel
public class BoundedRangeModel
Defines the model used by the ScrollBar to communicate with other components and
external entities that wish to be manipulated by a scroll bar.
A bounded range model has a minimum and maximum value, a current value and an extent. These are easily visualized by showing how they control a scroll bar:
+-------------------------------------------------------------------+ | +---------------------------------------+ | | | | | | +---------------------------------------+ | +-------------------------------------------------------------------+ min value value+extent max
| Constructor Summary | |
|---|---|
BoundedRangeModel(int min,
int value,
int extent,
int max)
Creates a bounded range model with the specified minimum value, current value, extent and maximum value. |
|
| Method Summary | |
|---|---|
void |
addChangeListener(ChangeListener listener)
Adds a listener to this model. |
MouseWheelListener |
createWheelListener()
Creates a mouse wheel listener that will respond to wheel events by adjusting this model up or down accordingly. |
int |
getExtent()
Returns the current extent of the model. |
int |
getMaximum()
Returns the maximum value this model will allow for value + extent. |
int |
getMinimum()
Returns the minimum value this model will allow for its value. |
int |
getRange()
Returns the range of this model (the maximum minus the minimum). |
float |
getRatio()
Returns the value of the model mapped into the range [0-1]: (value - minumum) / range. |
int |
getScrollIncrement()
Returns the increment by which this model should be scrolled when the user presses one of the buttons at the end of the scrollbar. |
int |
getValue()
Returns the current value of the model. |
void |
removeChangeListener(ChangeListener listener)
Removes the specified listener from the model. |
void |
setExtent(int extent)
Configures the extent of this model. |
void |
setMaximum(int maximum)
Configures the maximum value of this model, adjusting the value, extent and minimum as necessary to maintain the consistency of the model. |
void |
setMinimum(int minimum)
Configures the minimum value of this model, adjusting the value, extent and maximum as necessary to maintain the consistency of the model. |
boolean |
setRange(int min,
int value,
int extent,
int max)
Configures this model with a new minimum, maximum, current value and extent. |
void |
setValue(int value)
Configures the value of this model. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BoundedRangeModel(int min,
int value,
int extent,
int max)
| Method Detail |
|---|
public void addChangeListener(ChangeListener listener)
public void removeChangeListener(ChangeListener listener)
public int getMinimum()
public int getMaximum()
value + extent.
public int getRange()
public int getValue()
public int getExtent()
public float getRatio()
public int getScrollIncrement()
public void setMinimum(int minimum)
public void setMaximum(int maximum)
public void setValue(int value)
min <= value <= max - extent.
public void setExtent(int extent)
0 <= extent <= max - value.
public boolean setRange(int min,
int value,
int extent,
int max)
public MouseWheelListener createWheelListener()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||