|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.opengl.gui.Component
com.threerings.opengl.gui.Container
com.threerings.opengl.gui.Spinner
public class Spinner
Displays a value with little next and previous buttons.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.threerings.opengl.gui.Container |
|---|
Container.ChildOp |
| Field Summary | |
|---|---|
protected String |
_action
Our action string. |
protected TextComponent |
_editor
Our label. |
protected SpinnerLogic |
_logic
Spinner logic. |
protected ChangeListener |
_modelListener
Listens for changes to the model and updates our state. |
protected Button |
_next
Our buttons. |
protected Button |
_prev
Our buttons. |
| Fields inherited from class com.threerings.opengl.gui.Container |
|---|
_children, _layout |
| Fields inherited from class com.threerings.opengl.gui.Component |
|---|
_alpha, _backgrounds, _borders, _colors, _ctx, _cursor, _enabled, _height, _hover, _hoverable, _insets, _listeners, _parent, _preferredSize, _properties, _rect, _styleConfigs, _tipmouse, _tiptext, _tooltipStyle, _transferHandler, _valid, _visible, _width, _x, _y, DEFAULT, DISABLED, HOVER, STATE_COUNT, STATE_PCLASSES |
| Fields inherited from interface com.threerings.opengl.gui.UIConstants |
|---|
BOTTOM, CENTER, DEFAULT_SIZE, DEFAULT_SPACING, GLOW, HORIZONTAL, LEFT, NORMAL, OUTLINE, OVERLAPPING, PLAIN, RIGHT, SHADOW, TOP, VERTICAL |
| Constructor Summary | |
|---|---|
Spinner(GlContext ctx)
Creates a spinner with a default Number spinner model with no minimum or maximum value, stepSize equal to 1, and an initial value of 0. |
|
Spinner(GlContext ctx,
SpinnerModel model)
Creates a spinner with the specified spinner model. |
|
| Method Summary | |
|---|---|
protected TextComponent |
createEditor(SpinnerModel model)
Create the editor to use for this spinner. |
protected void |
fireAction(long when,
int modifiers)
Fire our action. |
String |
getAction()
Get the action of this spinner. |
protected String |
getDefaultStyleConfig()
Returns the name of the default config to be used for all instances of this component. |
SpinnerModel |
getModel()
Get the current model. |
void |
setAction(String action)
Set the action that will be fired when the state of this spinner changes, the argument will be the current value of the model. |
void |
setEditorStyleConfig(ConfigReference<StyleConfig> ref)
Configures the style of the editor. |
void |
setEnabled(boolean enabled)
Sets this components enabled state. |
void |
setModel(SpinnerModel newModel)
Set a new model. |
void |
setNextStyleConfig(ConfigReference<StyleConfig> ref)
Configures the style of the next button. |
void |
setPreviousStyleConfig(ConfigReference<StyleConfig> ref)
Configures the style of the previous button. |
void |
setStyleConfig(String name)
Sets the style configuration. |
protected void |
valueChanged()
The state of the model has changed: fire an action if applicable. |
| Methods inherited from class com.threerings.opengl.gui.Container |
|---|
add, add, add, add, applyOperation, computePreferredSize, getComponent, getComponentCount, getComponentIndex, getFirstDescendantFocus, getHitComponent, getLastDescendantFocus, getLayoutManager, getNextFocus, getPreviousFocus, layout, remove, remove, removeAll, renderComponent, replace, setAlpha, setHoverable, setLayoutManager, validate, wasAdded, wasRemoved |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected SpinnerLogic _logic
protected String _action
protected TextComponent _editor
protected Button _next
protected Button _prev
protected ChangeListener _modelListener
| Constructor Detail |
|---|
public Spinner(GlContext ctx)
public Spinner(GlContext ctx,
SpinnerModel model)
| Method Detail |
|---|
public void setModel(SpinnerModel newModel)
public SpinnerModel getModel()
public void setAction(String action)
public String getAction()
public void setEnabled(boolean enabled)
Component
setEnabled in class Containerpublic void setStyleConfig(String name)
Component
setStyleConfig in class Componentpublic void setEditorStyleConfig(ConfigReference<StyleConfig> ref)
public void setNextStyleConfig(ConfigReference<StyleConfig> ref)
public void setPreviousStyleConfig(ConfigReference<StyleConfig> ref)
protected TextComponent createEditor(SpinnerModel model)
protected void valueChanged()
protected void fireAction(long when,
int modifiers)
protected String getDefaultStyleConfig()
Component
getDefaultStyleConfig in class Container
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||