org.xith3d.ui.hud.listmodels
Class DefaultAbstractListModel

java.lang.Object
  extended by org.xith3d.ui.hud.base.ListModel
      extended by org.xith3d.ui.hud.listmodels.DefaultAbstractListModel
Direct Known Subclasses:
TextListModel

public abstract class DefaultAbstractListModel
extends ListModel

The default implementation of ListModel.


Constructor Summary
DefaultAbstractListModel()
           
DefaultAbstractListModel(java.util.List<?> items)
           
 
Method Summary
 void addItemImpl(int index, java.lang.Object item)
          Adds a new Item at the given position.
 void clear()
          Clears the list.
 java.lang.Object getItemImpl(int index)
          Gets the item at index index.
 int getItemsCount()
          Gets the number of items in the list.
 java.lang.Object getItemUserObject(int itemIndex)
          Gets an item's user-object.
 java.lang.Object removeItemImpl(int index)
          Removes an Item at the given position.
 void setItemImpl(int index, java.lang.Object item)
          Sets the item at the given position.
 void setItemUserObject(int itemIndex, java.lang.Object userObject)
          Sets an item's user-object.
 
Methods inherited from class org.xith3d.ui.hud.base.ListModel
addItem, addItem, addItems, addItems, checkOnMouseButtonPressed, checkOnMouseButtonPressedImpl, getItem, getItemHeight, getItemHeightImpl, getList, getMinItemWidth, getMinItemWidthImpl, getSelectedIndex, getSelectedItem, getUsedWidgets, getUsesFixedHeight, getWidget, getWidgetImpl, hoverNeedsRedraw, isSelected, markListDirty, prepareWidget, prepareWidgetImpl, removeItem, setItem, setSelectedIndex, setUsesFixedHeight
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultAbstractListModel

public DefaultAbstractListModel(java.util.List<?> items)

DefaultAbstractListModel

public DefaultAbstractListModel()
Method Detail

addItemImpl

public void addItemImpl(int index,
                        java.lang.Object item)
Adds a new Item at the given position.

Specified by:
addItemImpl in class ListModel

setItemImpl

public void setItemImpl(int index,
                        java.lang.Object item)
Sets the item at the given position.

Specified by:
setItemImpl in class ListModel

removeItemImpl

public java.lang.Object removeItemImpl(int index)
Removes an Item at the given position.

Specified by:
removeItemImpl in class ListModel
Returns:
the removed Item or null, if there was no item at the given index.

clear

public void clear()
Clears the list.

Specified by:
clear in class ListModel

getItemsCount

public int getItemsCount()
Gets the number of items in the list.

Specified by:
getItemsCount in class ListModel
Returns:
the number of items in the list.

getItemImpl

public java.lang.Object getItemImpl(int index)
Gets the item at index index. This item must be handleable by the used Widget.

Specified by:
getItemImpl in class ListModel
Returns:
the index'th item.

setItemUserObject

public void setItemUserObject(int itemIndex,
                              java.lang.Object userObject)
Sets an item's user-object.

Parameters:
itemIndex -
userObject -

getItemUserObject

public final java.lang.Object getItemUserObject(int itemIndex)
Gets an item's user-object.

Parameters:
itemIndex -
Returns:
the items user-object.