|
|||||||||||
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.JPanel
prefuse.util.ui.JToggleGroup
Swing component representing a group of toggle buttons -- either checkboxes or radio buttons. This class uses a ListModel and ListSelectionModel to represent the selection state of the buttons.
Nested Class Summary |
Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
static int |
CHECKBOX
|
protected int |
m_axis
|
protected javax.swing.ListModel |
m_data
|
protected javax.swing.ButtonGroup |
m_group
|
protected java.lang.String[] |
m_labels
|
protected int |
m_margin
|
protected javax.swing.ListSelectionModel |
m_sel
|
protected int |
m_spacing
|
protected int |
m_type
|
static int |
RADIO
|
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 | |
JToggleGroup(int type,
javax.swing.ListModel data)
Create a new JToggleGroup. |
|
JToggleGroup(int type,
javax.swing.ListModel data,
javax.swing.ListSelectionModel selection)
Create a new JToggleGroup. |
|
JToggleGroup(int type,
java.lang.Object[] data)
Create a new JToggleGroup. |
Method Summary | |
int |
getAxisType()
Get the Box axis type used to orient the toggle group component. |
int |
getMargin()
Get the margin, in pixels, used at the ends of the JToggleGroup. |
javax.swing.ListModel |
getModel()
Get the ListModel backing this component. |
javax.swing.ListSelectionModel |
getSelectionModel()
Get the ListSelectionModel used by this component. |
int |
getSpacing()
Get the spacing between toggle group components. |
protected void |
initUI()
Initialize the UI. |
void |
setAxisType(int axis)
Set the Box axis type used to orient the toggle group component. |
void |
setBackground(java.awt.Color background)
Set the background color of this toggle group. |
void |
setFont(java.awt.Font font)
Set the font used by this toggle group. |
void |
setForeground(java.awt.Color foreground)
Set the foreground color of this toggle group. |
void |
setGroupFocusable(boolean b)
Sets if the various toggle buttons can receive the keyboard focus. |
void |
setLabels(java.lang.String[] labels)
Set the labels to use for the Objects contained in the list model. |
void |
setMargin(int margin)
Set the margin, in pixels, to use at the ends of the JToggleGroup. |
void |
setModel(javax.swing.ListModel model)
Set the ListModel backing this component. |
void |
setSelectionModel(javax.swing.ListSelectionModel sel)
Set the ListSelectionModel used by this component. |
void |
setSpacing(int spacing)
Set the spacing between toggle group components. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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 |
Field Detail |
public static final int CHECKBOX
public static final int RADIO
protected final int m_type
protected int m_margin
protected int m_spacing
protected int m_axis
protected javax.swing.ListModel m_data
protected javax.swing.ListSelectionModel m_sel
protected java.lang.String[] m_labels
protected javax.swing.ButtonGroup m_group
Constructor Detail |
public JToggleGroup(int type, java.lang.Object[] data)
type
- the toggle button type to use, one of CHECKBOX
or RADIO
data
- the list data that should populate the toggle grouppublic JToggleGroup(int type, javax.swing.ListModel data)
type
- the toggle button type to use, one of CHECKBOX
or RADIO
data
- the list model data backing the toggle grouppublic JToggleGroup(int type, javax.swing.ListModel data, javax.swing.ListSelectionModel selection)
type
- the toggle button type to use, one of CHECKBOX
or RADIO
data
- the list model data backing the toggle groupselection
- the list selection model to use to monitor selection
changes to the various toggle buttons.Method Detail |
protected void initUI()
public void setAxisType(int axis)
axis
- the axis type, one of
BoxLayout.X_AXIS
,
BoxLayout.Y_AXIS
,
BoxLayout.LINE_AXIS
, or
BoxLayout.PAGE_AXIS
.public int getAxisType()
BoxLayout.X_AXIS
,
BoxLayout.Y_AXIS
,
BoxLayout.LINE_AXIS
, or
BoxLayout.PAGE_AXIS
.public void setMargin(int margin)
margin
- the margin in pixelspublic int getMargin()
public void setSpacing(int spacing)
spacing
- the spacing, in pixels, to use between componentspublic int getSpacing()
public void setModel(javax.swing.ListModel model)
public javax.swing.ListModel getModel()
public void setSelectionModel(javax.swing.ListSelectionModel sel)
sel
- the list selection model to usepublic javax.swing.ListSelectionModel getSelectionModel()
public void setLabels(java.lang.String[] labels)
labels
- the display labels to use in the interface componentpublic void setBackground(java.awt.Color background)
Component.setBackground(java.awt.Color)
public void setForeground(java.awt.Color foreground)
Component.setBackground(java.awt.Color)
public void setFont(java.awt.Font font)
Component.setFont(java.awt.Font)
public void setGroupFocusable(boolean b)
b
- true to set toggle buttons keyboard accessible, false to
set them unaccessible.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |