Class JRibbonGallery
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
org.pushingpixels.flamingo.internal.ui.ribbon.JRibbonGallery
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable
In-ribbon gallery. This class is for internal use only and should not be
directly used by the applications.
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<StringValuePair<List<JCommandToggleButton>>>Gallery button groups.protected List<JCommandToggleButton>The buttons ofthisgallery.protected CommandToggleButtonGroupButton group for ensuring that only one button is selected.protected RibbonElementPriorityThe current display priority ofthisin-ribbon gallery.protected booleanIndication whether the ribbon gallery is showing the popup panel.protected JRibbonBand.RibbonGalleryPopupCallbackprotected intPreferred maximum number of button columns for the popup panel.protected intPreferred maximum number of visible button rows for the popup panel.protected Map<RibbonElementPriority,Integer> Preferred widths for each possible display state (set in the user code according to design preferences).static final StringThe UI class ID string.Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRibbonGalleryButtons(String buttonGroupName, JCommandToggleButton... buttons) Adds toggle command buttons to the specified button group in this ribbon gallery.getButtonAt(int index) Returns the gallery button at specified index.intReturns the number of gallery buttons inthisin-ribbon gallery.getButtonGroup(String buttonGroupName) Returns the list of buttons in the specifed button group.intReturns the number of button groups inthisin-ribbon gallery.Returns the current display priority forthisin-ribbon gallery.Returns the associated popup gallery.intintintgetPreferredWidth(RibbonElementPriority state, int availableHeight) Returns the preferred width ofthisin-ribbon gallery for the specified display state.Returns the currently selected gallery button.getUI()Returns the UI object which implements the L&F for this component.Returns the name of the UI class that implements the L&F for this component.booleanReturns indication whether the popup panel is showing.voidremoveRibbonGalleryButtons(JCommandToggleButton... buttons) Removes the specified toggle command buttons from this ribbon gallery.voidsetButtonDisplayState(CommandButtonDisplayState buttonDisplayState) voidsetDisplayPriority(RibbonElementPriority displayPriority) Sets new display priority forthisin-ribbon gallery.voidsetExpandKeyTip(String expandKeyTip) voidsetGroupMapping(List<StringValuePair<List<JCommandToggleButton>>> buttons) Sets the button groups for this ribbon gallery.voidsetPopupCallback(JRibbonBand.RibbonGalleryPopupCallback popupCallback) voidsetPreferredPopupPanelDimension(int preferredPopupMaxButtonColumns, int preferredPopupMaxVisibleButtonRows) Sets the preferred dimension of the popup panel.voidsetPreferredVisibleButtonCount(RibbonElementPriority state, int visibleButtonCount) Set preferred width ofthisin-ribbon gallery for the specified display state.voidsetSelectedButton(JCommandToggleButton selectedButton) Sets new value for the currently selected gallery button.voidsetShowingPopupPanel(boolean isShowingPopupPanel) Sets indication whether the popup panel is showing.voidsetUI(RibbonGalleryUI ui) Sets the new UI delegate.voidupdateUI()Resets the UI property to a value from the current look and feel.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, 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, updateMethods 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, transferFocusDownCycle, validate, validateTreeMethods 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, 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, transferFocusUpCycle
-
Field Details
-
buttons
The buttons ofthisgallery. -
buttonSelectionGroup
Button group for ensuring that only one button is selected. -
displayPriority
The current display priority ofthisin-ribbon gallery. -
preferredVisibleIconCount
Preferred widths for each possible display state (set in the user code according to design preferences). -
buttonGroups
Gallery button groups. -
preferredPopupMaxButtonColumns
protected int preferredPopupMaxButtonColumnsPreferred maximum number of button columns for the popup panel. -
preferredPopupMaxVisibleButtonRows
protected int preferredPopupMaxVisibleButtonRowsPreferred maximum number of visible button rows for the popup panel. -
isShowingPopupPanel
protected boolean isShowingPopupPanelIndication whether the ribbon gallery is showing the popup panel. -
popupCallback
-
uiClassID
The UI class ID string.- See Also:
-
-
Constructor Details
-
JRibbonGallery
public JRibbonGallery()Creates new in-ribbon gallery.
-
-
Method Details
-
setUI
Sets the new UI delegate.- Parameters:
ui- New UI delegate.
-
updateUI
public void updateUI()Resets the UI property to a value from the current look and feel.- Overrides:
updateUIin classJComponent- See Also:
-
getUI
Returns the UI object which implements the L&F for this component.- Overrides:
getUIin classJComponent- Returns:
- a
RibbonGalleryUIobject - See Also:
-
getUIClassID
Returns the name of the UI class that implements the L&F for this component.- Overrides:
getUIClassIDin classJComponent- Returns:
- the string "RibbonGalleryUI"
- See Also:
-
setPreferredVisibleButtonCount
Set preferred width ofthisin-ribbon gallery for the specified display state.- Parameters:
state- Display state.visibleButtonCount- Preferred width for the specified state.
-
getPreferredWidth
Returns the preferred width ofthisin-ribbon gallery for the specified display state.- Parameters:
state- Display state.availableHeight- Available height in pixels.- Returns:
- The preferred width of
thisin-ribbon gallery for the specified display state.
-
setDisplayPriority
Sets new display priority forthisin-ribbon gallery.- Parameters:
displayPriority- New display priority forthisin-ribbon gallery.
-
getDisplayPriority
Returns the current display priority forthisin-ribbon gallery.- Returns:
- The current display priority for
thisin-ribbon gallery.
-
getButtonGroupCount
public int getButtonGroupCount()Returns the number of button groups inthisin-ribbon gallery.- Returns:
- The number of button groups in
thisin-ribbon gallery.
-
getButtonGroup
Returns the list of buttons in the specifed button group.- Parameters:
buttonGroupName- Button group name.- Returns:
- The list of buttons in the specifed button group.
-
getButtonCount
public int getButtonCount()Returns the number of gallery buttons inthisin-ribbon gallery.- Returns:
- The number of gallery buttons in
thisin-ribbon gallery.
-
getButtonAt
Returns the gallery button at specified index.- Parameters:
index- Gallery button index.- Returns:
- Gallery button at specified index.
-
getSelectedButton
Returns the currently selected gallery button.- Returns:
- The currently selected gallery button.
-
setSelectedButton
Sets new value for the currently selected gallery button.- Parameters:
selectedButton- New value for the currently selected gallery button.
-
getPopupButtonPanel
Returns the associated popup gallery.- Returns:
- The associated popup gallery.
-
setShowingPopupPanel
public void setShowingPopupPanel(boolean isShowingPopupPanel) Sets indication whether the popup panel is showing.- Parameters:
isShowingPopupPanel- Indication whether the popup panel is showing.
-
isShowingPopupPanel
public boolean isShowingPopupPanel()Returns indication whether the popup panel is showing.- Returns:
trueif the popup panel is showing,falseotherwise.
-
setGroupMapping
Sets the button groups for this ribbon gallery.- Parameters:
buttons- Button groups.
-
addRibbonGalleryButtons
Adds toggle command buttons to the specified button group in this ribbon gallery.- Parameters:
buttonGroupName- Button group name.buttons- Toggle command buttons to add to the specified button group.
-
removeRibbonGalleryButtons
Removes the specified toggle command buttons from this ribbon gallery.- Parameters:
buttons- Toggle command buttons to remove from this gallery.
-
setPreferredPopupPanelDimension
public void setPreferredPopupPanelDimension(int preferredPopupMaxButtonColumns, int preferredPopupMaxVisibleButtonRows) Sets the preferred dimension of the popup panel.- Parameters:
preferredPopupMaxButtonColumns- Preferred maximum number of button columns for the popup panel.preferredPopupMaxVisibleButtonRows- Preferred maximum number of visible button rows for the popup panel.
-
setPopupCallback
-
getPopupCallback
-
getPreferredPopupMaxButtonColumns
public int getPreferredPopupMaxButtonColumns() -
getPreferredPopupMaxVisibleButtonRows
public int getPreferredPopupMaxVisibleButtonRows() -
setExpandKeyTip
-
getExpandKeyTip
-
getButtonDisplayState
-
setButtonDisplayState
-