Package eu.essilab.lablib.checkboxtree
Class QuadristateButtonModel
java.lang.Object
javax.swing.DefaultButtonModel
eu.essilab.lablib.checkboxtree.QuadristateButtonModel
- All Implemented Interfaces:
ItemSelectable
,Serializable
,ButtonModel
The model for a quadristate CheckBox. Available states are UNCHECKED,
CHECKED, GREY_CHECKED, GREY_UNCHECKED
- Author:
- boldrini
- See Also:
-
Nested Class Summary
-
Field Summary
Fields inherited from class javax.swing.DefaultButtonModel
actionCommand, ARMED, changeEvent, ENABLED, group, listenerList, mnemonic, PRESSED, ROLLOVER, SELECTED, stateMask
-
Constructor Summary
-
Method Summary
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, isSelected, removeActionListener, removeChangeListener, removeItemListener, setActionCommand, setEnabled, setGroup, setMnemonic, setPressed, setRollover, setSelected
-
Constructor Details
-
QuadristateButtonModel
public QuadristateButtonModel()
-
-
Method Details
-
getState
The current state is embedded in the selection / armed state of the model. We return the CHECKED state when the checkbox is selected but not armed, GREY_CHECKED state when the checkbox is selected and armed (grey) and UNCHECKED when the checkbox is deselected. -
nextState
public void nextState()We rotate between UNCHECKED, CHECKED, GREY_UNCHECKED, GREY_CHECKED. -
setArmed
public void setArmed(boolean b) Filter: No one may change the armed status except us.- Specified by:
setArmed
in interfaceButtonModel
- Overrides:
setArmed
in classDefaultButtonModel
-
setState
-