|
||||||||||
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
com.limegroup.gnutella.gui.ButtonRow
This class generates a row of buttons with a standard spacing between them. The row of buttons can be oriented either horizontally or vertically, depending on the parameter.
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 |
BOTTOM_GLUE
This will create a "glue" at the bottom of the button panel, pushing the buttons to the top. |
static int |
LEFT_GLUE
This will create a "glue" at the left of the button panel, pushing the buttons to the left. |
static int |
NO_GLUE
This will give the button panel no glue, leaving the buttons in the middle. |
static int |
RIGHT_GLUE
This will create a "glue" at the right of the button panel, pushing the buttons to the right. |
static int |
TOP_GLUE
This will create a "glue" at the top of the button panel, pushing the buttons to the bottom. |
static int |
X_AXIS
Specifies that the buttons should be aligned along the x axis. |
static int |
Y_AXIS
Specifies that the buttons should be aligned along the y axis. |
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 | |
ButtonRow(java.lang.String[] labelKeys,
java.lang.String[] toolTipKeys,
java.awt.event.ActionListener[] listeners)
Creates a row of buttons with standard separation between each button and with the specified tooltips and listeners. |
|
ButtonRow(java.lang.String[] labelKeys,
java.lang.String[] toolTipKeys,
java.awt.event.ActionListener[] listeners,
int orientation,
int glue)
Creates a row of buttons with standard separation between each button, aligned either vertically or horizontally, with or without glue. |
Method Summary | |
javax.swing.JButton |
getButtonAtIndex(int index)
This method allows access to specific buttons in the button row. |
void |
setButtonEnabled(int buttonIndex,
boolean enabled)
Sets the button at the specified index to be enabled or disabled. |
void |
setButtonsEnabled(boolean enabled)
Sets the enabled/disabled of all buttons in the row. |
void |
transformButton(int index,
java.lang.String label,
java.lang.String tip)
Tranforms the text and the tooltip of the button. |
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, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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 X_AXIS
public static final int Y_AXIS
public static final int TOP_GLUE
public static final int BOTTOM_GLUE
public static final int LEFT_GLUE
public static final int RIGHT_GLUE
public static final int NO_GLUE
Constructor Detail |
public ButtonRow(java.lang.String[] labelKeys, java.lang.String[] toolTipKeys, java.awt.event.ActionListener[] listeners)
labelKeys
- the array of keys for looking up the
locale-specific labels to use for the buttonslisteners
- the array of ActionListeners to use
for the buttons
IllegalArgumentException
- if the lengths of the
arrays in the constructor are not all equalpublic ButtonRow(java.lang.String[] labelKeys, java.lang.String[] toolTipKeys, java.awt.event.ActionListener[] listeners, int orientation, int glue)
labelKeys
- the array of keys for looking up the locale-specific
labels to use for the buttonslisteners
- the array of ActionListeners to use
for the buttonsorientation
- the orientation to use for the row of buttons,
either ButtonRow.X_AXIS or ButtonRow.Y_AXISglue
- the glue determining the placement of the buttons,
either TOP_GLUE, BOTTOM_GLUE, LEFT_GLUE, RIGHT_GLUE,
or NO_GLUE
IllegalArgumentException
- if the lengths of the
arrays in the constructor are not all equalMethod Detail |
public javax.swing.JButton getButtonAtIndex(int index)
index
- the index of the button to retrieve
java.lang.ArrayIndexOutOfBoundsException
- if the index is out of boundspublic void setButtonEnabled(int buttonIndex, boolean enabled)
buttonIndex
- the index of the button to enable or disableenabled
- whether to enable or disable the buttonpublic void setButtonsEnabled(boolean enabled)
enabled
- the enabled/disabled state of the buttonspublic void transformButton(int index, java.lang.String label, java.lang.String tip)
index
- The index of the button to change.label
- The new label for the button.tip
- The new tip for the button.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |