com.sas.swing.visuals
Class TriStateCheckBox

com.sas.swing.visuals.TriStateCheckBox
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.ItemSelectable, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.SwingConstants

public class TriStateCheckBox

An implementation of a tri-state check box -- an item that can be selected, deselected, or in a mixed state and which displays its state to the user. By convention, any number of check boxes in a group can be selected. See How to Use Buttonc, Check Boxes, and Radio Buttons in The Java Tutorial for examples and information on using check boxes.

See Also:
Serialized Form

Nested Class Summary
static class TriStateCheckBox.TriStateCheckBoxModel
          The TriStateCheckBox model
 
Field Summary
static int MIXED
          Value representing mixed, or in the indeterminate state
static int OFF
          Value representing not selected
static int ON
          Value representing selected
static java.lang.String RB_KEY
           
 
Constructor Summary
TriStateCheckBox()
          Creates an initially unselected check box button with no text, no icon.
TriStateCheckBox(javax.swing.Icon icon)
          Creates an initially unselected check box with an icon.
TriStateCheckBox(javax.swing.Icon icon, boolean selected)
          Creates a check box with an icon and specifies whether or not it is initially selected.
TriStateCheckBox(javax.swing.Icon icon, int value)
          Creates a check box with an icon and specifies its initial value.
TriStateCheckBox(java.lang.String text)
          Creates an initially unselected check box with text.
TriStateCheckBox(java.lang.String text, boolean selected)
          Creates a check box with text and specifies whether or not it is initially selected.
TriStateCheckBox(java.lang.String text, javax.swing.Icon icon)
          Creates an initially unselected check box with the specified text and icon.
TriStateCheckBox(java.lang.String text, javax.swing.Icon icon, boolean selected)
          Creates a check box with text and icon, and specifies whether or not it is initially selected.
TriStateCheckBox(java.lang.String text, javax.swing.Icon icon, int value)
          Creates a check box with text and icon, and specifies whether or not it is initially selected.
TriStateCheckBox(java.lang.String text, int value)
          Creates a check box with text and specifies its initial value.
 
Method Summary
static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
          Returns information used by the com.sas.beans.Introspector to augment the automatically introspected information about this TriStateCheckBox.
 int getSelectedValue()
          Returns the current value of the checkBox.
 boolean isCycleEnabled()
          Returns whether the checkbox cycles through all three values.
 void setCycleEnabled(boolean b)
          Sets whether the checkBox should cycle through all three values.
 void setSelectedValue(int value)
          Sets the current value of the checkBox.
 

Field Detail

RB_KEY

public static final java.lang.String RB_KEY
See Also:
Constant Field Values

OFF

public static final int OFF
Value representing not selected

See Also:
Constant Field Values

MIXED

public static final int MIXED
Value representing mixed, or in the indeterminate state

See Also:
Constant Field Values

ON

public static final int ON
Value representing selected

See Also:
Constant Field Values
Constructor Detail

TriStateCheckBox

public TriStateCheckBox()
Creates an initially unselected check box button with no text, no icon.


TriStateCheckBox

public TriStateCheckBox(javax.swing.Icon icon)
Creates an initially unselected check box with an icon.

Parameters:
icon - the Icon image to display

TriStateCheckBox

public TriStateCheckBox(javax.swing.Icon icon,
                        boolean selected)
Creates a check box with an icon and specifies whether or not it is initially selected.

Parameters:
icon - the Icon image to display
selected - a boolean value indicating the initial selection state. If true the check box is selected

TriStateCheckBox

public TriStateCheckBox(javax.swing.Icon icon,
                        int value)
Creates a check box with an icon and specifies its initial value.

Parameters:
icon - the Icon image to display
value - an integer indicating the initial selection state.

TriStateCheckBox

public TriStateCheckBox(java.lang.String text)
Creates an initially unselected check box with text.

Parameters:
text - the text of the check box.

TriStateCheckBox

public TriStateCheckBox(java.lang.String text,
                        boolean selected)
Creates a check box with text and specifies whether or not it is initially selected.

Parameters:
text - the text of the check box.
selected - a boolean value indicating the initial selection state. If true the check box is selected

TriStateCheckBox

public TriStateCheckBox(java.lang.String text,
                        int value)
Creates a check box with text and specifies its initial value.

Parameters:
text - the text of the check box.
value - an integer indicating the initial selection state.

TriStateCheckBox

public TriStateCheckBox(java.lang.String text,
                        javax.swing.Icon icon)
Creates an initially unselected check box with the specified text and icon.

Parameters:
text - the text of the check box.
icon - the Icon image to display

TriStateCheckBox

public TriStateCheckBox(java.lang.String text,
                        javax.swing.Icon icon,
                        boolean selected)
Creates a check box with text and icon, and specifies whether or not it is initially selected.

Parameters:
text - the text of the check box.
icon - the Icon image to display
selected - a boolean value indicating the initial selection state. If true the check box is selected

TriStateCheckBox

public TriStateCheckBox(java.lang.String text,
                        javax.swing.Icon icon,
                        int value)
Creates a check box with text and icon, and specifies whether or not it is initially selected.

Parameters:
text - the text of the check box.
icon - the Icon image to display
value - an integer indicating the initial selection state.
Method Detail

getExtendedBeanInfo

public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
Returns information used by the com.sas.beans.Introspector to augment the automatically introspected information about this TriStateCheckBox.

Returns:
the ExtendedBeanInfo for this class

setCycleEnabled

public void setCycleEnabled(boolean b)
Sets whether the checkBox should cycle through all three values.

Parameters:
b - if true, the checkBox cycles, or else the checkBox switches between ON and OFF once those values have been reached.

isCycleEnabled

public boolean isCycleEnabled()
Returns whether the checkbox cycles through all three values.


setSelectedValue

public void setSelectedValue(int value)
Sets the current value of the checkBox.

Parameters:
value - The new value of the checkBox

getSelectedValue

public int getSelectedValue()
Returns the current value of the checkBox.




Copyright © 2009 SAS Institute Inc. All Rights Reserved.