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 classBasicRibbonGalleryUI.ExpandCommandButtonprotected static classBasicRibbonGalleryUI.JButtonStripUIResourceButton strip as a UI resource.
-
Field Summary
Fields Modifier and Type Field Description protected JCommandButtonStripbuttonStripContains the scroll down, scroll up and show popup buttons.protected BasicRibbonGalleryUI.ExpandCommandButtonexpandActionButtonThe button that shows the associated popup gallery.protected ActionListenerexpandListenerListener on the gallery expand button.protected intfirstVisibleButtonIndexThe index of the first visible button.protected InsetsmarginRibbon gallery margin.protected PopupPanelManager.PopupListenerpopupListenerListener on thePopupPanelManagerchanges to sync theJRibbonGallery.setShowingPopupPanel(boolean)once the popup gallery is dismissed by the user.protected PropertyChangeListenerpropertyChangeListenerProperty change listener.protected JRibbonGalleryribbonGalleryThe associated ribbon gallery.protected JCommandButtonscrollDownButtonThe button that scrolls down the associatedribbonGallery.protected ActionListenerscrollDownListenerListener on the gallery scroll-down button.protected JCommandButtonscrollUpButtonThe button that scrolls up the associatedribbonGallery.protected ActionListenerscrollUpListenerListener on the gallery scroll-up button.protected intvisibleButtonRowNumberprotected intvisibleButtonsInEachRowThe 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.ExpandCommandButtoncreateExpandButton()Creates the expand button.protected LayoutManagercreateLayoutManager()Invoked byinstallUIto create a layout manager object to manage theJCommandButtonStrip.protected JCommandButtoncreateScrollDownButton()Creates the scroll-down button.protected JCommandButtoncreateScrollUpButton()Creates the scroll-up button.static ComponentUIcreateUI(JComponent c)protected intgetLayoutGap()Returns 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 voidinstallComponents()Installs subcomponents on the associated ribbon gallery.protected voidinstallDefaults()Installs defaults on the associated ribbon gallery.protected voidinstallListeners()Installs listeners on the associated ribbon gallery.voidinstallUI(JComponent c)voidpaint(Graphics g, JComponent c)protected voidpaintRibbonGalleryBorder(Graphics graphics)Paints ribbon gallery border.protected voidscrollOneRowDown()Scrolls the contents of this ribbon gallery one row down.protected voidscrollOneRowUp()Scrolls the contents of this ribbon gallery one row up.protected voidscrollToSelected()Scrolls the contents of this ribbon gallery to reveal the currently selected button.protected voidsyncExpandKeyTip()protected voiduninstallComponents()Uninstalls subcomponents from the associated ribbon gallery.protected voiduninstallDefaults()Uninstalls defaults from the associated ribbon gallery.protected voiduninstallListeners()Uninstalls listeners from the associated ribbon gallery.voiduninstallUI(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 thePopupPanelManagerchanges 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:
installUIin 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:
uninstallUIin classComponentUI
-
createLayoutManager
protected LayoutManager createLayoutManager()
Invoked byinstallUIto create a layout manager object to manage theJCommandButtonStrip.- Returns:
- a layout manager object
-
paint
public void paint(Graphics g, JComponent c)
- Overrides:
paintin 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()
-
-