Class BasicRibbonGalleryUI
java.lang.Object
javax.swing.plaf.ComponentUI
org.pushingpixels.flamingo.internal.ui.ribbon.RibbonGalleryUI
org.pushingpixels.flamingo.internal.ui.ribbon.BasicRibbonGalleryUI
Basic UI for ribbon gallery
JRibbonGallery.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected static classButton strip as a UI resource. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JCommandButtonStripContains the scroll down, scroll up and show popup buttons.protected BasicRibbonGalleryUI.ExpandCommandButtonThe button that shows the associated popup gallery.protected ActionListenerListener on the gallery expand button.protected intThe index of the first visible button.protected InsetsRibbon gallery margin.protected PopupPanelManager.PopupListenerListener on thePopupPanelManagerchanges to sync theJRibbonGallery.setShowingPopupPanel(boolean)once the popup gallery is dismissed by the user.protected PropertyChangeListenerProperty change listener.protected JRibbonGalleryThe associated ribbon gallery.protected JCommandButtonThe button that scrolls down the associatedribbonGallery.protected ActionListenerListener on the gallery scroll-down button.protected JCommandButtonThe button that scrolls up the associatedribbonGallery.protected ActionListenerListener on the gallery scroll-up button.protected intprotected intThe count of visible buttons. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected BasicRibbonGalleryUI.ExpandCommandButtonCreates the expand button.protected LayoutManagerInvoked byinstallUIto create a layout manager object to manage theJCommandButtonStrip.protected JCommandButtonCreates the scroll-down button.protected JCommandButtonCreates the scroll-up button.static ComponentUIprotected intReturns the layout gap for the controls in the associated ribbon gallery.intgetPreferredWidth(int buttonCount, int availableHeight) Returns the preferred width of the ribbon gallery for the specified parameters.protected voidInstalls subcomponents on the associated ribbon gallery.protected voidInstalls defaults on the associated ribbon gallery.protected voidInstalls listeners on the associated ribbon gallery.voidvoidpaint(Graphics g, JComponent c) protected voidpaintRibbonGalleryBorder(Graphics graphics) Paints ribbon gallery border.protected voidScrolls the contents of this ribbon gallery one row down.protected voidScrolls the contents of this ribbon gallery one row up.protected voidScrolls the contents of this ribbon gallery to reveal the currently selected button.protected voidprotected voidUninstalls subcomponents from the associated ribbon gallery.protected voidUninstalls defaults from the associated ribbon gallery.protected voidUninstalls listeners from the associated ribbon gallery.voidMethods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, update
-
Field Details
-
ribbonGallery
The associated ribbon gallery. -
firstVisibleButtonIndex
protected int firstVisibleButtonIndexThe index of the first visible button. -
visibleButtonsInEachRow
protected int visibleButtonsInEachRowThe count of visible buttons. -
visibleButtonRowNumber
protected int visibleButtonRowNumber -
scrollDownButton
The button that scrolls down the associatedribbonGallery. -
scrollUpButton
The button that scrolls up the associatedribbonGallery. -
expandActionButton
The button that shows the associated popup gallery. -
buttonStrip
Contains the scroll down, scroll up and show popup buttons.- See Also:
-
scrollDownListener
Listener on the gallery scroll-down button. -
scrollUpListener
Listener on the gallery scroll-up button. -
expandListener
Listener on the gallery expand button. -
popupListener
Listener on thePopupPanelManagerchanges to sync theJRibbonGallery.setShowingPopupPanel(boolean)once the popup gallery is dismissed by the user. -
propertyChangeListener
Property change listener. -
margin
Ribbon gallery margin.
-
-
Constructor Details
-
BasicRibbonGalleryUI
public BasicRibbonGalleryUI()
-
-
Method Details
-
createUI
-
installUI
- Overrides:
installUIin classComponentUI
-
installComponents
protected void installComponents()Installs subcomponents on the associated ribbon gallery. -
createScrollDownButton
Creates the scroll-down button.- Returns:
- Scroll-down button.
-
createScrollUpButton
Creates the scroll-up button.- Returns:
- Scroll-up button.
-
createExpandButton
Creates the expand button.- Returns:
- Expand button.
-
uninstallComponents
protected void uninstallComponents()Uninstalls subcomponents from the associated ribbon gallery. -
installDefaults
protected void installDefaults()Installs defaults on the associated ribbon gallery. -
uninstallDefaults
protected void uninstallDefaults()Uninstalls defaults from the associated ribbon gallery. -
installListeners
protected void installListeners()Installs listeners on the associated ribbon gallery. -
uninstallListeners
protected void uninstallListeners()Uninstalls listeners from the associated ribbon gallery. -
uninstallUI
- Overrides:
uninstallUIin classComponentUI
-
createLayoutManager
Invoked byinstallUIto create a layout manager object to manage theJCommandButtonStrip.- Returns:
- a layout manager object
-
paint
- Overrides:
paintin classComponentUI
-
paintRibbonGalleryBorder
Paints ribbon gallery border.- Parameters:
graphics- Graphics context.
-
getLayoutGap
protected int getLayoutGap()Returns the layout gap for the controls in the associated ribbon gallery.- Returns:
- The layout gap for the controls in the associated ribbon gallery.
-
getPreferredWidth
public int getPreferredWidth(int buttonCount, int availableHeight) Returns the preferred width of the ribbon gallery for the specified parameters.- Parameters:
buttonCount- Button count.availableHeight- Available height in pixels.- Returns:
- The preferred width of the ribbon gallery for the specified parameters.
-
scrollOneRowDown
protected void scrollOneRowDown()Scrolls the contents of this ribbon gallery one row down. -
scrollOneRowUp
protected void scrollOneRowUp()Scrolls the contents of this ribbon gallery one row up. -
scrollToSelected
protected void scrollToSelected()Scrolls the contents of this ribbon gallery to reveal the currently selected button. -
syncExpandKeyTip
protected void syncExpandKeyTip()
-