Copyright © 2005 Scientific Applications. All Rights Reserved.

com.sciapp.component
Class TristateButtonModel

java.lang.Object
  extended by javax.swing.DefaultButtonModel
      extended by javax.swing.JToggleButton.ToggleButtonModel
          extended by com.sciapp.component.TristateButtonModel
All Implemented Interfaces:
ItemSelectable, Serializable, ButtonModel

public class TristateButtonModel
extends JToggleButton.ToggleButtonModel

The model of a TristateCheckBox.

See Also:
Serialized Form

Field Summary
static int CHECKED
          the checked state
static int PARTIALLY_CHECKED
          the partial-selected state
protected  int state
          the current state of the model
static int UNCHECKED
          the unchecked state
 
Fields inherited from class javax.swing.DefaultButtonModel
actionCommand, ARMED, changeEvent, ENABLED, group, listenerList, mnemonic, PRESSED, ROLLOVER, SELECTED, stateMask
 
Constructor Summary
TristateButtonModel()
          Creates a TristateButtonModel.
 
Method Summary
 int getState()
          Returns the state of the model.
 void setState(int state)
          Assigns the state of the model.
 
Methods inherited from class javax.swing.JToggleButton.ToggleButtonModel
isSelected, setPressed, setSelected
 
Methods inherited from class javax.swing.DefaultButtonModel
addActionListener, addChangeListener, addItemListener, fireActionPerformed, fireItemStateChanged, fireStateChanged, getActionCommand, getActionListeners, getChangeListeners, getGroup, getItemListeners, getListeners, getMnemonic, getSelectedObjects, isArmed, isEnabled, isPressed, isRollover, removeActionListener, removeChangeListener, removeItemListener, setActionCommand, setArmed, setEnabled, setGroup, setMnemonic, setRollover
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNCHECKED

public static final int UNCHECKED
the unchecked state

See Also:
Constant Field Values

CHECKED

public static final int CHECKED
the checked state

See Also:
Constant Field Values

PARTIALLY_CHECKED

public static final int PARTIALLY_CHECKED
the partial-selected state

See Also:
Constant Field Values

state

protected int state
the current state of the model

Constructor Detail

TristateButtonModel

public TristateButtonModel()
Creates a TristateButtonModel.

Method Detail

getState

public int getState()
Returns the state of the model. The state can either be UNCHECKED, CHECKED or PARTIALLY_CHECKED.

Returns:
the state of the model

setState

public void setState(int state)
Assigns the state of the model. The state can either be UNCHECKED, CHECKED or PARTIALLY_CHECKED.

Parameters:
state - the state to assign

Copyright © 2005 Scientific Applications. All Rights Reserved.