|
|||||||||
| 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.ScrollingList<V,C>
public abstract class ScrollingList<V,C extends Component>
Provides a scrollable, lazily instantiated component view of values
| Nested Class Summary | |
|---|---|
protected static class |
ScrollingList.Entry<V,C extends Component>
Used to track the total height of our entries. |
protected class |
ScrollingList.Viewport
Does all the heavy lifting for the ScrollingList. |
| Nested classes/interfaces inherited from class com.threerings.opengl.gui.Container |
|---|
Container.ChildOp |
| Field Summary | |
|---|---|
protected int |
_lastBottom
|
protected BoundedRangeModel |
_model
|
protected List<ScrollingList.Entry<V,C>> |
_values
|
protected ScrollBar |
_vbar
|
protected ScrollingList.Viewport |
_vport
|
protected MouseWheelListener |
_wheelListener
|
protected static int |
EXTENT
|
| 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 |
| Constructor Summary | |
|---|---|
ScrollingList(GlContext ctx)
Instantiates an empty ScrollingList. |
|
ScrollingList(GlContext ctx,
Collection<? extends V> values)
Instantiates a ScrollingList with an initial value collection. |
|
| Method Summary | |
|---|---|
void |
addValue(int index,
V value)
Inserts a value into our list at the specified position. |
protected void |
addValue(int index,
V value,
boolean snap)
Adds a value to the list and snaps to the bottom of the list if desired. |
void |
addValue(V value,
boolean snapToBottom)
Appends a value to our list, possibly scrolling our view to display it. |
void |
addValues(Collection<? extends V> values)
Inserts a collection of values into our list. |
void |
addValues(int index,
Collection<? extends V> values)
Inserts a collection of values into our list starting at the specified position. |
protected void |
computeHeight(ScrollingList.Entry<V,C> entry,
Container container)
Calculates the height of an entry. |
protected abstract C |
createComponent(V value)
Must be implemented by subclasses to instantiate the correct Component subclass for a given list value. |
int |
getIndex(V value)
Returns the index of a value. |
void |
removeValues()
Clears all the current values and any related components. |
void |
removeValuesAt(int index,
int num)
Removes values starting at a specific index. |
void |
removeValuesFromTop(int num)
Removes values from the top of the list. |
void |
snapToValue(V value)
Snaps the view so the value is at the top. |
| Methods inherited from class com.threerings.opengl.gui.Container |
|---|
add, add, add, add, applyOperation, computePreferredSize, getComponent, getComponentCount, getComponentIndex, getDefaultStyleConfig, 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 MouseWheelListener _wheelListener
protected BoundedRangeModel _model
protected List<ScrollingList.Entry<V,C extends Component>> _values
protected ScrollingList.Viewport _vport
protected ScrollBar _vbar
protected int _lastBottom
protected static final int EXTENT
| Constructor Detail |
|---|
public ScrollingList(GlContext ctx)
ScrollingList.
public ScrollingList(GlContext ctx,
Collection<? extends V> values)
ScrollingList with an initial value collection.
| Method Detail |
|---|
public void addValue(V value,
boolean snapToBottom)
public void addValue(int index,
V value)
public void addValues(Collection<? extends V> values)
public void addValues(int index,
Collection<? extends V> values)
public void removeValues()
public int getIndex(V value)
public void removeValuesFromTop(int num)
public void removeValuesAt(int index,
int num)
public void snapToValue(V value)
protected abstract C createComponent(V value)
protected void computeHeight(ScrollingList.Entry<V,C> entry,
Container container)
protected void addValue(int index,
V value,
boolean snap)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||