SilverStream
Application Server 3.5

com.sssw.rt.jform
Class AgcJCheckBox

java.lang.Object
 |
 +--java.awt.Component
       |
       +--java.awt.Container
             |
             +--javax.swing.JComponent
                   |
                   +--javax.swing.AbstractButton
                         |
                         +--javax.swing.JToggleButton
                               |
                               +--javax.swing.JCheckBox
                                     |
                                     +--com.sssw.rt.jform.AgcJCheckBox
All Implemented Interfaces:
Accessible, AgiHelpInfo, ImageObserver, ItemSelectable, MenuContainer, Serializable, SwingConstants

public class AgcJCheckBox
extends JCheckBox
implements AgiHelpInfo

A lightweight component that displays a check box with a text label. The AgcJCheckBox control can be bound to a database column.

A check box control has a boolean value indicating whether it is selected. It also has an Object value that is stored in the database when the control is bound to a database column. You can specify source values for the Object value by setting the control's checked and unchecked values. When the control changes its selected state, the appropriate value (checked or unchecked) becomes the current value.

To get or change the boolean state of the control, call AbstractButton.isSelected() or AbstractButton.setSelected(boolean). You can also call AgcJCheckBox.setValue(Object) so that the argument value matches the control's checked or unchecked value.

To get or change the Object values, call:

Unlike radio button controls, check box controls work independently of one another. Each check box can be bound to a different database column and represent different conditions.

Properties:
Caption Expression, Caption Text, Checked Value, Control Type, Data Column, Enabled, Font Name, Font Size, Font Style, Height, Help Page, Left, Name, Tool Tip, Top, Unchecked Value, Visible, Width
Events:
actionPerformed, focusGained, focusLost, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, validationFailed, validationTest, valueChanged
See Also:
Serialized Form

Inner classes inherited from class javax.swing.JCheckBox
JCheckBox.AccessibleJCheckBox
 
Inner classes inherited from class javax.swing.JToggleButton
JToggleButton.AccessibleJToggleButton, JToggleButton.ToggleButtonModel
 
Inner classes inherited from class javax.swing.AbstractButton
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListener
 
Inner classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Fields inherited from class javax.swing.AbstractButton
actionListener, BORDER_PAINTED_CHANGED_PROPERTY, changeEvent, changeListener, CONTENT_AREA_FILLED_CHANGED_PROPERTY, DISABLED_ICON_CHANGED_PROPERTY, DISABLED_SELECTED_ICON_CHANGED_PROPERTY, FOCUS_PAINTED_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, ICON_CHANGED_PROPERTY, itemListener, MARGIN_CHANGED_PROPERTY, MNEMONIC_CHANGED_PROPERTY, model, MODEL_CHANGED_PROPERTY, PRESSED_ICON_CHANGED_PROPERTY, ROLLOVER_ENABLED_CHANGED_PROPERTY, ROLLOVER_ICON_CHANGED_PROPERTY, ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, SELECTED_ICON_CHANGED_PROPERTY, TEXT_CHANGED_PROPERTY, VERTICAL_ALIGNMENT_CHANGED_PROPERTY, VERTICAL_TEXT_POSITION_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
 
Constructor Summary
AgcJCheckBox()
          Creates an initially unselected checkbox button with no text or icon.
AgcJCheckBox(Icon icon)
          Creates an initially unselected checkbox with an icon.
AgcJCheckBox(Icon icon, boolean selected)
          Creates a checkbox with an icon and specifies whether or not it is initially selected.
AgcJCheckBox(String text)
          Creates an initially unselected checkbox with text.
AgcJCheckBox(String text, boolean selected)
          Creates a checkbox with text and specifies whether or not it is initially selected.
AgcJCheckBox(String text, Icon icon)
          Creates an initially unselected checkbox with the specified text and icon.
AgcJCheckBox(String text, Icon icon, boolean selected)
          Creates a checkbox with a text label and an icon, and specifies whether or not it is initially selected.
 
Method Summary
 Object getCheckedValue()
          Gets the button's "checked value" - the value assigned to the check box when it is selected.
 boolean getState()
          Deprecated. use isSelected().
 Object getUncheckedValue()
          Gets the button's "unchecked value" - the value assigned to the check box when it is not selected.
 Object getValue()
          Gets the user-specified Object mapped to the current button state.
 void setCheckedValue(Object value)
          Sets the button's "checked value" - the value assigned to the check box when it is selected.
 void setState(boolean state)
          Deprecated. use setSelected().
 void setUncheckedValue(Object value)
          Sets the button's "unchecked value" - the value assigned to the check box when it is not selected.
 void setValue(Object value)
          Sets the button's state, based on the value.
 
Methods inherited from class javax.swing.JCheckBox
getAccessibleContext, getUIClassID, paramString, updateUI
 
