|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.opengl.gui.SpinnerLogic
public class SpinnerLogic
Contains the logic for a spinner, allowing the hook-up of any buttons/label.
| Field Summary | |
|---|---|
protected ActionListener |
_buttonListener
Listens to our buttons and updates the model when they're pressed. |
protected boolean |
_enabled
Are we enabled? |
protected TextComponent |
_label
Displays and allows direct editing of the value. |
protected SpinnerModel |
_model
Our model. |
protected ChangeListener |
_modelListener
Listens for changes to the model and updates our state. |
protected Button |
_next
The next and previous buttons. |
protected Button |
_prev
The next and previous buttons. |
| Constructor Summary | |
|---|---|
SpinnerLogic(TextComponent label,
Button next,
Button prev,
SpinnerModel model)
Create the logic of a spinner with other components. |
|
| Method Summary | |
|---|---|
SpinnerModel |
getModel()
Get the current model. |
protected int |
getRotationCount(ActionEvent event)
Get the number of times to rotate the spinner... |
Object |
getValue()
Convenience to get the current value of this spinner. |
void |
setEnabled(boolean enabled)
Set whether the logic of the spinner should be enabled. |
void |
setModel(SpinnerModel newModel)
Set a new model. |
protected void |
updateButtons()
Update the enabled state of the buttons. |
protected void |
updateValue()
The state of the model has changed: update our subcomponents and fire an action if applicable. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Button _next
protected Button _prev
protected TextComponent _label
protected SpinnerModel _model
protected boolean _enabled
protected ChangeListener _modelListener
protected ActionListener _buttonListener
| Constructor Detail |
|---|
public SpinnerLogic(TextComponent label,
Button next,
Button prev,
SpinnerModel model)
| Method Detail |
|---|
public void setModel(SpinnerModel newModel)
public SpinnerModel getModel()
public Object getValue()
public void setEnabled(boolean enabled)
protected void updateValue()
protected void updateButtons()
protected int getRotationCount(ActionEvent event)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||