public class TristateButtonModel
extends javax.swing.JToggleButton.ToggleButtonModel
JToggleButton.ToggleButtonModel
supporting three states (deselected,
indeterminate, selected).Constructor and Description |
---|
TristateButtonModel()
Creates a new instance.
|
TristateButtonModel(@NotNull TristateState initialState)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
@NotNull TristateState |
getTristateState()
Returns the internal state.
|
void |
setArmed(boolean b) |
void |
setEnabled(boolean b) |
void |
setPressed(boolean b) |
void |
setSelected(boolean b) |
void |
setTristateState(@NotNull TristateState state)
Sets the state.
|
addActionListener, addChangeListener, addItemListener, fireActionPerformed, fireItemStateChanged, fireStateChanged, getActionCommand, getActionListeners, getChangeListeners, getGroup, getItemListeners, getListeners, getMnemonic, getSelectedObjects, isArmed, isEnabled, isPressed, isRollover, removeActionListener, removeChangeListener, removeItemListener, setActionCommand, setGroup, setMnemonic, setRollover
public TristateButtonModel(@NotNull @NotNull TristateState initialState)
initialState
- the initial statepublic TristateButtonModel()
TristateState.DESELECTED
.public void setEnabled(boolean b)
setEnabled
in interface javax.swing.ButtonModel
setEnabled
in class javax.swing.DefaultButtonModel
public void setSelected(boolean b)
setSelected
in interface javax.swing.ButtonModel
setSelected
in class javax.swing.JToggleButton.ToggleButtonModel
public void setArmed(boolean b)
setArmed
in interface javax.swing.ButtonModel
setArmed
in class javax.swing.DefaultButtonModel
public void setPressed(boolean b)
setPressed
in interface javax.swing.ButtonModel
setPressed
in class javax.swing.JToggleButton.ToggleButtonModel
@NotNull public @NotNull TristateState getTristateState()
public final void setTristateState(@NotNull @NotNull TristateState state)
state
- the new state