javax.swing.ScrollableAbstractFileViewPanelpublic class JCommandButtonPanel
extends javax.swing.JComponent
implements javax.swing.Scrollable
CommandPanelContentModel and
CommandPanelPresentationModel instances used to project the command button panel
on screen for any dynamic manipulation of the state.
Under the default CommandPanelPresentationModel.LayoutKind.ROW_FILL, the buttons are
laid out in rows, never exceeding the available horizontal space. A vertical scroll bar
will kick in once there is not enough vertical space to show all the buttons.
The schematic below shows a row-fill command button panel:
+-----------------------------+-+ | |o| | +----+ +----+ +----+ +----+ |o| | | 01 | | 02 | | 03 | | 04 | |o| | +----+ +----+ +----+ +----+ |o| | | | | +----+ +----+ +----+ +----+ | | | | 05 | | 06 | | 07 | | 07 | | | | +----+ +----+ +----+ +----+ | | | | | | +----+ +----+ +----+ +----+ | | | | 09 | | 10 | | 11 | | 12 | | | | +----+ +----+ +----+ +----+ | | | | | | +----+ +----+ +----+ +----+ | | | | 13 | | 14 | | 15 | | 16 | | | +-----------------------------+-+
Each row hosts four buttons, and the vertical scroll bar allows scrolling the content up and down.
Under the CommandPanelPresentationModel.LayoutKind.COLUMN_FILL, the buttons are laid
out in columns, never exceeding the available vertical space. A horizontal scroll
bar will kick in once there is not enough horizontal space to show all the
buttons. The schematic below shows a column-fill command button panel:
+---------------------------------+ | | | +----+ +----+ +----+ +----+ +---| | | 01 | | 04 | | 07 | | 10 | | 13| | +----+ +----+ +----+ +----+ +---| | | | +----+ +----+ +----+ +----+ +---| | | 02 | | 05 | | 08 | | 11 | | 14| | +----+ +----+ +----+ +----+ +---| | | | +----+ +----+ +----+ +----+ +---| | | 03 | | 06 | | 09 | | 12 | | 15| | +----+ +----+ +----+ +----+ +---| | | +---------------------------------+ |oooo | +---------------------------------+
Each column hosts three buttons, and the horizontal scroll bar allows scrolling the content left and right.
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
uiClassID |
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT| Constructor | Description |
|---|---|
JCommandButtonPanel(Projection<JCommandButtonPanel,CommandPanelContentModel,CommandPanelPresentationModel> projection) |
| Modifier and Type | Method | Description |
|---|---|---|
java.util.List<JCommandButton> |
getGroupButtons(int groupIndex) |
Returns the list of all buttons in the specified button group.
|
int |
getGroupCount() |
Returns the number of button groups in this panel.
|
java.lang.String |
getGroupTitleAt(int index) |
Returns the title of the command group at the specified index.
|
java.awt.Dimension |
getPreferredScrollableViewportSize() |
|
Projection<JCommandButtonPanel,CommandPanelContentModel,CommandPanelPresentationModel> |
getProjection() |
|
int |
getScrollableBlockIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction) |
|
boolean |
getScrollableTracksViewportHeight() |
|
boolean |
getScrollableTracksViewportWidth() |
|
int |
getScrollableUnitIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction) |
|
Command |
getSelectedCommand() |
|
org.pushingpixels.flamingo.internal.ui.common.CommandButtonPanelUI |
getUI() |
Returns the UI delegate for this component.
|
java.lang.String |
getUIClassID() |
|
void |
scrollToSelectedCommand() |
|
void |
updateUI() |
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, getAccessibleContext, 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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleadd, 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, transferFocusDownCycle, validate, validateTreeaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, 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, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updatepublic static final java.lang.String uiClassID
getUIClassID(),
Constant Field Valuespublic JCommandButtonPanel(Projection<JCommandButtonPanel,CommandPanelContentModel,CommandPanelPresentationModel> projection)
public Projection<JCommandButtonPanel,CommandPanelContentModel,CommandPanelPresentationModel> getProjection()
public int getGroupCount()
public java.lang.String getGroupTitleAt(int index)
index - Command group index.public org.pushingpixels.flamingo.internal.ui.common.CommandButtonPanelUI getUI()
getUI in class javax.swing.JComponentCommandButtonPanelUI objectJComponent.setUI(javax.swing.plaf.ComponentUI)public void updateUI()
updateUI in class javax.swing.JComponentpublic java.lang.String getUIClassID()
getUIClassID in class javax.swing.JComponentpublic java.util.List<JCommandButton> getGroupButtons(int groupIndex)
groupIndex - Group index.getGroupCount()public Command getSelectedCommand()
public void scrollToSelectedCommand()
public java.awt.Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize in interface javax.swing.Scrollablepublic int getScrollableBlockIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
getScrollableBlockIncrement in interface javax.swing.Scrollablepublic boolean getScrollableTracksViewportHeight()
getScrollableTracksViewportHeight in interface javax.swing.Scrollablepublic boolean getScrollableTracksViewportWidth()
getScrollableTracksViewportWidth in interface javax.swing.Scrollablepublic int getScrollableUnitIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
getScrollableUnitIncrement in interface javax.swing.Scrollable