com.threerings.opengl.gui
Class List

java.lang.Object
  extended by com.threerings.opengl.gui.Component
      extended by com.threerings.opengl.gui.Container
          extended by com.threerings.opengl.gui.List
All Implemented Interfaces:
ConfigUpdateListener<ManagedConfig>, Selectable<Object>

public class List
extends Container
implements Selectable<Object>

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.


Field Summary
 
Fields inherited from class com.threerings.opengl.gui.Component
DEFAULT, DISABLED, HOVER
 
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.
 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, getComponent, getComponentCount, getComponentIndex, getHitComponent, getLayoutManager, remove, remove, removeAll, replace, setAlpha, setEnabled, setHoverable, setLayoutManager, validate
 
Methods inherited from class com.threerings.opengl.gui.Component
acceptsFocus, addListener, boundsToString, configUpdated, contains, createDefaultTooltipComponent, createDefaultTooltipComponent, dispatchEvent, getAbsoluteX, getAbsoluteY, getAlpha, getBackground, getBorder, getBounds, getColor, getContext, getCursor, getFocusTarget, getHeight, getInsets, getParent, getPreferredSize, getProperty, getState, getStyleConfigs, getTooltipText, getTooltipTimeout, getTooltipWindowStyle, getTransferHandler, getWidth, getX, getY, hasFocus, invalidate, isAdded, isEnabled, isHoverable, isShowing, isTooltipRelativeToMouse, isValid, isVisible, removeAllListeners, removeAllListeners, removeListener, render, requestFocus, scrollRectToVisible, setBackground, setBounds, setCursor, setLocation, setParent, setPreferredSize, setPreferredSize, setProperty, setSize, setStyleConfig, setStyleConfig, setStyleConfig, setStyleConfigs, setTooltipRelativeToMouse, setTooltipText, setTransferHandler, setVisible
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

List

public List(GlContext ctx)
Creates an empty list.


List

public List(GlContext ctx,
            Object[] values)
Creates a list and populates it with the supplied values.

Method Detail

setValues

public void setValues(Object[] values)
Sets the list's values.


addValue

public void addValue(Object value)
Adds a value to the list.


removeValue

public boolean removeValue(Object value)
Removes a value from the list, if it is present.

Returns:
true if the value was removed, false if it was not in the list

getSelected

public Object getSelected()
Description copied from interface: Selectable
Get the selected item, if any.

Specified by:
getSelected in interface Selectable<Object>

setSelected

public void setSelected(Object value)
Description copied from interface: Selectable
Set the selected item.

Specified by:
setSelected in interface Selectable<Object>

getSelectedIndex

public int getSelectedIndex()
Description copied from interface: Selectable
Get the index of the selected item, or -1.

Specified by:
getSelectedIndex in interface Selectable<Object>

setSelectedIndex

public void setSelectedIndex(int index)
Description copied from interface: Selectable
Set the index of the selected item.

Specified by:
setSelectedIndex in interface Selectable<Object>

getSelectedValue

@Deprecated
public Object getSelectedValue()
Deprecated. 


setSelectedValue

@Deprecated
public void setSelectedValue(Object value)
Deprecated. 



Copyright © 2011. All Rights Reserved.