|
||||||||||
| 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
org.xith3d.ui.hud.widgets.List
public class List
A Scrollable List Widget that renders the contents of a ListModel.
| Nested Class Summary | |
|---|---|
static class |
List.Description
This class is used to describe a List Widget. |
| 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 org.openmali.vecmath2.Vector2f |
childrenOffset_HUD
|
protected org.openmali.vecmath2.Vector2i |
childrenOffset_PX
|
| Fields inherited from class org.xith3d.ui.hud.base.AbstractList |
|---|
DEFAULT_HEAVYWEIGHT |
| Fields inherited from class org.xith3d.ui.hud.base.Widget |
|---|
transformHeight_Pixels2HUD, transformWidth_Pixels2HUD |
| Constructor Summary | |
|---|---|
List(boolean isHeavyWeight,
float width,
float height,
ListModel model)
Creates a new List Widget. |
|
List(boolean isHeavyWeight,
float width,
float height,
ListModel model,
List.Description listDesc)
Creates a new List Widget. |
|
List(float width,
float height,
ListModel model)
Creates a new List Widget. |
|
List(float width,
float height,
ListModel model,
List.Description listDesc)
Creates a new List Widget. |
|
| Method Summary | |
|---|---|
java.lang.Object |
addItem(int index,
java.lang.Object item)
Adds the given Item to the List (at the given position). |
java.lang.Object |
addItem(int index,
java.lang.Object item,
org.openmali.vecmath2.Colorf color)
|
java.lang.Object |
addItem(int index,
java.lang.Object item,
HUDFont font,
org.openmali.vecmath2.Colorf color)
|
java.lang.Object |
addItem(java.lang.Object item,
org.openmali.vecmath2.Colorf color)
|
java.lang.Object |
addItem(java.lang.Object item,
HUDFont font,
org.openmali.vecmath2.Colorf color)
|
boolean |
addItemSetsSelectedItem()
If set to true, the addItem() method sets the selected item to the added one. |
void |
addSelectionListener(ListSelectionListener l)
Adds a new ListSelectionListener. |
protected void |
afterFirstItemAdded()
|
protected void |
afterItemAddedToEnd()
|
protected void |
afterModelSetWidthItems(ListModel model)
|
protected boolean |
blocksFocusMoveDeviceComponent(org.jagatoo.input.devices.components.DeviceComponent dc)
Checks, if this Widget blocks the given DeviceComponent for focus-moves. |
protected boolean |
drawHoveredItemBackground(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height)
Draws the background of a hovered item. |
protected boolean |
drawSelectedItemBackground(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height)
Draws the background of a selected item. |
protected void |
drawWidget(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height,
boolean drawsSelf)
|
TextAlignment |
getAlignment()
This alignment is used to render the items, if possible. |
int |
getBottomIndex()
The bottom-most item's index visible in the List (or -1, if the List is empty) |
HUDFont |
getFont()
Gets the Items' font. |
org.openmali.vecmath2.Colorf |
getFontColor()
Gets the text-color of non-selected Items. |
int |
getHeightByItems()
Gets the height by items count. |
org.openmali.vecmath2.Colorf |
getHoverBackgroundColor()
|
float |
getMinWidthThatFitsItems()
Gets the minimum list width, that is able to fully display all items. |
int |
getPaddingBottom()
|
int |
getPaddingLeft()
|
int |
getPaddingRight()
|
int |
getPaddingTop()
|
ScrollMode |
getScrollMode()
Returns the ScrollBar's ScrollMode. |
org.openmali.vecmath2.Colorf |
getSelectionBackgroundColor()
|
org.openmali.vecmath2.Colorf |
getSelectionFontColor()
Gets the text-color of the selected Item. |
int |
getTopIndex()
The top-most item's index visible in the List (or -1, if the List is empty) |
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 |
isScrolledToBottom()
|
static List |
newTextList(boolean isHeavyWeight,
float width,
float height)
Creates a new List Widget with a TextListModel. |
static List |
newTextList(boolean isHeavyWeight,
float width,
float height,
List.Description listDesc)
Creates a new List Widget with a TextListModel. |
static List |
newTextList(float width,
float height)
Creates a new List Widget with a TextListModel. |
static List |
newTextList(float width,
float height,
List.Description listDesc)
Creates a new List Widget with a TextListModel. |
protected void |
notifyOnItemClicked(java.lang.Object item,
int index)
|
protected void |
notifyOnSelectionChanged(java.lang.Object oldSelObj,
java.lang.Object newSelObj,
int oldSelIdx,
int newSelIdx)
|
protected void |
onAttachedToHUD(HUD hud)
This event is fired, when this Widget is added to the HUD live Widget hierarchy. |
protected void |
onKeyPressed(org.jagatoo.input.devices.components.Key key,
int modifierMask,
long when)
This event is fired, when a key is pressed on a focused Widget. |
protected void |
onMouseButtonPressed(org.jagatoo.input.devices.components.MouseButton button,
float x,
float y,
long when,
long lastWhen,
boolean isTopMost,
boolean hasFocus)
This event is fired, when a mouse button is pressed on a focused Widget. |
protected void |
onMouseExited(boolean isTopMost,
boolean hasFocus)
This method is called when the mouse exited the Widget area. |
protected void |
onMouseMoved(float x,
float y,
int buttonsState,
long when,
boolean isTopMost,
boolean hasFocus)
This event is fired, when the mouse is moved on a Widget. |
void |
removeSelectionListener(ListSelectionListener l)
Removes a ListSelectionListener. |
void |
scrollSelectedItemIntoView()
Scrolls the list, so that the selected item is in the content area. |
void |
scrollToBottom()
Scrolls the list to the bottom-most item. |
void |
setAddItemSetsSelectedItem(boolean b)
If set to true, the addItem() method sets the selected item to the added one. |
void |
setAlignment(TextAlignment alignment)
This alignment is used to render the items, if possible. |
protected void |
setContentClipRect(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height)
|
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 |
setFont(HUDFont font)
Sets the Items' font. |
void |
setFontColor(org.openmali.vecmath2.Colorf color)
Sets the text-color of non-selected Items. |
void |
setHeightByItems(int numItems)
Sets the height by items count. |
void |
setHoverBackgroundColor(org.openmali.vecmath2.Colorf color)
Sets the background-color of the hovered Item. |
boolean |
setPadding(int paddingBottom,
int paddingRight,
int paddingTop,
int paddingLeft)
Sets padding for this PaddingSettable Widget. |
void |
setScrollMode(ScrollMode mode)
Sets the ScrollBar's ScrollMode. |
void |
setSelectionBackgroundColor(org.openmali.vecmath2.Colorf color)
Sets the background-color of the selected Item. |
void |
setSelectionFontColor(org.openmali.vecmath2.Colorf color)
Sets the text-color of the selected Item. |
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.AbstractList |
|---|
addItem, addItems, addItems, clear, findItem, getItem, getItemsCount, getModel, getSelectedIndex, getSelectedItem, getWidget, removeItem, selectNextItem, selectPreviousItem, setModel, setPadding, setSelectedIndex |
| 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 |
| Field Detail |
|---|
protected final org.openmali.vecmath2.Vector2f childrenOffset_HUD
protected final org.openmali.vecmath2.Vector2i childrenOffset_PX
| Constructor Detail |
|---|
public List(boolean isHeavyWeight,
float width,
float height,
ListModel model,
List.Description listDesc)
isHeavyWeight - width - the new widthheight - the new heightmodel - the ListModel (null for auto-generation)listDesc - the List.Description to describe this new List Widget
public List(boolean isHeavyWeight,
float width,
float height,
ListModel model)
isHeavyWeight - width - the new widthheight - the new heightmodel - the ListModel (null for auto-generation)
public List(float width,
float height,
ListModel model,
List.Description listDesc)
width - the new widthheight - the new heightmodel - the ListModel (null for auto-generation)listDesc - the List.Description to describe this new List Widget
public List(float width,
float height,
ListModel model)
isHeavyWeight - width - the new widthheight - the new heightmodel - the ListModel (null for auto-generation)| Method Detail |
|---|
protected void afterModelSetWidthItems(ListModel model)
afterModelSetWidthItems in class AbstractList
public boolean setPadding(int paddingBottom,
int paddingRight,
int paddingTop,
int paddingLeft)
public final int getPaddingBottom()
public final int getPaddingRight()
public final int getPaddingTop()
public final int getPaddingLeft()
public void setFontColor(org.openmali.vecmath2.Colorf color)
color - public final org.openmali.vecmath2.Colorf getFontColor()
public void setFont(HUDFont font)
font - public final HUDFont getFont()
public void setSelectionFontColor(org.openmali.vecmath2.Colorf color)
color - public final org.openmali.vecmath2.Colorf getSelectionFontColor()
public java.lang.Object addItem(int index,
java.lang.Object item,
HUDFont font,
org.openmali.vecmath2.Colorf color)
public final java.lang.Object addItem(java.lang.Object item,
HUDFont font,
org.openmali.vecmath2.Colorf color)
public final java.lang.Object addItem(int index,
java.lang.Object item,
org.openmali.vecmath2.Colorf color)
public final java.lang.Object addItem(java.lang.Object item,
org.openmali.vecmath2.Colorf color)
public final java.lang.Object addItem(int index,
java.lang.Object item)
addItem in class AbstractListindex - the position to add the Item atitem - the new Item to add to the Listpublic void setHoverBackgroundColor(org.openmali.vecmath2.Colorf color)
setHoverBackgroundColor in class AbstractListpublic final org.openmali.vecmath2.Colorf getHoverBackgroundColor()
getHoverBackgroundColor in class AbstractListpublic void setSelectionBackgroundColor(org.openmali.vecmath2.Colorf color)
setSelectionBackgroundColor in class AbstractListpublic final org.openmali.vecmath2.Colorf getSelectionBackgroundColor()
getSelectionBackgroundColor in class AbstractListpublic void setAlignment(TextAlignment alignment)
setAlignment in class AbstractListpublic final TextAlignment getAlignment()
getAlignment in class AbstractListpublic void addSelectionListener(ListSelectionListener l)
addSelectionListener in class AbstractListl - the new listenerpublic void removeSelectionListener(ListSelectionListener l)
removeSelectionListener in class AbstractListl - the listener to be removed
protected void notifyOnSelectionChanged(java.lang.Object oldSelObj,
java.lang.Object newSelObj,
int oldSelIdx,
int newSelIdx)
protected void notifyOnItemClicked(java.lang.Object item,
int index)
public void setAddItemSetsSelectedItem(boolean b)
setAddItemSetsSelectedItem in class AbstractListpublic final boolean addItemSetsSelectedItem()
addItemSetsSelectedItem in class AbstractListpublic void scrollSelectedItemIntoView()
scrollSelectedItemIntoView in class AbstractListprotected void afterItemAddedToEnd()
afterItemAddedToEnd in class AbstractListprotected void afterFirstItemAdded()
afterFirstItemAdded in class AbstractListpublic void setTopIndex(int topIndex)
setTopIndex in class AbstractListpublic int getTopIndex()
getTopIndex in class AbstractListpublic final int getBottomIndex()
getBottomIndex in class AbstractListpublic void setHeightByItems(int numItems)
numItems - the new height by items unitpublic int getHeightByItems()
public void setScrollMode(ScrollMode mode)
mode - the ScrollBar's ScrollModepublic ScrollMode getScrollMode()
public boolean isScrolledToBottom()
public void scrollToBottom()
public void setFixedToBottom(boolean fixed)
fixed - public boolean isFixedToBottom()
public float getMinWidthThatFitsItems()
protected boolean blocksFocusMoveDeviceComponent(org.jagatoo.input.devices.components.DeviceComponent dc)
blocksFocusMoveDeviceComponent in class Widget
protected void onKeyPressed(org.jagatoo.input.devices.components.Key key,
int modifierMask,
long when)
onKeyPressed in class Widgetkey - the key that was pressedmodifierMask - the mask of modifier keyswhen - the keyevent's timestamp
protected void onMouseExited(boolean isTopMost,
boolean hasFocus)
onMouseExited in class WidgetisTopMost - is this Widget topMosthasFocus - is this Widget focused
protected void onMouseMoved(float x,
float y,
int buttonsState,
long when,
boolean isTopMost,
boolean hasFocus)
onMouseMoved in class Widgetx - the new X coordinatey - the new Y coordinateisTopMost - is this Widget topMosthasFocus - is this Widget focused
protected void onMouseButtonPressed(org.jagatoo.input.devices.components.MouseButton button,
float x,
float y,
long when,
long lastWhen,
boolean isTopMost,
boolean hasFocus)
onMouseButtonPressed in class Widgetbutton - 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.MouseCodeprotected void updateSizesAndMarkDirty()
updateSizesAndMarkDirty in class AbstractListprotected void onAttachedToHUD(HUD hud)
onAttachedToHUD in class AbstractListhud - the HUD, the Widget is added to
protected void setContentClipRect(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height)
setContentClipRect in class Widget
protected boolean drawHoveredItemBackground(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height)
texCanvas - offsetX - offsetY - width - height -
protected boolean drawSelectedItemBackground(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height)
texCanvas - offsetX - offsetY - width - height -
protected void drawWidget(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height,
boolean drawsSelf)
drawWidget in class Widgetprotected void init()
init in class Widget
public static final List newTextList(boolean isHeavyWeight,
float width,
float height,
List.Description listDesc)
TextListModel.
isHeavyWeight - width - the new widthheight - the new heightlistDesc - the List.Description to describe this new List Widget
public static final List newTextList(float width,
float height,
List.Description listDesc)
TextListModel.
width - the new widthheight - the new heightlistDesc - the List.Description to describe this new List Widget
public static final List newTextList(boolean isHeavyWeight,
float width,
float height)
TextListModel.
isHeavyWeight - width - the new widthheight - the new height
public static final List newTextList(float width,
float height)
TextListModel.
width - the new widthheight - the new height
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||