public class List extends Widget implements Cullable
ChangeListener.ChangeEvent is fired when the list selection changes.
The preferred size of the list is determined by the text bounds of the items and the size of the List.ListStyle.selection.
| Modifier and Type | Class and Description |
|---|---|
static class |
List.ListStyle
The style for a list, see
List. |
| Constructor and Description |
|---|
List(java.lang.Object[] items,
List.ListStyle style) |
List(java.lang.Object[] items,
Skin skin) |
List(java.lang.Object[] items,
Skin skin,
java.lang.String styleName) |
| Modifier and Type | Method and Description |
|---|---|
void |
draw(SpriteBatch batch,
float parentAlpha)
If this method is overridden, the super method or
Widget.validate() should be called to ensure the widget is laid out. |
java.lang.String[] |
getItems() |
float |
getPrefHeight() |
float |
getPrefWidth() |
int |
getSelectedIndex() |
java.lang.String |
getSelection() |
List.ListStyle |
getStyle()
Returns the list's style.
|
void |
setCullingArea(Rectangle cullingArea) |
void |
setItems(java.lang.Object[] objects) |
void |
setSelectedIndex(int index) |
int |
setSelection(java.lang.String item) |
void |
setStyle(List.ListStyle style) |
getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, invalidate, invalidateHierarchy, layout, needsLayout, pack, setFillParent, setLayoutEnabled, validateact, addAction, addCaptureListener, addListener, clear, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, fire, getActions, getCaptureListeners, getColor, getHeight, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getStage, getTop, getTouchable, getWidth, getX, getY, getZIndex, hasParent, hit, isAscendantOf, isDescendantOf, isVisible, localToAscendantCoordinates, localToParentCoordinates, localToStageCoordinates, notify, parentToLocalCoordinates, remove, removeAction, removeCaptureListener, removeListener, rotate, scale, scale, screenToLocalCoordinates, setBounds, setColor, setColor, setHeight, setName, setOrigin, setOriginX, setOriginY, setParent, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setStage, setTouchable, setVisible, setWidth, setX, setY, setZIndex, size, size, stageToLocalCoordinates, toBack, toFront, toString, translatepublic List(java.lang.Object[] items,
Skin skin)
public List(java.lang.Object[] items,
Skin skin,
java.lang.String styleName)
public List(java.lang.Object[] items,
List.ListStyle style)
public void setStyle(List.ListStyle style)
public List.ListStyle getStyle()
setStyle(ListStyle) is called.public void draw(SpriteBatch batch, float parentAlpha)
WidgetWidget.validate() should be called to ensure the widget is laid out.public int getSelectedIndex()
public void setSelectedIndex(int index)
public java.lang.String getSelection()
public int setSelection(java.lang.String item)
public void setItems(java.lang.Object[] objects)
public java.lang.String[] getItems()
public float getPrefWidth()
getPrefWidth in interface LayoutgetPrefWidth in class Widgetpublic float getPrefHeight()
getPrefHeight in interface LayoutgetPrefHeight in class Widgetpublic void setCullingArea(Rectangle cullingArea)
setCullingArea in interface CullablecullingArea - The culling area in the child actor's coordinates.