|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xith3d.ui.hud.base.WidgetBase
org.xith3d.ui.hud.base.RectangularWidget
org.xith3d.ui.hud.widgets.List<Item>
Item - the generic type of the list items.public class List<Item extends Widget>
A Scrollable List Widget able to hold some of Widgets.
BackgroundSettable,
TextWidget| Nested Class Summary | |
|---|---|
static class |
List.Description
This class is used to describe a List Widget. |
| Nested classes/interfaces inherited from interface org.xith3d.ui.hud.base.Widget |
|---|
Widget.DescriptionBase |
| Field Summary |
|---|
| Fields inherited from class org.xith3d.ui.hud.base.WidgetBase |
|---|
containerListeners, transformGroup, translation, Z_INDEX_UNIT, Z_INDEX_UNIT_ASSEMBLER |
| Constructor Summary | |
|---|---|
List(float width,
float height)
Creates a new List Widget. |
|
List(float width,
float height,
int zIndex)
Creates a new List Widget. |
|
List(float width,
float height,
int zIndex,
List.Description listDesc)
Creates a new List Widget. |
|
List(float width,
float height,
List.Description listDesc)
Creates a new List Widget. |
|
List(org.openmali.types.twodee.Sized2fRO size)
Creates a new List Widget. |
|
List(org.openmali.types.twodee.Sized2fRO size,
int zIndex)
Creates a new List Widget. |
|
List(org.openmali.types.twodee.Sized2fRO size,
int zIndex,
List.Description listDesc)
Creates a new List Widget. |
|
List(org.openmali.types.twodee.Sized2fRO size,
List.Description listDesc)
Creates a new List Widget. |
|
| Method Summary | |
|---|---|
Item |
addItem(int index,
Item item)
Adds the given Item to the List (at the given position). |
Item |
addItem(Item item)
Adds the given Item to the List (at the end). |
boolean |
addItemSetsSelectedItem()
If set to true, the addItem() method sets the selected item to the added one. |
void |
addSelectionListener(ListSelectionListener<Item> l)
Adds a new ListSelectionListener. |
void |
clear()
Removes all items from the List. |
protected void |
cullItems()
|
Texture |
getBackground()
|
org.openmali.vecmath2.Colorf |
getBackgroundColor()
|
float |
getBackgroundTileHeight()
|
org.openmali.types.twodee.Sized2fRO |
getBackgroundTileSize()
|
float |
getBackgroundTileWidth()
|
Border |
getBorder()
|
int |
getBottomIndex()
|
Item |
getBottomItem()
|
TextAlignment |
getFixAlignment()
|
int |
getHeightByItems()
|
Item |
getItem(int index)
|
Item |
getItem(java.lang.String itemName)
|
java.util.List<Item> |
getItems()
|
int |
getItemsCount()
|
int |
getMaxHeight()
Returns the maximum height of this List in Items count units. |
float |
getPaddingBottom()
|
float |
getPaddingLeft()
|
float |
getPaddingRight()
|
float |
getPaddingTop()
|
int |
getSelectedIndex()
|
Item |
getSelectedItem()
|
org.openmali.vecmath2.Colorf |
getSelectionBackgroundColor()
|
org.openmali.vecmath2.Colorf |
getSelectionForegroundColor()
|
int |
getTopIndex()
|
Item |
getTopItem()
|
float |
getTransparency()
|
protected void |
init()
This method is called when the WidgetContainer is set. |
boolean |
isFixedToBottom()
If true, the List always scrolls to the lowest item, when a new Item is added and the List is currently scrolled to bottom. |
boolean |
isScrollBarForced()
Returns the ScrollBar's forced visibility. |
boolean |
isScrollBarVisible()
Returns the ScrollBar's visibility. |
boolean |
isScrolledToBottom()
|
void |
onKeyPressed(org.jagatoo.input.devices.components.Key key,
long when)
This event is fired, when a key is pressed on a focused Widget. |
void |
onMouseButtonPressed(org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
long when,
long lastWhen,
boolean isTopMost,
boolean hasFocus)
This event is fired, when a mouse button is pressed on a focused Widget. |
void |
onMouseWheelMoved(int delta,
boolean isPageMove,
int x,
int y,
long when,
boolean isTopMost)
This event is fired, when the mouse wheel is moved on a Widget. |
void |
removeItem(int index)
Removes the given Item from the List |
protected void |
removeItem(int index,
boolean updateSelItem)
|
void |
removeItem(Item item)
Removes the given Item from the List |
protected void |
removeItem(Item item,
boolean updateSelItem)
|
void |
removeSelectionListener(ListSelectionListener<Item> l)
Removes a ListSelectionListener. |
void |
scrollToBottom()
Scrolls the list to the bottom-most item. |
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. |
void |
setAddItemSetsSelectedItem(boolean b)
If set to true, the addItem() method sets the selected item to the added one. |
void |
setBackground(org.openmali.vecmath2.Colorf color)
Sets the background color of the Widget. |
void |
setBackground(java.lang.String texture)
Sets the background Texture of the Widget. |
void |
setBackground(Texture texture)
Sets the background texture of the Widget. |
void |
setBackgroundTileSize(float tileWidth,
float tileHeight)
Sets the background tile size. |
void |
setBackgroundTileSize(org.openmali.types.twodee.Sized2fRO tileSize)
Sets the background tile size. |
void |
setBorder(Border.Description borderDesc)
Creates a new Border from the given Border.Desctiption and invokes setBorder(Border). |
void |
setBorder(Border border)
Sets the Border to use for this BorderSettable Widget. |
void |
setFixAlignment(TextAlignment alignment)
If a Label is added to the List, its TextAlignment is fixed to this value. |
void |
setFixedToBottom(boolean fixed)
Fixes or releases this List to always scroll to the lowest item, when a new Item is added and the List is currently scrolled to bottom. |
void |
setHeightByItems(int height)
Sets the height by items count. |
void |
setMaxHeight(int maxHeight)
Sets the maximum height of this List in Items count units. |
boolean |
setPadding(float padding)
Sets padding for this PaddingSettable Widget. |
boolean |
setPadding(float paddingBottom,
float paddingRight,
float paddingTop,
float paddingLeft)
Sets padding for this PaddingSettable Widget. |
void |
setScrollBarForced(boolean forced)
Sets the ScrollBar's forced visibility. |
void |
setScrollBarVisible(boolean visible)
Sets the ScrollBar's visibility. |
void |
setSelectedItem(Item item)
Sets the currently selected Item. |
void |
setSelectedItem(java.lang.String itemName)
Sets the currently selected Item. |
void |
setSelectionBackgroundColor(org.openmali.vecmath2.Colorf color)
Sets the background-color of the selected Item. |
void |
setSelectionForegroundColor(org.openmali.vecmath2.Colorf color)
Sets the foreground-color of the selected Item. |
boolean |
setSize(float width,
float height,
boolean forced)
|
void |
setTopIndex(int index)
Scrolls the List to a position with the given index at the top. |
void |
setTopItem(Item item)
Scrolls the List to a position with the given item at the top. |
void |
setTopItem(java.lang.String itemName)
Scrolls the List to a position with the given item at the top. |
protected void |
setVerticalScrollbarValue(int value)
|
void |
update()
Updates the Widget's internals. |
| Methods inherited from class org.xith3d.ui.hud.base.RectangularWidget |
|---|
getPickHeight, getPickSGZPosition, getPickWidth, pick |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.openmali.types.twodee.Sized2f |
|---|
setHeight, setWidth |
| Constructor Detail |
|---|
public List(float width,
float height,
int zIndex,
List.Description listDesc)
width - the new (outer) widthheight - the new (outer) heightzIndex - the new z-indexlistDesc - the List.Description to describe this new List Widget
public List(float width,
float height,
List.Description listDesc)
width - the new (outer) widthheight - the new (outer) heightlistDesc - the List.Description to describe this new List Widget
public List(org.openmali.types.twodee.Sized2fRO size,
int zIndex,
List.Description listDesc)
size - the new (outer) sizezIndex - the new z-indexlistDesc - the List.Description to describe this new List Widget
public List(org.openmali.types.twodee.Sized2fRO size,
List.Description listDesc)
size - the new (outer) sizelistDesc - the List.Description to describe this new List Widget
public List(float width,
float height,
int zIndex)
width - the new (outer) widthheight - the new (outer) heightzIndex - the new z-index
public List(float width,
float height)
width - the new (outer) widthheight - the new (outer) height
public List(org.openmali.types.twodee.Sized2fRO size,
int zIndex)
size - the new (outer) sizezIndex - the new z-indexpublic List(org.openmali.types.twodee.Sized2fRO size)
size - the new (outer) size| Method Detail |
|---|
public float getTransparency()
getTransparency in interface Widgetpublic void addSelectionListener(ListSelectionListener<Item> l)
addSelectionListener in interface AbstractList<Item extends Widget>l - the new listenerpublic void removeSelectionListener(ListSelectionListener<Item> l)
removeSelectionListener in interface AbstractList<Item extends Widget>l - the listener to be removedpublic void setBorder(Border border)
setBorder in interface BorderSettableborder - the new Border (null for no border)public void setBorder(Border.Description borderDesc)
setBorder in interface BorderSettableborderDesc - the Border.Description to create the new Border from (null for no border)BorderSettable.setBorder(Border)public Border getBorder()
getBorder in interface BorderSettable
public boolean setPadding(float paddingBottom,
float paddingRight,
float paddingTop,
float paddingLeft)
setPadding in interface PaddingSettablepublic final boolean setPadding(float padding)
setPadding in interface PaddingSettablepadding - padding for bottom, right, top and left
public float getPaddingBottom()
getPaddingBottom in interface PaddingSettablepublic float getPaddingRight()
getPaddingRight in interface PaddingSettablepublic float getPaddingTop()
getPaddingTop in interface PaddingSettablepublic float getPaddingLeft()
getPaddingLeft in interface PaddingSettablepublic void setBackground(org.openmali.vecmath2.Colorf color)
setBackground in interface BackgroundSettablecolor - the color to usepublic void setBackground(java.lang.String texture)
setBackground in interface BackgroundSettabletexture - the texture resource to usepublic void setBackground(Texture texture)
setBackground in interface BackgroundSettabletexture - the texture resource to usepublic Texture getBackground()
getBackground in interface BackgroundSettablepublic org.openmali.vecmath2.Colorf getBackgroundColor()
getBackgroundColor in interface BackgroundSettable
public void setBackgroundTileSize(float tileWidth,
float tileHeight)
setBackgroundTileSize in interface BackgroundSettabletileWidth - the tile width (or negative for no tiling of width)tileHeight - the tile height (or negative for no tiling of height)public void setBackgroundTileSize(org.openmali.types.twodee.Sized2fRO tileSize)
setBackgroundTileSize in interface BackgroundSettabletileSize - the tile size (or null for no tiling)public org.openmali.types.twodee.Sized2fRO getBackgroundTileSize()
getBackgroundTileSize in interface BackgroundSettablepublic float getBackgroundTileWidth()
getBackgroundTileWidth in interface BackgroundSettablepublic float getBackgroundTileHeight()
getBackgroundTileHeight in interface BackgroundSettablepublic void setFixAlignment(TextAlignment alignment)
alignment - the new TextAlignment for an added Label (or null for no fix)public TextAlignment getFixAlignment()
protected void cullItems()
protected void setVerticalScrollbarValue(int value)
public boolean setSize(float width,
float height,
boolean forced)
setSize in class WidgetBasepublic void setHeightByItems(int height)
setHeightByItems in interface AbstractList<Item extends Widget>height - the new height by items unitpublic int getHeightByItems()
getHeightByItems in interface AbstractList<Item extends Widget>public void setMaxHeight(int maxHeight)
setMaxHeight in interface AbstractList<Item extends Widget>maxHeight - the maximum height of this List or (-1) for no limitpublic int getMaxHeight()
getMaxHeight in interface AbstractList<Item extends Widget>public void setScrollBarVisible(boolean visible)
setScrollBarVisible in interface AbstractList<Item extends Widget>visible - the ScrollBar's possible visibilitypublic boolean isScrollBarVisible()
isScrollBarVisible in interface AbstractList<Item extends Widget>public void setScrollBarForced(boolean forced)
setScrollBarForced in interface AbstractList<Item extends Widget>forced - the ScrollBar's forced visibilitypublic boolean isScrollBarForced()
isScrollBarForced in interface AbstractList<Item extends Widget>public void setFixedToBottom(boolean fixed)
fixed - public boolean isFixedToBottom()
public void setSelectionBackgroundColor(org.openmali.vecmath2.Colorf color)
color - public org.openmali.vecmath2.Colorf getSelectionBackgroundColor()
public void setSelectionForegroundColor(org.openmali.vecmath2.Colorf color)
color - public org.openmali.vecmath2.Colorf getSelectionForegroundColor()
public void setTopIndex(int index)
index - the new topmost item's indexpublic void setTopItem(Item item)
item - the new topmost itempublic void setTopItem(java.lang.String itemName)
itemName - the new topmost item's namepublic int getTopIndex()
public Item getTopItem()
public int getBottomIndex()
public Item getBottomItem()
public boolean isScrolledToBottom()
public void scrollToBottom()
public void setSelectedItem(Item item)
setSelectedItem in interface AbstractList<Item extends Widget>public void setSelectedItem(java.lang.String itemName)
setSelectedItem in interface AbstractList<Item extends Widget>public Item getSelectedItem()
getSelectedItem in interface AbstractList<Item extends Widget>public int getSelectedIndex()
getSelectedIndex in interface AbstractList<Item extends Widget>public int selectPreviousItem()
selectPreviousItem in interface AbstractList<Item extends Widget>public int selectNextItem()
selectNextItem in interface AbstractList<Item extends Widget>public void setAddItemSetsSelectedItem(boolean b)
setAddItemSetsSelectedItem in interface AbstractList<Item extends Widget>public boolean addItemSetsSelectedItem()
addItemSetsSelectedItem in interface AbstractList<Item extends Widget>
public void onKeyPressed(org.jagatoo.input.devices.components.Key key,
long when)
onKeyPressed in interface WidgetonKeyPressed in class WidgetBasekey - the key that was pressedwhen - the keyevent's timestamp
public void onMouseWheelMoved(int delta,
boolean isPageMove,
int x,
int y,
long when,
boolean isTopMost)
onMouseWheelMoved in interface WidgetonMouseWheelMoved in class WidgetBasedelta - a positive value when the wheel was moved upx - the current mouse x positiony - the current mouse y positionisTopMost - is this Widget topMost
public void onMouseButtonPressed(org.jagatoo.input.devices.components.MouseButton button,
int x,
int y,
long when,
long lastWhen,
boolean isTopMost,
boolean hasFocus)
onMouseButtonPressed in interface WidgetonMouseButtonPressed in class WidgetBasebutton - the button that was pressedx - the current mouse x positiony - the current mouse y positionisTopMost - is this Widget topMosthasFocus - is this Widget focusednet.jtank.input.MouseCode
public Item addItem(int index,
Item item)
addItem in interface AbstractList<Item extends Widget>index - the position to add the Item atitem - the new Item to add to the Listpublic Item addItem(Item item)
addItem in interface AbstractList<Item extends Widget>item - the new Item to add to the List
protected void removeItem(int index,
boolean updateSelItem)
public final void removeItem(int index)
removeItem in interface AbstractList<Item extends Widget>index - the position of the Item to be removed
protected final void removeItem(Item item,
boolean updateSelItem)
public final void removeItem(Item item)
removeItem in interface AbstractList<Item extends Widget>item - the Item to be removed from the Listpublic void clear()
clear in interface AbstractList<Item extends Widget>public final int getItemsCount()
getItemsCount in interface AbstractList<Item extends Widget>public final java.util.List<Item> getItems()
getItems in interface AbstractList<Item extends Widget>public final Item getItem(int index)
getItem in interface AbstractList<Item extends Widget>index - the index to get the Item from
public final Item getItem(java.lang.String itemName)
getItem in interface AbstractList<Item extends Widget>itemName - the name to get the Item from
public void update()
update in interface Widgetupdate in class WidgetBaseprotected void init()
init in class WidgetBase
| ||||