Class QuadristateButtonModel

java.lang.Object
javax.swing.DefaultButtonModel
eu.essilab.lablib.checkboxtree.QuadristateButtonModel
All Implemented Interfaces:
ItemSelectable, Serializable, ButtonModel

public class QuadristateButtonModel extends DefaultButtonModel
The model for a quadristate CheckBox. Available states are UNCHECKED, CHECKED, GREY_CHECKED, GREY_UNCHECKED
Author:
boldrini
See Also:
  • Constructor Details

    • QuadristateButtonModel

      public QuadristateButtonModel()
  • Method Details

    • getState

      public QuadristateButtonModel.State 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 interface ButtonModel
      Overrides:
      setArmed in class DefaultButtonModel
    • setState

      public void setState(QuadristateButtonModel.State state)