|
||||||||||
| 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.ComboBox
public class ComboBox
A ComboBox is a bordered Label with a Button on the right, that pops up a List widget and displays the current selected Item's text.
| Nested Class Summary | |
|---|---|
static class |
ComboBox.Description
|
| 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 |
|---|
| Fields inherited from class org.xith3d.ui.hud.base.Widget |
|---|
transformHeight_Pixels2HUD, transformWidth_Pixels2HUD |
| Constructor Summary | |
|---|---|
ComboBox(boolean isHeavyWeight,
float width,
float height,
ListModel listModel)
Creates a new ComboBox. |
|
ComboBox(boolean isHeavyWeight,
float width,
float height,
ListModel listModel,
ComboBox.Description desc)
Creates a new ComboBox. |
|
ComboBox(float width,
float height,
ListModel listModel)
Creates a new ComboBox. |
|
ComboBox(float width,
float height,
ListModel listModel,
ComboBox.Description desc)
Creates a new ComboBox. |
|
| Method Summary | |
|---|---|
java.lang.Object |
addItem(int index,
java.lang.Object item)
Adds the given Item to the List (at the given position). |
void |
addItem(int index,
java.lang.String text)
|
void |
addItem(int index,
java.lang.String text,
org.openmali.vecmath2.Colorf color)
|
void |
addItem(int index,
java.lang.String text,
HUDFont font,
org.openmali.vecmath2.Colorf color)
|
void |
addItem(java.lang.String text)
|
void |
addItem(java.lang.String text,
org.openmali.vecmath2.Colorf color)
|
void |
addItem(java.lang.String text,
HUDFont font,
org.openmali.vecmath2.Colorf color)
|
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. |
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 boolean |
blocksFocusMoveDeviceComponent(org.jagatoo.input.devices.components.DeviceComponent dc)
Checks, if this Widget blocks the given DeviceComponent for focus-moves. |
void |
clear()
Removes all items from the List. |
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()
|
org.openmali.vecmath2.Colorf |
getFontColor()
|
org.openmali.vecmath2.Colorf |
getHoverBackgroundColor()
|
int |
getListHeightByItems()
Gets the list's height by items count. |
int |
getMaxListHeightByItems()
Gets the maximum list's height by items. |
protected float |
getMinHeight()
|
protected float |
getMinWidth()
|
ListModel |
getModel()
Gets the underlying model. |
int |
getPaddingBottom()
|
int |
getPaddingLeft()
|
int |
getPaddingRight()
|
int |
getPaddingTop()
|
protected float |
getPickHeight()
|
org.openmali.vecmath2.Colorf |
getSelectionBackgroundColor()
|
java.lang.String |
getText()
|
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 |
isEnabled()
|
boolean |
isPoppedUp()
|
static ComboBox |
newTextCombo(boolean isHeavyWeight,
float width,
float height)
Creates a new ComboBox with a TextListModel. |
static ComboBox |
newTextCombo(boolean isHeavyWeight,
float width,
float height,
ComboBox.Description desc)
Creates a new ComboBox with a TextListModel. |
static ComboBox |
newTextCombo(float width,
float height)
Creates a new ComboBox with a TextListModel. |
static ComboBox |
newTextCombo(float width,
float height,
ComboBox.Description desc)
Creates a new ComboBox with a TextListModel. |
void |
onAttachedToHUD(HUD hud)
This event is fired, when this Widget is added to the HUD live Widget hierarchy. |
void |
onFocusLost()
This event is fired, when the focus is lost by a Widget. |
void |
onMouseExited(boolean isTopMost,
boolean hasFocus)
This method is called when the mouse exited the Widget area. |
protected void |
onSizeChanged(float oldWidth,
float oldHeight,
float newWidth,
float newHeight)
|
void |
popUp(boolean p)
Pops up the popupable Widget (or un-pops it) |
java.lang.String |
removeItem(int index)
Removes the given Item from the List. |
void |
removeSelectionListener(ListSelectionListener l)
Removes a ListSelectionListener. |
void |
scrollSelectedItemIntoView()
Scrolls the list, so that the selected item is in the content area. |
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. |
void |
setEnabled(boolean enabled)
|
void |
setFont(HUDFont font)
Sets the new Font to be used |
void |
setFontColor(org.openmali.vecmath2.Colorf color)
Sets the new color to be used |
void |
setHoverBackgroundColor(org.openmali.vecmath2.Colorf color)
Sets the background-color of the hovered Item. |
void |
setListHeightByItems(int numItems)
Sets the list's height by items count. |
void |
setMaxListHeightByItems(int maxHeight)
Sets the maximum list's height by items. |
void |
setModel(ListModel model)
Sets the underlying model. |
boolean |
setPadding(int paddingBottom,
int paddingRight,
int paddingTop,
int paddingLeft)
Sets padding for this PaddingSettable Widget. |
void |
setSelectedIndex(int itemIndex)
Sets the currently selected Item. |
void |
setSelectionBackgroundColor(org.openmali.vecmath2.Colorf color)
Sets the background-color of the selected Item. |
void |
setText(java.lang.String text)
Sets the new text to be displayed |
void |
setTopIndex(int topIndex)
Scrolls the list, so that the given index is the top item's index (if possible). |
| Methods inherited from class org.xith3d.ui.hud.base.AbstractList |
|---|
addItem, afterFirstItemAdded, afterItemAddedToEnd, afterModelSetWidthItems, findItem, getItem, getItemsCount, getSelectedIndex, getSelectedItem, getWidget, selectNextItem, selectPreviousItem, setPadding, 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 |
| Constructor Detail |
|---|
public ComboBox(boolean isHeavyWeight,
float width,
float height,
ListModel listModel,
ComboBox.Description desc)
isHeavyWeight - width - the new widthheight - the new heightmodel - the ListModel (null for auto-generation)desc -
public ComboBox(boolean isHeavyWeight,
float width,
float height,
ListModel listModel)
isHeavyWeight - width - the new widthheight - the new heightmodel - the ListModel (null for auto-generation)
public ComboBox(float width,
float height,
ListModel listModel,
ComboBox.Description desc)
width - the new widthmodel - the ListModel (null for auto-generation)height - the new heightdesc -
public ComboBox(float width,
float height,
ListModel listModel)
width - the new widthheight - the new heightmodel - the ListModel (null for auto-generation)| Method Detail |
|---|
protected float getMinWidth()
getMinWidth in class Widgetprotected float getMinHeight()
getMinHeight in class Widgetpublic void setModel(ListModel model)
setModel in class AbstractListpublic ListModel getModel()
getModel in class AbstractList
public boolean setPadding(int paddingBottom,
int paddingRight,
int paddingTop,
int paddingLeft)
setPadding in interface PaddingSettablepublic final int getPaddingBottom()
getPaddingBottom in interface PaddingSettablepublic final int getPaddingRight()
getPaddingRight in interface PaddingSettablepublic final int getPaddingTop()
getPaddingTop in interface PaddingSettablepublic final int getPaddingLeft()
getPaddingLeft in interface PaddingSettablepublic 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 interface TextWidgetsetAlignment in class AbstractListpublic final TextAlignment getAlignment()
getAlignment in interface TextWidgetgetAlignment 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 removedpublic void setSelectedIndex(int itemIndex)
setSelectedIndex in class AbstractListpublic void setAddItemSetsSelectedItem(boolean b)
setAddItemSetsSelectedItem in class AbstractListpublic final boolean addItemSetsSelectedItem()
addItemSetsSelectedItem in class AbstractList
public 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 List
public void addItem(int index,
java.lang.String text,
HUDFont font,
org.openmali.vecmath2.Colorf color)
public final void addItem(java.lang.String text,
HUDFont font,
org.openmali.vecmath2.Colorf color)
public final void addItem(int index,
java.lang.String text,
org.openmali.vecmath2.Colorf color)
public final void addItem(java.lang.String text,
org.openmali.vecmath2.Colorf color)
public final void addItem(int index,
java.lang.String text)
public final void addItem(java.lang.String text)
public java.lang.String removeItem(int index)
removeItem in class AbstractListindex - the position of the Item to be removed
public void addItems(java.util.List<?> items)
addItems in class AbstractListpublic void addItems(java.lang.Object[] items)
addItems in class AbstractListpublic void clear()
clear 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 scrollSelectedItemIntoView()
scrollSelectedItemIntoView in class AbstractListpublic void setListHeightByItems(int numItems)
numItems - the new height by items unitpublic int getListHeightByItems()
public void setMaxListHeightByItems(int maxHeight)
maxHeight - public int getMaxListHeightByItems()
protected boolean blocksFocusMoveDeviceComponent(org.jagatoo.input.devices.components.DeviceComponent dc)
blocksFocusMoveDeviceComponent in class Widgetpublic void setText(java.lang.String text)
setText in interface TextWidgettext - the new Textpublic java.lang.String getText()
getText in interface TextWidgetpublic HUDFont getFont()
getFont in interface TextWidgetpublic void setFont(HUDFont font)
setFont in interface TextWidgetfont - the new Fontpublic void setFontColor(org.openmali.vecmath2.Colorf color)
setFontColor in interface TextWidgetcolor - the new colorpublic org.openmali.vecmath2.Colorf getFontColor()
getFontColor in interface TextWidgetpublic final void setEnabled(boolean enabled)
setEnabled in interface org.jagatoo.datatypes.Enableablepublic final boolean isEnabled()
isEnabled in interface org.jagatoo.datatypes.Enableable
protected void onSizeChanged(float oldWidth,
float oldHeight,
float newWidth,
float newHeight)
onSizeChanged in class Widgetprotected float getPickHeight()
getPickHeight in class Widgetpublic void popUp(boolean p)
popUp in interface PopUpablep - if true, the pop-up will be visiblepublic boolean isPoppedUp()
isPoppedUp in interface PopUpablepublic void onFocusLost()
onFocusLost in class Widget
public void onMouseExited(boolean isTopMost,
boolean hasFocus)
onMouseExited in class WidgetisTopMost - is this Widget topMosthasFocus - is this Widget focusedpublic void onAttachedToHUD(HUD hud)
onAttachedToHUD in class AbstractListhud - the HUD, the Widget is added to
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 ComboBox newTextCombo(boolean isHeavyWeight,
float width,
float height,
ComboBox.Description desc)
TextListModel.
isHeavyWeight - width - the new widthheight - the new heightdesc -
public static final ComboBox newTextCombo(boolean isHeavyWeight,
float width,
float height)
TextListModel.
isHeavyWeight - width - the new widthheight - the new height
public static final ComboBox newTextCombo(float width,
float height,
ComboBox.Description desc)
TextListModel.
width - the new widthmodel - the ListModel (null for auto-generation)height - the new heightdesc -
public static final ComboBox newTextCombo(float width,
float height)
TextListModel.
width - the new widthheight - the new heightmodel - the ListModel (null for auto-generation)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||