|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xith3d.ui.hud.base.Widget
org.xith3d.ui.hud.base.BackgroundSettableWidget
org.xith3d.ui.hud.base.AbstractList
public abstract class AbstractList
This is the base implementation for a List Widget.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.xith3d.ui.hud.base.BackgroundSettableWidget |
|---|
BackgroundSettableWidget.BackgroundSettableDescriptionBase |
| Nested classes/interfaces inherited from class org.xith3d.ui.hud.base.Widget |
|---|
Widget.DescriptionBase |
| Field Summary | |
|---|---|
protected static boolean |
DEFAULT_HEAVYWEIGHT
|
| Fields inherited from class org.xith3d.ui.hud.base.Widget |
|---|
transformHeight_Pixels2HUD, transformWidth_Pixels2HUD |
| Constructor Summary | |
|---|---|
protected |
AbstractList(boolean isHeavyWeight,
org.openmali.vecmath2.Colorf backgroundColor,
Texture2D backgroundTexture,
TileMode tileMode,
ListModel model)
Creates a new AbstractList. |
protected |
AbstractList(boolean isHeavyWeight,
float width,
float height,
org.openmali.vecmath2.Colorf backgroundColor,
Texture2D backgroundTexture,
TileMode tileMode,
ListModel model)
Creates a new AbstractList with the given width and height. |
| Method Summary | |
|---|---|
java.lang.Object |
addItem(int index,
java.lang.Object item)
Adds the given Item to the List (at the given position). |
int |
addItem(java.lang.Object item)
Adds the given Item to the List (at the end). |
void |
addItems(java.util.List<?> items)
Adds all items from the given List to this List. |
void |
addItems(java.lang.Object[] items)
Adds all items from the given array to this List. |
abstract boolean |
addItemSetsSelectedItem()
If set to true, the addItem() method sets the selected item to the added one. |
abstract void |
addSelectionListener(ListSelectionListener l)
Adds a new ListSelectionListener. |
protected void |
afterFirstItemAdded()
|
protected void |
afterItemAddedToEnd()
|
protected void |
afterModelSetWidthItems(ListModel model)
|
void |
clear()
Removes all items from the List. |
int |
findItem(java.lang.Object item)
Finds the first item, which's equals() method returns true for the given value. |
abstract TextAlignment |
getAlignment()
This alignment is used to render the items, if possible. |
abstract int |
getBottomIndex()
The bottom-most item's index visible in the List (or -1, if the List is empty) |
abstract org.openmali.vecmath2.Colorf |
getHoverBackgroundColor()
|
java.lang.Object |
getItem(int index)
Gets the item from the specified index. |
int |
getItemsCount()
|
ListModel |
getModel()
Gets the underlying model. |
int |
getSelectedIndex()
|
java.lang.Object |
getSelectedItem()
Returns the currently selected Item. |
abstract org.openmali.vecmath2.Colorf |
getSelectionBackgroundColor()
|
abstract int |
getTopIndex()
The top-most item's index visible in the List (or -1, if the List is empty) |
protected Widget |
getWidget(float contentWidth,
int itemIndex)
|
protected void |
onAttachedToHUD(HUD hud)
This event is fired, when this Widget is added to the HUD live Widget hierarchy. |
java.lang.Object |
removeItem(int index)
Removes the given Item from the List. |
abstract void |
removeSelectionListener(ListSelectionListener l)
Removes a ListSelectionListener. |
abstract void |
scrollSelectedItemIntoView()
Scrolls the list, so that the selected item is in the content area. |
int |
selectNextItem()
Sets the selected item to the following one of the currently selected item. |
int |
selectPreviousItem()
Sets the selected item to the previous one of the currently selected item. |
abstract void |
setAddItemSetsSelectedItem(boolean b)
If set to true, the addItem() method sets the selected item to the added one. |
abstract void |
setAlignment(TextAlignment alignment)
This alignment is used to render the items, if possible. |
abstract void |
setHoverBackgroundColor(org.openmali.vecmath2.Colorf color)
Sets the background-color of the hovered Item. |
void |
setModel(ListModel model)
Sets the underlying model. |
boolean |
setPadding(int padding)
Sets padding for this PaddingSettable Widget. |
void |
setSelectedIndex(int itemIndex)
Sets the currently selected Item. |
abstract void |
setSelectionBackgroundColor(org.openmali.vecmath2.Colorf color)
Sets the background-color of the selected Item. |
abstract void |
setTopIndex(int topIndex)
Scrolls the list, so that the given index is the top item's index (if possible). |
protected void |
updateSizesAndMarkDirty()
|
| Methods inherited from class org.xith3d.ui.hud.base.BackgroundSettableWidget |
|---|
drawBackground, getBackgroundColor, getBackgroundTexture, getBackgroundTileMode, setBackground, setBackground, setBackground, setBackgroundColor, setBackgroundTexture, setBackgroundTexture, setBackgroundTexture, setBackgroundTexture, setBackgroundTileMode, setNoBackground |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.xith3d.ui.hud.base.PaddingSettable |
|---|
getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, setPadding |
| Field Detail |
|---|
protected static final boolean DEFAULT_HEAVYWEIGHT
| Constructor Detail |
|---|
protected AbstractList(boolean isHeavyWeight,
org.openmali.vecmath2.Colorf backgroundColor,
Texture2D backgroundTexture,
TileMode tileMode,
ListModel model)
isHeavyWeight - backgroundColor - backgroundTexture - tileMode - model - the ListModel (null for auto-generation)
protected AbstractList(boolean isHeavyWeight,
float width,
float height,
org.openmali.vecmath2.Colorf backgroundColor,
Texture2D backgroundTexture,
TileMode tileMode,
ListModel model)
isHeavyWeight - width - the new width of this Widgetheight - the new height of this WidgetbackgroundColor - backgroundTexture - tileMode - model - the ListModel (null for auto-generation)| Method Detail |
|---|
protected void afterModelSetWidthItems(ListModel model)
model - public void setModel(ListModel model)
model - public ListModel getModel()
public final boolean setPadding(int padding)
setPadding in interface PaddingSettablepadding - padding for bottom, right, top and left
public abstract void setHoverBackgroundColor(org.openmali.vecmath2.Colorf color)
color - public abstract org.openmali.vecmath2.Colorf getHoverBackgroundColor()
public abstract void setSelectionBackgroundColor(org.openmali.vecmath2.Colorf color)
color - public abstract org.openmali.vecmath2.Colorf getSelectionBackgroundColor()
public abstract void setAlignment(TextAlignment alignment)
alignment - public abstract TextAlignment getAlignment()
public abstract void addSelectionListener(ListSelectionListener l)
l - the new listenerpublic abstract void removeSelectionListener(ListSelectionListener l)
l - the listener to be removedpublic void setSelectedIndex(int itemIndex)
itemIndex - public final int getSelectedIndex()
public java.lang.Object getSelectedItem()
public int findItem(java.lang.Object item)
item -
public final int selectPreviousItem()
public final int selectNextItem()
public abstract void setAddItemSetsSelectedItem(boolean b)
b - public abstract boolean addItemSetsSelectedItem()
public abstract void scrollSelectedItemIntoView()
protected void afterItemAddedToEnd()
protected void afterFirstItemAdded()
public java.lang.Object addItem(int index,
java.lang.Object item)
index - the position to add the Item atitem - the new Item to add to the Listpublic final int addItem(java.lang.Object item)
item - the new Item to add to the List
public void addItems(java.util.List<?> items)
items - public void addItems(java.lang.Object[] items)
items - public java.lang.Object removeItem(int index)
index - the position of the Item to be removed
public void clear()
public final int getItemsCount()
protected final Widget getWidget(float contentWidth,
int itemIndex)
public java.lang.Object getItem(int index)
index - the index to get the Item from
public abstract void setTopIndex(int topIndex)
topIndex - public abstract int getTopIndex()
public abstract int getBottomIndex()
protected void updateSizesAndMarkDirty()
protected void onAttachedToHUD(HUD hud)
onAttachedToHUD in class Widgethud - the HUD, the Widget is added to
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||