|
|||||||||
| 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.List
public class List
Displays a list of selectable entries and fires an ActionEvent when the selected value
changes. Each entry is displayed as a string obtained by calling Object.toString() on the
supplied values.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.threerings.opengl.gui.Container |
|---|
Container.ChildOp |
| Field Summary | |
|---|---|
protected int |
_selidx
The index of the current selection (or -1 for none). |
protected ActionListener |
_slistener
Listens for button selections. |
protected ArrayList<Object> |
_values
The values contained in the list. |
| 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.Selectable |
|---|
SELECT |
| Constructor Summary | |
|---|---|
List(GlContext ctx)
Creates an empty list. |
|
List(GlContext ctx,
Object[] values)
Creates a list and populates it with the supplied values. |
|
| Method Summary | |
|---|---|
void |
addValue(Object value)
Adds a value to the list. |
protected String |
getDefaultStyleConfig()
Returns the name of the default config to be used for all instances of this component. |
Object |
getSelected()
Get the selected item, if any. |
int |
getSelectedIndex()
Get the index of the selected item, or -1. |
Object |
getSelectedValue()
Deprecated. |
boolean |
removeValue(Object value)
Removes a value from the list, if it is present. |
void |
setSelected(Object value)
Set the selected item. |
void |
setSelectedIndex(int index)
Set the index of the selected item. |
void |
setSelectedValue(Object value)
Deprecated. |
void |
setValues(Object[] values)
Sets the list's values. |
| 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, setEnabled, 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 ArrayList<Object> _values
protected int _selidx
protected ActionListener _slistener
| Constructor Detail |
|---|
public List(GlContext ctx)
public List(GlContext ctx,
Object[] values)
| Method Detail |
|---|
public void setValues(Object[] values)
public void addValue(Object value)
public boolean removeValue(Object value)
public Object getSelected()
Selectable
getSelected in interface Selectable<Object>public void setSelected(Object value)
Selectable
setSelected in interface Selectable<Object>public int getSelectedIndex()
Selectable
getSelectedIndex in interface Selectable<Object>public void setSelectedIndex(int index)
Selectable
setSelectedIndex in interface Selectable<Object>@Deprecated public Object getSelectedValue()
@Deprecated public void setSelectedValue(Object value)
protected String getDefaultStyleConfig()
Component
getDefaultStyleConfig in class Container
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||