Gridarta Editor
net.sf.gridarta.gui.utils.tristate.TristateCheckBox Class Reference

A JCheckBox that supports three states: deselected, indeterminate, selected. More...

+ Inheritance diagram for net.sf.gridarta.gui.utils.tristate.TristateCheckBox:
+ Collaboration diagram for net.sf.gridarta.gui.utils.tristate.TristateCheckBox:

Public Member Functions

TristateButtonModel getTristateModel ()
 Returns the model as a TristateButtonModel. More...
 
final void setModel (@NotNull final ButtonModel newModel)
 
 TristateCheckBox (@NotNull final String text)
 Creates a new instance without icon which is initially {}. More...
 

Protected Member Functions

TristateState nextState (@NotNull final TristateState state)
 Returns the next state. More...
 

Private Member Functions

void iterateState (final int modifiers)
 Increments the state. More...
 
 TristateCheckBox (@NotNull final String text, @Nullable final Icon icon, @NotNull final ButtonModel buttonModel)
 Creates a new instance. More...
 
 TristateCheckBox (@NotNull final String text, @Nullable final Icon icon, @NotNull final TristateState initialState)
 Creates a new instance. More...
 

Private Attributes

final ChangeListener enableListener = e -> setFocusable(getModel().isEnabled())
 The ChangeListener on model changes to maintain correct focusability. More...
 

Static Private Attributes

static final long serialVersionUID = 1L
 The serial version UID. More...
 

Detailed Description

A JCheckBox that supports three states: deselected, indeterminate, selected.

Author
Andreas Kirschbaum

Definition at line 43 of file TristateCheckBox.java.

Constructor & Destructor Documentation

◆ TristateCheckBox() [1/3]

net.sf.gridarta.gui.utils.tristate.TristateCheckBox.TristateCheckBox ( @NotNull final String  text)

Creates a new instance without icon which is initially {}.

Parameters
textthe text of the check box

Definition at line 62 of file TristateCheckBox.java.

◆ TristateCheckBox() [2/3]

net.sf.gridarta.gui.utils.tristate.TristateCheckBox.TristateCheckBox ( @NotNull final String  text,
@Nullable final Icon  icon,
@NotNull final TristateState  initialState 
)
private

Creates a new instance.

Parameters
textthe text of the check box
iconthe icon to display
initialStatethe initial state

Definition at line 72 of file TristateCheckBox.java.

◆ TristateCheckBox() [3/3]

net.sf.gridarta.gui.utils.tristate.TristateCheckBox.TristateCheckBox ( @NotNull final String  text,
@Nullable final Icon  icon,
@NotNull final ButtonModel  buttonModel 
)
private

Creates a new instance.

Parameters
textthe text of the check box
iconthe icon to display
buttonModelthe button model to use

The serial version UID.

Definition at line 82 of file TristateCheckBox.java.

References net.sf.gridarta.gui.utils.tristate.TristateCheckBox.iterateState(), net.sf.gridarta.gui.utils.tristate.TristateCheckBox.serialVersionUID, and net.sf.gridarta.gui.utils.tristate.TristateCheckBox.setModel().

+ Here is the call graph for this function:

Member Function Documentation

◆ getTristateModel()

TristateButtonModel net.sf.gridarta.gui.utils.tristate.TristateCheckBox.getTristateModel ( )

Returns the model as a TristateButtonModel.

Returns
the model

Definition at line 171 of file TristateCheckBox.java.

Referenced by net.sf.gridarta.gui.utils.tristate.TristateCheckBox.iterateState().

+ Here is the caller graph for this function:

◆ iterateState()

void net.sf.gridarta.gui.utils.tristate.TristateCheckBox.iterateState ( final int  modifiers)
private

◆ nextState()

TristateState net.sf.gridarta.gui.utils.tristate.TristateCheckBox.nextState ( @NotNull final TristateState  state)
protected

Returns the next state.

Parameters
statethe current state
Returns
the next state

Reimplemented in net.sf.gridarta.gui.utils.ToggleTristateCheckBox.

Definition at line 162 of file TristateCheckBox.java.

References net.sf.gridarta.gui.utils.tristate.TristateState.nextTristateState.

Referenced by net.sf.gridarta.gui.utils.tristate.TristateCheckBox.iterateState().

+ Here is the caller graph for this function:

◆ setModel()

final void net.sf.gridarta.gui.utils.tristate.TristateCheckBox.setModel ( @NotNull final ButtonModel  newModel)

Member Data Documentation

◆ enableListener

final ChangeListener net.sf.gridarta.gui.utils.tristate.TristateCheckBox.enableListener = e -> setFocusable(getModel().isEnabled())
private

The ChangeListener on model changes to maintain correct focusability.

Definition at line 55 of file TristateCheckBox.java.

Referenced by net.sf.gridarta.gui.utils.tristate.TristateCheckBox.setModel().

◆ serialVersionUID

final long net.sf.gridarta.gui.utils.tristate.TristateCheckBox.serialVersionUID = 1L
staticprivate

The serial version UID.

Definition at line 48 of file TristateCheckBox.java.

Referenced by net.sf.gridarta.gui.utils.tristate.TristateCheckBox.TristateCheckBox().


The documentation for this class was generated from the following file: