|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjcontrol.ui.vole.Component
jcontrol.ui.vole.RockerSwitch
public class RockerSwitch
The RockerSwitch is a graphical component that can
be in either an "on" (true) or "off" (false) state.
When the user changes the state, an ActionEvent
of type STATE_CHANGED is fired.
(c) Copyright 2003-2005 DOMOLOGIC GmbH
| Field Summary |
|---|
| Fields inherited from class jcontrol.ui.vole.Component |
|---|
eventQueue, focusOwner, font, g, height, listener, parent, visible, width, x, y |
| Constructor Summary | |
|---|---|
RockerSwitch(int x,
int y)
Create a new labeled CheckBox which is initially "off". |
|
| Method Summary | |
|---|---|
boolean |
getState()
Get the current state of this RockerSwitch. |
boolean |
onKeyEvent(KeyEvent e)
Handle key events. |
void |
paint()
Paint the button. |
void |
setActionListener(ActionListener listener)
Add an ActionListener to the check box. |
void |
setState(boolean state)
Set the state of this RockerSwitch. |
void |
toggleState()
Toggle the state of this RockerSwitch. |
| Methods inherited from class jcontrol.ui.vole.Component |
|---|
getBounds, getParent, isVisible, onActionEvent, remove, removeFocus, requestFocus, setBounds, setFont, setGraphics, setParent, setVisible, transferFocus, validate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, notifyAll, wait |
| Constructor Detail |
|---|
public RockerSwitch(int x,
int y)
CheckBox which is initially "off".
When no width and height are specified, a preferred size depending on the
label dimensions is calculated.
label - A String that is written on the CheckBox.x - The x-coordinate of this CheckBox.y - The y-coordinate of this CheckBox.| Method Detail |
|---|
public boolean getState()
RockerSwitch.
public boolean onKeyEvent(KeyEvent e)
onKeyEvent in class Componente - The KeyEvent.
Container.public void paint()
paint in class Componentpublic void setActionListener(ActionListener listener)
ActionListener to the check box. It will receive
STATE_CHANGED action events when the state has changed.
listener - The new ActionListener or null.public void setState(boolean state)
RockerSwitch.
state - The new state of the switch.public void toggleState()
RockerSwitch.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||