|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.AbstractButton
javax.swing.JToggleButton
javax.swing.JCheckBox
com.jidesoft.swing.TristateCheckBox
public class TristateCheckBox
TristateCheckBox is a check box with three states - selected, unselected and mixed (a.k.a partial selected state).
Internally it uses a new class called TristateButtonModel
to store the 3rd mixed state information.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JCheckBox |
---|
JCheckBox.AccessibleJCheckBox |
Nested classes/interfaces inherited from class javax.swing.JToggleButton |
---|
JToggleButton.AccessibleJToggleButton, JToggleButton.ToggleButtonModel |
Nested classes/interfaces inherited from class javax.swing.AbstractButton |
---|
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListener |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
static int |
STATE_MIXED
|
static int |
STATE_SELECTED
|
static int |
STATE_UNSELECTED
|
Fields inherited from class javax.swing.JCheckBox |
---|
BORDER_PAINTED_FLAT_CHANGED_PROPERTY |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.SwingConstants |
---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
TristateCheckBox()
|
|
TristateCheckBox(String text)
|
|
TristateCheckBox(String text,
Icon icon)
|
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent e)
|
protected void |
adjustMixedIcon()
|
protected ButtonModel |
createButtonModel()
Creates the button model. |
int |
getState()
Gets the selection state. |
protected void |
init(String text,
Icon icon)
|
boolean |
isMixed()
Checks if the check box is in mixed selection state. |
protected void |
restoreMixedIcon()
|
void |
setMixed(boolean b)
Sets the check box to mixed selection state. |
void |
setSelected(boolean b)
|
void |
setState(int state)
Sets the selection state. |
protected void |
stateUpdated(int state)
This method is called when the selection state changes. |
void |
updateUI()
|
Methods inherited from class javax.swing.JCheckBox |
---|
getAccessibleContext, getUIClassID, isBorderPaintedFlat, paramString, setBorderPaintedFlat |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int STATE_UNSELECTED
public static final int STATE_SELECTED
public static final int STATE_MIXED
Constructor Detail |
---|
public TristateCheckBox(String text, Icon icon)
public TristateCheckBox(String text)
public TristateCheckBox()
Method Detail |
---|
protected void init(String text, Icon icon)
init
in class AbstractButton
protected ButtonModel createButtonModel()
public void updateUI()
updateUI
in class JCheckBox
protected void adjustMixedIcon()
protected void restoreMixedIcon()
public boolean isMixed()
public void setMixed(boolean b)
b
- true or false. True means mixed state. False means unselected state.public int getState()
STATE_SELECTED
, STATE_UNSELECTED
and STATE_MIXED
.
public void setSelected(boolean b)
setSelected
in class AbstractButton
public void setState(int state)
STATE_SELECTED
, STATE_UNSELECTED
and STATE_MIXED
.
state
- one of the three selection states.public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
protected void stateUpdated(int state)
state
- the new selection state.
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |