|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel net.wotonomy.ui.swing.components.ButtonPanel net.wotonomy.ui.swing.components.CheckButtonPanel
public class CheckButtonPanel
CheckButtonPanel is a simple extension of ButtonPanel. Differences are that it uses JCheckBoxes and the default alignment is vertical. The panel defaults to having no buttons selected.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.wotonomy.ui.swing.components.ButtonPanel |
---|
ButtonPanel.ActionChangeListener |
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class net.wotonomy.ui.swing.components.ButtonPanel |
---|
actionListener, ADD, buttonContainer, buttonList, buttonPanelLayout, CANCEL, CLEAR_ALL, insets, NO, OK, REFRESH, REMOVE, SAVE, STATE_CHANGED, YES |
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 java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
CheckButtonPanel()
Constructs a CheckButtonPanel. |
|
CheckButtonPanel(java.lang.String[] buttonList)
Constructs a ButtonPanel using specified buttons. |
Method Summary | |
---|---|
void |
checkAll()
Convenience method to check all boxes on the panel. |
void |
clearAll()
Convenience method to clear all boxes on the panel. |
protected java.awt.Component |
createComponentWithLabel(java.lang.String aLabel)
Overridden to return a JRadioButton. |
java.util.List |
getCheckedValueList()
Gets the labels of all checkboxes that are checked. |
java.lang.String[] |
getCheckedValues()
Gets the labels of all checkboxes that are checked. |
boolean |
getValue(java.lang.String aName)
Gets the value of the specified button. |
protected void |
initLayout()
Overridden to set vertical-center alignment and zero vgap. |
static void |
main(java.lang.String[] argv)
|
void |
setAllValues(boolean aValue)
Convenience method to set all checkboxes on the panel. |
void |
setCheckedValues(java.lang.String[] aLabelArray)
A convenience method to set only those buttons on the entire panel that should be checked. |
void |
setValue(java.lang.String aName,
boolean aValue)
Sets the value of the button whose name matches the given text value. |
void |
setValues(java.lang.String[] aLabelArray,
boolean aValue)
Sets the state of the specified buttons to the specified value. |
Methods inherited from class net.wotonomy.ui.swing.components.ButtonPanel |
---|
actionPerformed, addActionListener, addComponentToPanel, broadcastEvent, getAlignment, getButton, getHgap, getInsets, getLabels, getVgap, mouseDragged, mouseMoved, removeActionListener, setAlignment, setEnabled, setHgap, setInsets, setLabels, setLabels, setVgap |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CheckButtonPanel()
public CheckButtonPanel(java.lang.String[] buttonList)
buttonList
- An array containing the strings to be used in labeling the buttons.Method Detail |
---|
protected void initLayout()
initLayout
in class ButtonPanel
protected java.awt.Component createComponentWithLabel(java.lang.String aLabel)
createComponentWithLabel
in class ButtonPanel
aLabel
- The label for the component that will be created.
public void setValue(java.lang.String aName, boolean aValue)
aName
- A String matching the name of one of the buttons.
If null, empty, or not matching, nothing happens.aValue
- A value to set the button.public void setValues(java.lang.String[] aLabelArray, boolean aValue)
aLabelArray
- An Array of Strings listing the buttons to be set.aValue
- The value to which the specified buttons will be set.public void setAllValues(boolean aValue)
aValue
- The value to which all checkboxes on the panel will be set.public void checkAll()
public void clearAll()
public void setCheckedValues(java.lang.String[] aLabelArray)
aLabelArray
- An Array of Strings listing the buttons to be set.public java.util.List getCheckedValueList()
public java.lang.String[] getCheckedValues()
public boolean getValue(java.lang.String aName)
aName
- A String matching the name of one of the buttons.
public static void main(java.lang.String[] argv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |