Class BasicRibbonGalleryUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- org.pushingpixels.flamingo.internal.ui.ribbon.RibbonGalleryUI
-
- org.pushingpixels.flamingo.internal.ui.ribbon.BasicRibbonGalleryUI
-
public class BasicRibbonGalleryUI extends RibbonGalleryUI
Basic UI for ribbon galleryJRibbonGallery
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
BasicRibbonGalleryUI.ExpandCommandButton
protected static class
BasicRibbonGalleryUI.JButtonStripUIResource
Button strip as a UI resource.
-
Field Summary
Fields Modifier and Type Field Description protected JCommandButtonStrip
buttonStrip
Contains the scroll down, scroll up and show popup buttons.protected BasicRibbonGalleryUI.ExpandCommandButton
expandActionButton
The button that shows the associated popup gallery.protected ActionListener
expandListener
Listener on the gallery expand button.protected int
firstVisibleButtonIndex
The index of the first visible button.protected Insets
margin
Ribbon gallery margin.protected PopupPanelManager.PopupListener
popupListener
Listener on thePopupPanelManager
changes to sync theJRibbonGallery.setShowingPopupPanel(boolean)
once the popup gallery is dismissed by the user.protected PropertyChangeListener
propertyChangeListener
Property change listener.protected JRibbonGallery
ribbonGallery
The associated ribbon gallery.protected JCommandButton
scrollDownButton
The button that scrolls down the associatedribbonGallery
.protected ActionListener
scrollDownListener
Listener on the gallery scroll-down button.protected JCommandButton
scrollUpButton
The button that scrolls up the associatedribbonGallery
.protected ActionListener
scrollUpListener
Listener on the gallery scroll-up button.protected int
visibleButtonRowNumber
protected int
visibleButtonsInEachRow
The count of visible buttons.
-
Constructor Summary
Constructors Constructor Description BasicRibbonGalleryUI()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BasicRibbonGalleryUI.ExpandCommandButton
createExpandButton()
Creates the expand button.protected LayoutManager
createLayoutManager()
Invoked byinstallUI
to create a layout manager object to manage theJCommandButtonStrip
.protected JCommandButton
createScrollDownButton()
Creates the scroll-down button.protected JCommandButton
createScrollUpButton()
Creates the scroll-up button.static ComponentUI
createUI(JComponent c)
protected int
getLayoutGap()
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
installComponents()
Installs subcomponents on the associated ribbon gallery.protected void
installDefaults()
Installs defaults on the associated ribbon gallery.protected void
installListeners()
Installs listeners on the associated ribbon gallery.void
installUI(JComponent c)
void
paint(Graphics g, JComponent c)
protected void
paintRibbonGalleryBorder(Graphics graphics)
Paints ribbon gallery border.protected void
scrollOneRowDown()
Scrolls the contents of this ribbon gallery one row down.protected void
scrollOneRowUp()
Scrolls the contents of this ribbon gallery one row up.protected void
scrollToSelected()
Scrolls the contents of this ribbon gallery to reveal the currently selected button.protected void
syncExpandKeyTip()
protected void
uninstallComponents()
Uninstalls subcomponents from the associated ribbon gallery.protected void
uninstallDefaults()
Uninstalls defaults from the associated ribbon gallery.protected void
uninstallListeners()
Uninstalls listeners from the associated ribbon gallery.void
uninstallUI(JComponent c)
-
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, update
-
-
-
-
Field Detail
-
ribbonGallery
protected JRibbonGallery ribbonGallery
The associated ribbon gallery.
-
firstVisibleButtonIndex
protected int firstVisibleButtonIndex
The index of the first visible button.
-
visibleButtonsInEachRow
protected int visibleButtonsInEachRow
The count of visible buttons.
-
visibleButtonRowNumber
protected int visibleButtonRowNumber
-
scrollDownButton
protected JCommandButton scrollDownButton
The button that scrolls down the associatedribbonGallery
.
-
scrollUpButton
protected JCommandButton scrollUpButton
The button that scrolls up the associatedribbonGallery
.
-
expandActionButton
protected BasicRibbonGalleryUI.ExpandCommandButton expandActionButton
The button that shows the associated popup gallery.
-
buttonStrip
protected JCommandButtonStrip buttonStrip
Contains the scroll down, scroll up and show popup buttons.- See Also:
scrollDownButton
,scrollUpButton
,expandActionButton
-
scrollDownListener
protected ActionListener scrollDownListener
Listener on the gallery scroll-down button.
-
scrollUpListener
protected ActionListener scrollUpListener
Listener on the gallery scroll-up button.
-
expandListener
protected ActionListener expandListener
Listener on the gallery expand button.
-
popupListener
protected PopupPanelManager.PopupListener popupListener
Listener on thePopupPanelManager
changes to sync theJRibbonGallery.setShowingPopupPanel(boolean)
once the popup gallery is dismissed by the user.
-
propertyChangeListener
protected PropertyChangeListener propertyChangeListener
Property change listener.
-
margin
protected Insets margin
Ribbon gallery margin.
-
-
Method Detail
-
createUI
public static ComponentUI createUI(JComponent c)
-
installUI
public void installUI(JComponent c)
- Overrides:
installUI
in classComponentUI
-
installComponents
protected void installComponents()
Installs subcomponents on the associated ribbon gallery.
-
createScrollDownButton
protected JCommandButton createScrollDownButton()
Creates the scroll-down button.- Returns:
- Scroll-down button.
-
createScrollUpButton
protected JCommandButton createScrollUpButton()
Creates the scroll-up button.- Returns:
- Scroll-up button.
-
createExpandButton
protected BasicRibbonGalleryUI.ExpandCommandButton 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
public void uninstallUI(JComponent c)
- Overrides:
uninstallUI
in classComponentUI
-
createLayoutManager
protected LayoutManager createLayoutManager()
Invoked byinstallUI
to create a layout manager object to manage theJCommandButtonStrip
.- Returns:
- a layout manager object
-
paint
public void paint(Graphics g, JComponent c)
- Overrides:
paint
in classComponentUI
-
paintRibbonGalleryBorder
protected void paintRibbonGalleryBorder(Graphics graphics)
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()
-
-