|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.lwuit.Component com.sun.lwuit.Label com.sun.lwuit.Button com.sun.lwuit.CheckBox
public class CheckBox
Checkbox is a button that can be selected or deselected, and which displays its state to the user.
Field Summary |
---|
Fields inherited from class com.sun.lwuit.Button |
---|
STATE_DEFAULT, STATE_PRESSED, STATE_ROLLOVER |
Fields inherited from class com.sun.lwuit.Component |
---|
BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, LEFT, RIGHT, TOP |
Constructor Summary | |
---|---|
CheckBox()
Constructs a checkbox with no text |
|
CheckBox(Image icon)
Constructs a checkbox with the given icon |
|
CheckBox(java.lang.String text)
Constructs a checkbox with the given text |
|
CheckBox(java.lang.String text,
Image icon)
Constructs a checkbox with the given text and icon |
Method Summary | |
---|---|
protected Dimension |
calcPreferredSize()
Calculates the preferred size based on component content. |
boolean |
isOppositeSide()
Places the check box on the opposite side at the far end |
boolean |
isSelected()
Return true if the checkbox is selected |
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. |
protected java.lang.String |
paramString()
Returns a string representing the state of this component. |
void |
refreshTheme()
Makes sure the component is up to date with the current style object |
void |
released(int x,
int y)
Invoked to change the state of the button to the released state |
void |
setOppositeSide(boolean oppositeSide)
Places the check box on the opposite side at the far end |
void |
setSelected(boolean selected)
Selects the current checkbox |
Methods inherited from class com.sun.lwuit.Label |
---|
getAlignment, getBaselineResizeBehavior, getGap, getIcon, getShiftText, getText, getTextPosition, getVerticalAlignment, isDefaultTickerEnabled, isEndsWith3Points, isTickerEnabled, isTickerRunning, setDefaultTickerEnabled, setEndsWith3Points, setGap, setIcon, setShiftText, setText, setTextPosition, setTickerEnabled, setVerticalAlignment, shouldTickerStart, startTicker, startTicker, stopTicker |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CheckBox(java.lang.String text)
text
- to display next to the checkboxpublic CheckBox()
public CheckBox(Image icon)
icon
- icon to display next to the checkboxpublic CheckBox(java.lang.String text, Image icon)
text
- to display next to the checkboxicon
- icon to display next to the textMethod Detail |
---|
public boolean isSelected()
isSelected
in class Button
public void setSelected(boolean selected)
selected
- value for selectionpublic void released(int x, int y)
Button
released
in class Button
x
- the x position if a touch event triggered this, -1 if this isn't relevanty
- the y position if a touch event triggered this, -1 if this isn't relevantpublic void paint(Graphics g)
Component
paint
in interface Animation
paint
in class Button
g
- the component graphicsprotected Dimension calcPreferredSize()
Component
calcPreferredSize
in class Button
protected java.lang.String paramString()
Component
null
.
paramString
in class Label
public void refreshTheme()
Component
refreshTheme
in class Component
public boolean isOppositeSide()
isOppositeSide
in class Button
public void setOppositeSide(boolean oppositeSide)
oppositeSide
- the oppositeSide to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |