Class ArraySelection<T>
- java.lang.Object
-
- com.badlogic.gdx.scenes.scene2d.utils.Selection<T>
-
- com.badlogic.gdx.scenes.scene2d.utils.ArraySelection<T>
-
- All Implemented Interfaces:
Disableable
,java.lang.Iterable<T>
public class ArraySelection<T> extends Selection<T>
A selection that supports range selection by knowing about the array of items being selected.
-
-
Constructor Summary
Constructors Constructor Description ArraySelection(Array<T> array)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
changed()
Called after the selection changes, clears the range start item.void
choose(T item)
Selects or deselects the specified item based on how the selection is configured, whether ctrl is currently pressed, etc.boolean
getRangeSelect()
void
setRangeSelect(boolean rangeSelect)
void
validate()
Removes objects from the selection that are no longer in the items array.-
Methods inherited from class com.badlogic.gdx.scenes.scene2d.utils.Selection
add, addAll, clear, contains, fireChangeEvent, first, getLastSelected, getMultiple, getRequired, getToggle, hasItems, isDisabled, isEmpty, items, iterator, notEmpty, remove, removeAll, set, setActor, setAll, setDisabled, setMultiple, setProgrammaticChangeEvents, setRequired, setToggle, size, toArray, toArray, toString
-
-
-
-
Method Detail
-
choose
public void choose(T item)
Description copied from class:Selection
Selects or deselects the specified item based on how the selection is configured, whether ctrl is currently pressed, etc. This is typically invoked by user interaction.
-
changed
protected void changed()
Called after the selection changes, clears the range start item.
-
getRangeSelect
public boolean getRangeSelect()
-
setRangeSelect
public void setRangeSelect(boolean rangeSelect)
-
validate
public void validate()
Removes objects from the selection that are no longer in the items array. IfSelection.getRequired()
is true and there is no selected item, the first item is selected.
-
-