|
Java DTV API 1.0 12-Dec-2008 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.lwuit.Component
com.sun.dtv.ui.MatteEnabledComponent
com.sun.dtv.ui.ViewOnlyComponent
com.sun.lwuit.List
com.sun.lwuit.ComboBox
A combo box is a list that allows only one selection at a time, when a user clicks the combo box a popup button with the full list of elements allows the selection of a single element. The combo box is driven by the list model and allows all the renderer features of the List as well.
List
Field Summary |
Fields inherited from class com.sun.lwuit.List |
FIXED_CENTER, FIXED_LEAD, FIXED_NONE, FIXED_NONE_CYCLIC, FIXED_NONE_ONE_ELEMENT_MARGIN_FROM_EDGE, FIXED_TRAIL, HORIZONTAL, VERTICAL |
Fields inherited from class com.sun.dtv.ui.ViewOnlyComponent |
HORIZONTAL_ALIGN_CENTER, HORIZONTAL_ALIGN_JUSTIFIED, HORIZONTAL_ALIGN_LEFT, HORIZONTAL_ALIGN_RIGHT, SCALE_ASPECT_PROOF, SCALE_NO, SCALE_NO_ASPECT_PROOF, VERTICAL_ALIGN_BOTTOM, VERTICAL_ALIGN_CENTER, VERTICAL_ALIGN_JUSTIFIED, VERTICAL_ALIGN_TOP |
Fields inherited from class com.sun.lwuit.Component |
BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, LEFT, RIGHT, TOP |
Fields inherited from interface com.sun.dtv.ui.Animated |
ALTERNATING, LOOP, REPEATING |
Constructor Summary | |
ComboBox()
Constructs an empty combo box. |
|
ComboBox(ListModel model)
Creates a new instance of ComboBox. |
|
ComboBox(Object[] items)
Creates a new instance of ComboBox. |
|
ComboBox(Vector items)
Creates a new instance of ComboBox. |
Method Summary | |
protected Dimension |
calcPreferredSize()
Calculates the preferred size based on component content. |
int |
getBaseline(int width,
int height)
The baseline for the component text according to which it should be aligned with other components for best visual look. |
protected String |
getUIID()
Unique identifier for a component, must be overriden for a component so a style can be applied to the component. |
protected void |
modelChanged(int status)
Reset popup data on model change to allow the popup to refresh with the right details. |
void |
paint(Graphics g)
Method to paint the component. |
void |
pointerReleased(int x,
int y)
If this Component is focused, the pointer released event will call this method. |
void |
setHandlesInput(boolean handlesInput)
Prevents key events from being grabbed for focus traversal. |
void |
setModel(ListModel m)
Replaces/sets the model underlying the list. |
void |
setSelectedIndex(int selection)
Sets the current selected offset in the list, by default this implementation will scroll the list to the selection if the selection is outside of the screen. |
void |
setSelectedIndex(int selection,
boolean scroll)
Sets the current selected offset in the list. |
Methods inherited from class com.sun.dtv.ui.MatteEnabledComponent |
getMatte, isDoubleBuffered, processEvent, setMatte |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ComboBox(Vector items)
items
- set of items placed into the combo box modelpublic ComboBox(Object[] items)
items
- set of items placed into the combo box modelpublic ComboBox()
public ComboBox(ListModel model)
model
- the model for the combo box elements and selectionMethod Detail |
public int getBaseline(int width, int height)
Component
getBaseline
in class Component
width
- the component widthheight
- the component height
protected String getUIID()
Component
getUIID
in class List
public void setSelectedIndex(int selection)
List
setSelectedIndex
in class List
selection
- the current selected offset in the listList.getSelectedIndex()
public void setSelectedIndex(int selection, boolean scroll)
List
setSelectedIndex
in class List
selection
- the current selected offset in the listscroll
- indicates whether scrolling to selection should
occur if the selection is outside of viewList.getSelectedIndex()
public void setModel(ListModel m)
List
setModel
in class List
m
- the new model underlying the listList.getModel()
public void setHandlesInput(boolean handlesInput)
Component
setHandlesInput
in class List
protected void modelChanged(int status)
status
- the model statuspublic void pointerReleased(int x, int y)
Component
pointerReleased
in class List
public void paint(Graphics g)
ViewOnlyComponent
paint
in interface Animated
paint
in class List
protected Dimension calcPreferredSize()
Component
calcPreferredSize
in class List
|
Java DTV API 1.0 12-Dec-2008 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |