|
||||||||||
| 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.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 interface org.xith3d.ui.hud.base.Widget |
|---|
Widget.DescriptionBase |
| Field Summary | |
|---|---|
static float |
MIN_HEIGHT
|
static float |
MIN_WIDTH
|
| Fields inherited from class org.xith3d.ui.hud.base.WidgetBase |
|---|
containerListeners, transformGroup, translation, Z_INDEX_UNIT, Z_INDEX_UNIT_ASSEMBLER |
| Constructor Summary | |
|---|---|
ComboBox(float width,
float height)
Creates a new ComboBox. |
|
ComboBox(float width,
float height,
ComboBox.Description desc)
Creates a new ComboBox. |
|
ComboBox(float width,
float height,
int zIndex)
Creates a new ComboBox. |
|
ComboBox(float width,
float height,
int zIndex,
ComboBox.Description desc)
Creates a new ComboBox. |
|
ComboBox(org.openmali.types.twodee.Sized2fRO size)
Creates a new ComboBox. |
|
ComboBox(org.openmali.types.twodee.Sized2fRO size,
ComboBox.Description desc)
Creates a new ComboBox. |
|
ComboBox(org.openmali.types.twodee.Sized2fRO size,
int zIndex)
Creates a new ComboBox. |
|
ComboBox(org.openmali.types.twodee.Sized2fRO size,
int zIndex,
ComboBox.Description desc)
Creates a new ComboBox. |
|
| Method Summary | |
|---|---|
Label |
addItem(int index,
Label item)
Adds the given Item to the List (at the given position). |
Label |
addItem(int index,
java.lang.String text)
Creates a Label and adds it to the List (at the given position). |
Label |
addItem(int index,
java.lang.String text,
org.openmali.vecmath2.Colorf color)
Creates a Label and adds it to the List (at the given position). |
Label |
addItem(int index,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color)
Creates a Label and adds it to the List (at the given position). |
Label |
addItem(Label item)
Adds the given Item to the List (at the end). |
Label |
addItem(java.lang.String text)
Creates a Label and adds it to the List (at the end). |
Label |
addItem(java.lang.String text,
org.openmali.vecmath2.Colorf color)
Creates a Label and adds it to the List (at the given position). |
Label |
addItem(java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color)
Creates a Label and adds it to the List (at the given position). |
boolean |
addItemSetsSelectedItem()
If set to true, the addItem() method sets the selected item to the added one. |
void |
addSelectionListener(ListSelectionListener<Label> l)
Adds a new ListSelectionListener. |
void |
clear()
Removes all items from the List. |
Label |
createItem(java.lang.String text)
Creates a Label and adds it to the List (at the end). |
Label |
createItem(java.lang.String text,
org.openmali.vecmath2.Colorf color)
Creates a Label and adds it to the List (at the given position). |
Label |
createItem(java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color)
Creates a Label from the parameters. |
TextAlignment |
getAlignment()
|
java.awt.Font |
getFont()
|
org.openmali.vecmath2.Colorf |
getFontColor()
|
int |
getHeightByItems()
|
Label |
getItem(int index)
|
Label |
getItem(java.lang.String itemName)
|
java.util.List<Label> |
getItems()
|
int |
getItemsCount()
|
int |
getMaxHeight()
Returns the maximum height of this List in Items count units. |
protected float |
getPickHeight()
|
protected float |
getPickSGZPosition()
|
int |
getSelectedIndex()
|
Label |
getSelectedItem()
|
java.lang.String |
getText()
|
float |
getTransparency()
|
protected void |
init()
This method is called when the WidgetContainer is set. |
boolean |
isEnabled()
|
boolean |
isPoppedUp()
|
boolean |
isScrollBarForced()
Returns the ScrollBar's forced visibility. |
boolean |
isScrollBarVisible()
Returns the ScrollBar's visibility. |
void |
onFocusLost()
This event is fired, when the focus is lost by a Widget. |
void |
onMouseLeft(boolean isTopMost,
boolean hasFocus)
This method is called when the mouse left the Widget area |
void |
popUp(boolean p)
Pops up the popupable Widget (or un-pops it) |
void |
removeItem(int index)
Removes the given Item from the List |
void |
removeItem(Label item)
Removes the given Item from the List |
void |
removeSelectionListener(ListSelectionListener<Label> l)
Removes a ListSelectionListener. |
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 |
setAlignment(TextAlignment alignment)
Sets the horizontal and vertical alignment of the text |
void |
setEnabled(boolean enabled)
|
protected void |
setEnabledImpl(boolean enabled)
|
void |
setFont(java.awt.Font font)
Sets the new Font to be used |
void |
setFontColor(org.openmali.vecmath2.Colorf color)
Sets the new color to be used |
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. |
void |
setScrollBarForced(boolean forced)
Sets the ScrollBar's forced visibility. |
void |
setScrollBarVisible(boolean visible)
Sets the ScrollBar's visibility. |
void |
setSelectedItem(Label item)
Sets the currently selected Item. |
void |
setSelectedItem(java.lang.String itemName)
Sets the currently selected Item. |
protected boolean |
setSize(float width,
float height,
boolean forced)
|
void |
setText(java.lang.String text)
Sets the new text to be displayed |
| Methods inherited from class org.xith3d.ui.hud.base.RectangularWidget |
|---|
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 |
| Field Detail |
|---|
public static final float MIN_WIDTH
public static final float MIN_HEIGHT
| Constructor Detail |
|---|
public ComboBox(float width,
float height,
int zIndex,
ComboBox.Description desc)
width - the new widthheight - the new heightzIndex - the new z-index
public ComboBox(float width,
float height,
ComboBox.Description desc)
width - the new widthheight - the new height
public ComboBox(org.openmali.types.twodee.Sized2fRO size,
int zIndex,
ComboBox.Description desc)
size - the new sizezIndex - the new z-index
public ComboBox(float width,
float height,
int zIndex)
width - the new widthheight - the new heightzIndex - the new z-index
public ComboBox(org.openmali.types.twodee.Sized2fRO size,
ComboBox.Description desc)
size - the new size
public ComboBox(org.openmali.types.twodee.Sized2fRO size,
int zIndex)
size - the new sizezIndex - the new z-index
public ComboBox(float width,
float height)
width - the new widthheight - the new heightpublic ComboBox(org.openmali.types.twodee.Sized2fRO size)
size - the new size| Method Detail |
|---|
protected boolean setSize(float width,
float height,
boolean forced)
setSize in class WidgetBasepublic float getTransparency()
getTransparency in interface Widgetprotected float getPickHeight()
getPickHeight in class RectangularWidgetprotected float getPickSGZPosition()
getPickSGZPosition in class RectangularWidgetpublic 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 interface WidgetonFocusLost in class WidgetBase
public void onMouseLeft(boolean isTopMost,
boolean hasFocus)
onMouseLeft in interface WidgetonMouseLeft in class WidgetBaseisTopMost - is this Widget topMosthasFocus - is this Widget focusedpublic void addSelectionListener(ListSelectionListener<Label> l)
addSelectionListener in interface AbstractList<Label>l - the new listenerpublic void removeSelectionListener(ListSelectionListener<Label> l)
removeSelectionListener in interface AbstractList<Label>l - the listener to be removed
public Label createItem(java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color)
Label from the parameters.
createItem in interface AbstractTextList<Label>text - the text content for the new Item
Label
public final Label createItem(java.lang.String text,
org.openmali.vecmath2.Colorf color)
Label and adds it to the List (at the given position).
createItem in interface AbstractTextList<Label>text - the text content for the new Item
Labelpublic final Label createItem(java.lang.String text)
Label and adds it to the List (at the end).
createItem in interface AbstractTextList<Label>text - the text content for the new Item
Label
public Label addItem(int index,
Label item)
addItem in interface AbstractList<Label>index - the position to add the Item atitem - the new Item to add to the Listpublic Label addItem(Label item)
addItem in interface AbstractList<Label>item - the new Item to add to the List
public Label addItem(int index,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color)
Label and adds it to the List (at the given position).
addItem in interface AbstractTextList<Label>index - the position to add the Item attext - the text content for the new Item
Label
public Label addItem(java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color)
Label and adds it to the List (at the given position).
addItem in interface AbstractTextList<Label>text - the text content for the new Item
Label
public Label addItem(int index,
java.lang.String text,
org.openmali.vecmath2.Colorf color)
Label and adds it to the List (at the given position).
addItem in interface AbstractTextList<Label>index - the position to add the Item attext - the text content for the new Item
Label
public Label addItem(java.lang.String text,
org.openmali.vecmath2.Colorf color)
Label and adds it to the List (at the given position).
addItem in interface AbstractTextList<Label>text - the text content for the new Item
Label
public Label addItem(int index,
java.lang.String text)
Label and adds it to the List (at the given position).
addItem in interface AbstractTextList<Label>index - the position to add the Item attext - the text content for the new Item
Labelpublic Label addItem(java.lang.String text)
Label and adds it to the List (at the end).
addItem in interface AbstractTextList<Label>text - the text content for the new Item
Labelpublic void removeItem(int index)
removeItem in interface AbstractList<Label>index - the position of the Item to be removedpublic void removeItem(Label item)
removeItem in interface AbstractList<Label>item - the Item to be removed from the Listpublic void clear()
clear in interface AbstractList<Label>public Label getItem(int index)
getItem in interface AbstractList<Label>index - the index to get the Item from
public Label getItem(java.lang.String itemName)
getItem in interface AbstractList<Label>itemName - the name to get the Item from
public java.util.List<Label> getItems()
getItems in interface AbstractList<Label>public int getItemsCount()
getItemsCount in interface AbstractList<Label>public void setSelectedItem(Label item)
setSelectedItem in interface AbstractList<Label>public void setSelectedItem(java.lang.String itemName)
setSelectedItem in interface AbstractList<Label>public final int getSelectedIndex()
getSelectedIndex in interface AbstractList<Label>public final Label getSelectedItem()
getSelectedItem in interface AbstractList<Label>public int selectPreviousItem()
selectPreviousItem in interface AbstractList<Label>public int selectNextItem()
selectNextItem in interface AbstractList<Label>public void setAddItemSetsSelectedItem(boolean b)
setAddItemSetsSelectedItem in interface AbstractList<Label>public boolean addItemSetsSelectedItem()
addItemSetsSelectedItem in interface AbstractList<Label>public void setHeightByItems(int height)
setHeightByItems in interface AbstractList<Label>height - the new height by items unitpublic int getHeightByItems()
getHeightByItems in interface AbstractList<Label>public void setMaxHeight(int maxHeight)
setMaxHeight in interface AbstractList<Label>maxHeight - the maximum height of this List or (-1) for no limitpublic int getMaxHeight()
getMaxHeight in interface AbstractList<Label>public void setScrollBarVisible(boolean visible)
setScrollBarVisible in interface AbstractList<Label>visible - the ScrollBar's possible visibilitypublic boolean isScrollBarVisible()
isScrollBarVisible in interface AbstractList<Label>public void setScrollBarForced(boolean forced)
setScrollBarForced in interface AbstractList<Label>forced - the ScrollBar's forced visibilitypublic boolean isScrollBarForced()
isScrollBarForced in interface AbstractList<Label>public void setText(java.lang.String text)
setText in interface TextWidgettext - the new Textpublic java.lang.String getText()
getText in interface TextWidgetpublic java.awt.Font getFont()
getFont in interface TextWidgetpublic void setFont(java.awt.Font 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 void setAlignment(TextAlignment alignment)
setAlignment in interface TextWidgetpublic TextAlignment getAlignment()
getAlignment in interface TextWidgetprotected void setEnabledImpl(boolean enabled)
public final void setEnabled(boolean enabled)
setEnabled in interface org.jagatoo.datatypes.Enableablepublic final boolean isEnabled()
isEnabled in interface org.jagatoo.datatypes.Enableableprotected void init()
init in class WidgetBase
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||