|
Java DTV API 1.3 18-Nov-2009 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.dtv.lwuit.Component
com.sun.dtv.lwuit.List
com.sun.dtv.lwuit.ComboBox
public class 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.dtv.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.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.ViewOnlyComponent |
---|
HORIZONTAL_ALIGN_CENTER, HORIZONTAL_ALIGN_JUSTIFIED, HORIZONTAL_ALIGN_LEFT, HORIZONTAL_ALIGN_RIGHT, SCALE_ASPECT_PROOF, SCALE_NO, SCALE_NO_ASPECT_PROOF, STATE_DISABLED, STATE_ENABLED, VERTICAL_ALIGN_BOTTOM, VERTICAL_ALIGN_CENTER, VERTICAL_ALIGN_JUSTIFIED, VERTICAL_ALIGN_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 | |
---|---|
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. |
void |
paint(Graphics g)
This method paints the Component on the screen, it should be overriden by subclasses to perform custom drawing or invoke the UI API's to let the PLAF perform the rendering. |
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 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
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
handlesInput
- indicates whether key events can be grabbed for
focus traversalpublic void pointerReleased(int x, int y)
Component
pointerReleased
in class List
x
- the pointer x coordinatey
- the pointer y coordinatepublic void paint(Graphics g)
Component
paint
in interface Animation
paint
in interface ViewOnlyComponent
paint
in class List
g
- the component graphics
|
Java DTV API 1.3 18-Nov-2009 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |