|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xith3d.ui.hud.base.ListModel
public abstract class ListModel
A ListModel holds data for a List Widget.
| Constructor Summary | |
|---|---|
ListModel()
|
|
| Method Summary | |
|---|---|
void |
addItem(int index,
java.lang.Object item)
Adds a new Item at the given position. |
int |
addItem(java.lang.Object item)
Adds a new Item at the end of the list. |
protected abstract void |
addItemImpl(int index,
java.lang.Object item)
Adds a new Item at the given position. |
void |
addItems(java.util.List<?> items)
Adds all items from the given List to this ListModel. |
void |
addItems(java.lang.Object[] items)
Adds all items from the given array to this ListModel. |
boolean |
checkOnMouseButtonPressed(int itemIndex,
float itemLeft,
float listContentWidth,
float itemTop,
float itemBottom,
float mouseX,
float mouseY)
Checks, if the item should be selected after it was clicked at the specified location. |
protected boolean |
checkOnMouseButtonPressedImpl(int itemIndex,
float itemTop,
float itemBottom,
float mouseX,
float mouseY)
Checks, if the item should be selected after it was clicked at the specified location. |
abstract void |
clear()
Clears the list. |
java.lang.Object |
getItem(int index)
Gets the item at index index. |
float |
getItemHeight(int itemIndex)
Gets the item's height in HUD space. |
protected abstract float |
getItemHeightImpl(int itemIndex)
Gets the item's height in HUD space. |
protected abstract java.lang.Object |
getItemImpl(int index)
Gets the item at index index. |
abstract int |
getItemsCount()
Gets the number of items in the list. |
protected AbstractList |
getList()
Gets the List Widget, that this model is used for (can be null). |
float |
getMinItemWidth(int itemIndex)
Gets the item's minimum width in HUD space. |
protected abstract float |
getMinItemWidthImpl(int itemIndex)
Gets the item's minimum width in HUD space. |
int |
getSelectedIndex()
Gets the selected index. |
java.lang.Object |
getSelectedItem()
Gets the selected item. |
protected abstract Widget[] |
getUsedWidgets()
Gets an array of all Widgets, that are used by this model. |
boolean |
getUsesFixedHeight()
Returns, whether all items have the same height. |
protected Widget |
getWidget(int itemIndex)
Gets the Widget to render the specified item. |
protected abstract Widget |
getWidgetImpl(int itemIndex)
Gets the Widget, that is used to render the specified item. |
boolean |
hoverNeedsRedraw()
Checks, whether hovering the items needs the List to be redrawn. |
boolean |
isSelected(int index)
Queries, whether the specified index is selected. |
void |
markListDirty()
Notifies the List be be redrawn. |
protected void |
prepareWidget(float listContentWidth,
Widget widget,
java.lang.Object item,
int itemIndex)
This method is called right before the Widget is used to render a specific item. |
protected abstract void |
prepareWidgetImpl(float listContentWidth,
Widget widget,
java.lang.Object item,
int itemIndex)
This method is called right before the Widget is used to render a specific item. |
java.lang.Object |
removeItem(int index)
Removes an Item at the given position. |
protected abstract java.lang.Object |
removeItemImpl(int index)
Removes an Item at the given position. |
void |
setItem(int index,
java.lang.Object item)
Sets the item at the given position. |
protected abstract void |
setItemImpl(int index,
java.lang.Object item)
Sets the item at the given position. |
void |
setSelectedIndex(int index)
Sets the selected index. |
void |
setUsesFixedHeight(boolean usesFixedHeight)
Sets, whether all items have the same height. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ListModel()
| Method Detail |
|---|
protected final AbstractList getList()
protected abstract Widget[] getUsedWidgets()
protected abstract void addItemImpl(int index,
java.lang.Object item)
index - item -
public final void addItem(int index,
java.lang.Object item)
index - item - public final int addItem(java.lang.Object item)
item -
public void addItems(java.util.List<?> items)
items - public void addItems(java.lang.Object[] items)
items -
protected abstract void setItemImpl(int index,
java.lang.Object item)
index - item -
public final void setItem(int index,
java.lang.Object item)
index - item - protected abstract java.lang.Object removeItemImpl(int index)
index -
public final java.lang.Object removeItem(int index)
index -
public abstract void clear()
public abstract int getItemsCount()
protected abstract java.lang.Object getItemImpl(int index)
index -
public java.lang.Object getItem(int index)
index -
protected abstract Widget getWidgetImpl(int itemIndex)
#prepareWidget(Widget, Object) method.
itemIndex -
protected abstract void prepareWidgetImpl(float listContentWidth,
Widget widget,
java.lang.Object item,
int itemIndex)
listContentWidth - widget - item - itemIndex -
protected void prepareWidget(float listContentWidth,
Widget widget,
java.lang.Object item,
int itemIndex)
listContentWidth - widget - item - itemIndex - protected final Widget getWidget(int itemIndex)
itemIndex -
public boolean hoverNeedsRedraw()
protected boolean checkOnMouseButtonPressedImpl(int itemIndex,
float itemTop,
float itemBottom,
float mouseX,
float mouseY)
itemIndex - itemTop - itemBottom - mouseX - mouseY -
public final boolean checkOnMouseButtonPressed(int itemIndex,
float itemLeft,
float listContentWidth,
float itemTop,
float itemBottom,
float mouseX,
float mouseY)
itemIndex - itemLeft - itemTop - itemBottom - mouseX - mouseY -
public void setUsesFixedHeight(boolean usesFixedHeight)
usesFixedHeight - public final boolean getUsesFixedHeight()
protected abstract float getItemHeightImpl(int itemIndex)
itemIndex -
public final float getItemHeight(int itemIndex)
itemIndex -
protected abstract float getMinItemWidthImpl(int itemIndex)
itemIndex -
public final float getMinItemWidth(int itemIndex)
itemIndex -
public void setSelectedIndex(int index)
index - public int getSelectedIndex()
isSelected(int) is used instead, which is more flexible.
public java.lang.Object getSelectedItem()
public boolean isSelected(int index)
index -
public void markListDirty()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||