jewl
Class BooleanControl

java.lang.Object
  extended byjewl.Window
      extended byjewl.Control
          extended byjewl.TextControl
              extended byjewl.BooleanControl
Direct Known Subclasses:
CheckBox, MenuItem, RadioButton

public abstract class BooleanControl
extends TextControl

The abstract base class for text controls which incorporate a Boolean state. All such controls allow the text associated with the control to be accessed using the getText() and setText() methods, and the Boolean state can be accessed using getState() and setState().


Field Summary
 
Fields inherited from class jewl.TextControl
CENTER, CENTRE, LEFT, RIGHT
 
Method Summary
 boolean getState()
          Get the Boolean state for this control.
 void setState(boolean state)
          Set the Boolean state for this control to true (checked) or false (unchecked).
 void toggle()
          Toggle the Boolean state for this control into the opposite of its Current state.
 
Methods inherited from class jewl.TextControl
getAlignment, getText, setAlignment, setKey, setText
 
Methods inherited from class jewl.Control
disable, enable, enable, getToolTip, isEnabled, setToolTip
 
Methods inherited from class jewl.Window
addEventListener, commandAvailable, getCommand, getFont, getHeight, getID, getLeft, getScreenHeight, getScreenWidth, getSource, getTop, getWidth, hide, init, isVisible, nextCommand, parent, root, setFont, setID, setLocation, setSize, show, show
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setState

public void setState(boolean state)
Set the Boolean state for this control to true (checked) or false (unchecked).

Parameters:
state - the desired state.

getState

public boolean getState()
Get the Boolean state for this control. This will be true if the control is checked, or false if it is unchecked.

Returns:
The current state of this control.

toggle

public void toggle()
Toggle the Boolean state for this control into the opposite of its Current state. Calling x.toggle() is the same as calling x.setState(!x.getState()).