Methods inherited from class javax.swing.AbstractButton
addActionListener, addChangeListener, addItemListener, checkHorizontalKey, checkVerticalKey, createActionListener, createChangeListener, createItemListener, doClick, doClick, fireActionPerformed, fireItemStateChanged, fireStateChanged, getActionCommand, getDisabledIcon, getDisabledSelectedIcon, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getLabel, getMargin, getMnemonic, getModel, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getSelectedObjects, getText, getUI, getVerticalAlignment, getVerticalTextPosition, init, isBorderPainted, isContentAreaFilled, isFocusPainted, isRolloverEnabled, isSelected, paintBorder, removeActionListener, removeChangeListener, removeItemListener, setActionCommand, setBorderPainted, setContentAreaFilled, setDisabledIcon, setDisabledSelectedIcon, setEnabled, setFocusPainted, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setLabel, setMargin, setMnemonic, setMnemonic, setModel, setPressedIcon, setRolloverEnabled, setRolloverIcon, setRolloverSelectedIcon, setSelected, setSelectedIcon, setText, setUI, setVerticalAlignment, setVerticalTextPosition
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setCursor, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods implemented from interface com.sssw.rt.form.AgiHelpInfo
getHelpInfo, setHelpInfo
 

Constructor Detail

AgcJCheckBox

public AgcJCheckBox()
Creates an initially unselected checkbox button with no text or icon.

AgcJCheckBox

public AgcJCheckBox(Icon icon)
Creates an initially unselected checkbox with an icon.
Parameters:
icon - the image associated with the checkbox

AgcJCheckBox

public AgcJCheckBox(Icon icon,
                    boolean selected)
Creates a checkbox with an icon and specifies whether or not it is initially selected.
Parameters:
icon - the image associated with the checkbox
selected - the initial selection state. If true the checkbox is initially selected.

AgcJCheckBox

public AgcJCheckBox(String text)
Creates an initially unselected checkbox with text.
Parameters:
text - the text labeling the checkbox

AgcJCheckBox

public AgcJCheckBox(String text,
                    boolean selected)
Creates a checkbox with text and specifies whether or not it is initially selected.
Parameters:
text - the text labeling the checkbox
selected - the initial selection state. If true the checkbox is initially selected.

AgcJCheckBox

public AgcJCheckBox(String text,
                    Icon icon)
Creates an initially unselected checkbox with the specified text and icon.
Parameters:
text - the text labeling the checkbox
icon - the image associated with the checkbox

AgcJCheckBox

public AgcJCheckBox(String text,
                    Icon icon,
                    boolean selected)
Creates a checkbox with a text label and an icon, and specifies whether or not it is initially selected.
Parameters:
text - the text labeling the checkbox
icon - the image associated with the checkbox
selected - the initial selection state. If true the checkbox is initially selected.
Method Detail

setCheckedValue

public void setCheckedValue(Object value)
Sets the button's "checked value" - the value assigned to the check box when it is selected.
Parameters:
value - an Object that becomes the control's value when the check box is selected
Usage:
This method works only if the check box uses the default data model. AgcJCheckBox uses the default data model when no other model has been set using the setModel() method.
See Also:
AgcJCheckBox.getCheckedValue(), AgcJCheckBox.getValue(), AgcJCheckBox.setValue(Object)

getCheckedValue

public Object getCheckedValue()
Gets the button's "checked value" - the value assigned to the check box when it is selected.
Returns:
an Object that is the control's value when the check box is selected.
Usage:
This method works only if the check box uses the default data model. AgcJCheckBox uses the default data model when no other model has been set using the setModel() method.
See Also:
AgcJCheckBox.setCheckedValue(Object), AgcJCheckBox.getValue(), AgcJCheckBox.setValue(Object)

setUncheckedValue

public void setUncheckedValue(Object value)
Sets the button's "unchecked value" - the value assigned to the check box when it is not selected.
Parameters:
value - an Object that becomes the control's value when the check box is not selected
Usage:
This method works only if the check box uses the default data model. AgcJCheckBox uses the default data model when no other model has been set using the setModel() method.
See Also:
AgcJCheckBox.getUncheckedValue(), AgcJCheckBox.setCheckedValue(Object), AgcJCheckBox.getValue(), AgcJCheckBox.setValue(Object)

getUncheckedValue

public Object getUncheckedValue()
Gets the button's "unchecked value" - the value assigned to the check box when it is not selected.
Returns:
an Object that is the control's value when the check box is not selected.
Usage:
This method works only if the check box uses the default data model. AgcJCheckBox uses the default data model when no other model has been set using the setModel() method.
See Also:
AgcJCheckBox.setUncheckedValue(Object), AgcJCheckBox.getCheckedValue(), AgcJCheckBox.getValue(), AgcJCheckBox.setValue(Object)

setValue

public void setValue(Object value)
Sets the button's state, based on the value. If the value matches the button's checked value, then the check box becomes selected. Otherwise it becomes deselected.
Parameters:
value - an Object that will be the check box value
Usage:
Calling setValue() doesn't change the checked and unchecked values. The value you specify with setValue() will be reset to the checked or unchecked value if the user changes the button's state.

This method works only if the check box uses the default data model. AgcJCheckBox uses the default data model when no other model has been set using the setModel() method.

See Also:
AgcJCheckBox.getValue()

getValue

public Object getValue()
Gets the user-specified Object mapped to the current button state. If the check box is selected, the checked value is returned, or if it unselected, the unchecked value is returned. If the value has been explicitly set with setValue(), that value is returned.
Returns:
an Object that is the current value of the check box.
Usage:
This value is stored in the database when the control is bound to a database column.

This method works only if the check box uses the default data model. AgcJCheckBox uses the default data model when no other model has been set using the setModel() method.

See Also:
AgcJCheckBox.setValue(Object)

setState

public void setState(boolean state)
Deprecated. use setSelected().

Sets the state of the button.

getState

public boolean getState()
Deprecated. use isSelected().

Gets the state of the button.

SilverStream
Application Server 3.5