Class BasicRibbonGalleryUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- org.pushingpixels.radiance.component.internal.ui.ribbon.RibbonGalleryUI
-
- org.pushingpixels.radiance.component.internal.ui.ribbon.BasicRibbonGalleryUI
-
- Direct Known Subclasses:
RadianceRibbonGalleryUI
public abstract class BasicRibbonGalleryUI extends RibbonGalleryUI
Basic UI for ribbon galleryJRibbonGallery
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
BasicRibbonGalleryUI.RibbonGalleryLayout
Layout for the ribbon gallery.
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.JComponent
buttonStrip
Contains the scroll down, scroll up and show popup buttons.private Command
expandCommand
private CommandMenuContentModel
expandedGalleryContentModel
private javax.swing.event.ChangeListener
expandedGalleryModelChangeListener
private int
firstVisibleButtonIndex
The index of the first visible button.private RibbonGalleryContentModel.GalleryCommandAction
galleryCommandSelectionListener
private javax.swing.event.ChangeListener
galleryModelChangeListener
private CommandGroup
galleryScrollerCommands
protected java.awt.Insets
margin
Ribbon gallery margin.static java.lang.String
RIBBON_GALLERY_EXPAND_BUTTON
protected JRibbonGallery
ribbonGallery
The associated ribbon gallery.private Command
scrollDownCommand
private Command
scrollUpCommand
private int
visibleButtonRowNumber
private int
visibleButtonsInEachRow
The count of visible buttons.
-
Constructor Summary
Constructors Constructor Description BasicRibbonGalleryUI()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.awt.LayoutManager
createLayoutManager()
Invoked byinstallUI
to create a layout manager object to manage the ribbon gallery.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.private int
getScrollerButtonWidth()
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(javax.swing.JComponent c)
void
paint(java.awt.Graphics g, javax.swing.JComponent c)
protected abstract void
paintRibbonGalleryBorder(java.awt.Graphics graphics)
Paints ribbon gallery border.private void
scrollOneRowDown()
Scrolls the contents of this ribbon gallery one row down.private void
scrollOneRowUp()
Scrolls the contents of this ribbon gallery one row up.private void
scrollToSelected()
Scrolls the contents of this ribbon gallery to reveal the currently selected button.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(javax.swing.JComponent c)
-
-
-
Field Detail
-
RIBBON_GALLERY_EXPAND_BUTTON
public static final java.lang.String RIBBON_GALLERY_EXPAND_BUTTON
- See Also:
- Constant Field Values
-
ribbonGallery
protected JRibbonGallery ribbonGallery
The associated ribbon gallery.
-
firstVisibleButtonIndex
private int firstVisibleButtonIndex
The index of the first visible button.
-
visibleButtonsInEachRow
private int visibleButtonsInEachRow
The count of visible buttons.
-
visibleButtonRowNumber
private int visibleButtonRowNumber
-
scrollDownCommand
private Command scrollDownCommand
-
scrollUpCommand
private Command scrollUpCommand
-
expandCommand
private Command expandCommand
-
galleryScrollerCommands
private CommandGroup galleryScrollerCommands
-
buttonStrip
private javax.swing.JComponent buttonStrip
Contains the scroll down, scroll up and show popup buttons.
-
expandedGalleryContentModel
private CommandMenuContentModel expandedGalleryContentModel
-
galleryCommandSelectionListener
private RibbonGalleryContentModel.GalleryCommandAction galleryCommandSelectionListener
-
galleryModelChangeListener
private javax.swing.event.ChangeListener galleryModelChangeListener
-
expandedGalleryModelChangeListener
private javax.swing.event.ChangeListener expandedGalleryModelChangeListener
-
margin
protected java.awt.Insets margin
Ribbon gallery margin.
-
-
Method Detail
-
installUI
public void installUI(javax.swing.JComponent c)
- Overrides:
installUI
in classjavax.swing.plaf.ComponentUI
-
installComponents
protected void installComponents()
Installs subcomponents on the associated ribbon gallery.
-
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(javax.swing.JComponent c)
- Overrides:
uninstallUI
in classjavax.swing.plaf.ComponentUI
-
createLayoutManager
protected java.awt.LayoutManager createLayoutManager()
Invoked byinstallUI
to create a layout manager object to manage the ribbon gallery.- Returns:
- a layout manager object
-
paint
public void paint(java.awt.Graphics g, javax.swing.JComponent c)
- Overrides:
paint
in classjavax.swing.plaf.ComponentUI
-
paintRibbonGalleryBorder
protected abstract void paintRibbonGalleryBorder(java.awt.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.
-
getScrollerButtonWidth
private int getScrollerButtonWidth()
-
scrollOneRowDown
private void scrollOneRowDown()
Scrolls the contents of this ribbon gallery one row down.
-
scrollOneRowUp
private void scrollOneRowUp()
Scrolls the contents of this ribbon gallery one row up.
-
scrollToSelected
private void scrollToSelected()
Scrolls the contents of this ribbon gallery to reveal the currently selected button.
-
-