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 class
protected static class
Button strip as a UI resource. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JCommandButtonStrip
Contains the scroll down, scroll up and show popup buttons.protected BasicRibbonGalleryUI.ExpandCommandButton
The button that shows the associated popup gallery.protected ActionListener
Listener on the gallery expand button.protected int
The index of the first visible button.protected Insets
Ribbon gallery margin.protected PopupPanelManager.PopupListener
Listener on thePopupPanelManager
changes to sync theJRibbonGallery.setShowingPopupPanel(boolean)
once the popup gallery is dismissed by the user.protected PropertyChangeListener
Property change listener.protected JRibbonGallery
The associated ribbon gallery.protected JCommandButton
The button that scrolls down the associatedribbonGallery
.protected ActionListener
Listener on the gallery scroll-down button.protected JCommandButton
The button that scrolls up the associatedribbonGallery
.protected ActionListener
Listener on the gallery scroll-up button.protected int
protected int
The count of visible buttons. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected BasicRibbonGalleryUI.ExpandCommandButton
Creates the expand button.protected LayoutManager
Invoked byinstallUI
to create a layout manager object to manage theJCommandButtonStrip
.protected JCommandButton
Creates the scroll-down button.protected JCommandButton
Creates the scroll-up button.static ComponentUI
protected int
Returns the layout gap for the controls in the associated ribbon gallery.int
getPreferredWidth
(int buttonCount, int availableHeight) Returns the preferred width of the ribbon gallery for the specified parameters.protected void
Installs subcomponents on the associated ribbon gallery.protected void
Installs defaults on the associated ribbon gallery.protected void
Installs listeners on the associated ribbon gallery.void
void
paint
(Graphics g, JComponent c) protected void
paintRibbonGalleryBorder
(Graphics graphics) Paints ribbon gallery border.protected void
Scrolls the contents of this ribbon gallery one row down.protected void
Scrolls the contents of this ribbon gallery one row up.protected void
Scrolls the contents of this ribbon gallery to reveal the currently selected button.protected void
protected void
Uninstalls subcomponents from the associated ribbon gallery.protected void
Uninstalls defaults from the associated ribbon gallery.protected void
Uninstalls listeners from the associated ribbon gallery.void
Methods 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 thePopupPanelManager
changes 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:
installUI
in 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:
uninstallUI
in classComponentUI
-
createLayoutManager
Invoked byinstallUI
to create a layout manager object to manage theJCommandButtonStrip
.- Returns:
- a layout manager object
-
paint
- Overrides:
paint
in 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()
-