Class BasicRibbonUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- org.pushingpixels.radiance.component.internal.ui.ribbon.RibbonUI
-
- org.pushingpixels.radiance.component.internal.ui.ribbon.BasicRibbonUI
-
- Direct Known Subclasses:
RadianceRibbonUI
public abstract class BasicRibbonUI extends RibbonUI
Basic UI for ribbonJRibbon.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classBasicRibbonUI.AnchoredButtonsPanelLayoutprivate classBasicRibbonUI.BandHostPanelLayoutLayout for the band host panel.private static classBasicRibbonUI.BandHostPopupPanelprivate classBasicRibbonUI.RibbonLayoutLayout for the ribbon.protected classBasicRibbonUI.TaskToggleButtonsHostPanelprivate classBasicRibbonUI.TaskToggleButtonsHostPanelLayoutLayout for the band host panel.
-
Field Summary
Fields Modifier and Type Field Description private java.awt.ContaineranchoredButtonsprotected JCommandButtonapplicationMenuButtonprotected JScrollablePanel<javax.swing.JPanel>bandScrollablePanelstatic java.lang.StringINTERNALprivate static java.lang.StringJUST_MINIMIZEDprivate java.beans.PropertyChangeListenerpropertyChangeListenerProperty change listener.protected JRibbonribbonThe associated ribbon.private javax.swing.event.ChangeListenerribbonChangeListenerChange listener.private java.awt.event.ComponentListenerribbonComponentListenerprivate java.util.Map<RibbonTask,PopupPanelManager.PopupListener>taskPopupListenersprotected java.util.Map<RibbonTask,JRibbonTaskToggleButton>taskToggleButtonsMap of toggle buttons of all tasks.protected JScrollablePanel<BasicRibbonUI.TaskToggleButtonsHostPanel>taskToggleButtonsScrollablePanelprivate CommandToggleGroupModeltaskToggleGroupModelGroup model for task toggle buttons.
-
Constructor Summary
Constructors Modifier Constructor Description protectedBasicRibbonUI()Creates a new basic ribbon UI delegate.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private JCommandButtoncreateApplicationMenuButton()private java.awt.LayoutManagercreateBandHostPanelLayoutManager()protected java.awt.LayoutManagercreateLayoutManager()Invoked byinstallUIto create a layout manager object to manage theJRibbon.protected abstract BasicRibbonUI.TaskToggleButtonsHostPanelcreateTaskToggleButtonsHostPanel()private java.awt.LayoutManagercreateTaskToggleButtonsHostPanelLayoutManager()java.util.List<JCommandButton>getAnchoredCommandButtons()JCommandButtongetApplicationMenuButton()private intgetBandGap()Returns the layout gap for the bands in the associated ribbon.java.awt.RectanglegetContextualTaskGroupBounds(RibbonContextualTaskGroup group)Returns the bounds of the specified contextual task group.private java.util.List<RibbonTask>getCurrentlyShownRibbonTasks()Returns the list of currently shown ribbon tasks.protected intgetTabButtonGap()Returns the layout gap for the tab buttons in the associated ribbon.java.util.Map<RibbonTask,JCommandButton>getTaskToggleButtons()voidhandleMouseWheelEvent(java.awt.event.MouseWheelEvent e)protected voidinstallComponents()Installs subcomponents on the associated ribbon.protected voidinstallDefaults()Installs defaults on the associated ribbon.protected voidinstallListeners()Installs listeners on the associated ribbon.voidinstallUI(javax.swing.JComponent c)booleanisShowingScrollsForTaskToggleButtons()voidpaint(java.awt.Graphics g, javax.swing.JComponent c)protected abstract voidpaintBackground(java.awt.Graphics g)Paints the ribbon background.protected abstract voidpaintMinimizedRibbonSeparator(java.awt.Graphics g)private voidprocessTaskSelection(RibbonTask task, JRibbonTaskToggleButton taskToggleButton)private voidscrollAndRevealTaskToggleButton(JCommandButton taskToggleButton)private voidsyncRibbonState()private voidsyncSelectedTask()protected voiduninstallComponents()Uninstalls subcomponents from the associated ribbon.protected voiduninstallDefaults()Uninstalls defaults from the associated ribbon.protected voiduninstallListeners()Uninstalls listeners from the associated ribbon.voiduninstallUI(javax.swing.JComponent c)voidupdate(java.awt.Graphics g, javax.swing.JComponent c)
-
-
-
Field Detail
-
JUST_MINIMIZED
private static final java.lang.String JUST_MINIMIZED
- See Also:
- Constant Field Values
-
INTERNAL
public static final java.lang.String INTERNAL
- See Also:
- Constant Field Values
-
ribbon
protected JRibbon ribbon
The associated ribbon.
-
bandScrollablePanel
protected JScrollablePanel<javax.swing.JPanel> bandScrollablePanel
-
taskToggleButtonsScrollablePanel
protected JScrollablePanel<BasicRibbonUI.TaskToggleButtonsHostPanel> taskToggleButtonsScrollablePanel
-
applicationMenuButton
protected JCommandButton applicationMenuButton
-
anchoredButtons
private java.awt.Container anchoredButtons
-
taskToggleButtons
protected java.util.Map<RibbonTask,JRibbonTaskToggleButton> taskToggleButtons
Map of toggle buttons of all tasks.
-
taskPopupListeners
private java.util.Map<RibbonTask,PopupPanelManager.PopupListener> taskPopupListeners
-
taskToggleGroupModel
private CommandToggleGroupModel taskToggleGroupModel
Group model for task toggle buttons.
-
ribbonChangeListener
private javax.swing.event.ChangeListener ribbonChangeListener
Change listener.
-
propertyChangeListener
private java.beans.PropertyChangeListener propertyChangeListener
Property change listener.
-
ribbonComponentListener
private java.awt.event.ComponentListener ribbonComponentListener
-
-
Method Detail
-
installUI
public void installUI(javax.swing.JComponent c)
- Overrides:
installUIin classjavax.swing.plaf.ComponentUI
-
uninstallUI
public void uninstallUI(javax.swing.JComponent c)
- Overrides:
uninstallUIin classjavax.swing.plaf.ComponentUI
-
installListeners
protected void installListeners()
Installs listeners on the associated ribbon.
-
uninstallListeners
protected void uninstallListeners()
Uninstalls listeners from the associated ribbon.
-
installDefaults
protected void installDefaults()
Installs defaults on the associated ribbon.
-
uninstallDefaults
protected void uninstallDefaults()
Uninstalls defaults from the associated ribbon.
-
installComponents
protected void installComponents()
Installs subcomponents on the associated ribbon.
-
createApplicationMenuButton
private JCommandButton createApplicationMenuButton()
-
getApplicationMenuButton
public JCommandButton getApplicationMenuButton()
- Specified by:
getApplicationMenuButtonin classRibbonUI
-
createTaskToggleButtonsHostPanelLayoutManager
private java.awt.LayoutManager createTaskToggleButtonsHostPanelLayoutManager()
-
createTaskToggleButtonsHostPanel
protected abstract BasicRibbonUI.TaskToggleButtonsHostPanel createTaskToggleButtonsHostPanel()
-
createBandHostPanelLayoutManager
private java.awt.LayoutManager createBandHostPanelLayoutManager()
-
uninstallComponents
protected void uninstallComponents()
Uninstalls subcomponents from the associated ribbon.
-
update
public void update(java.awt.Graphics g, javax.swing.JComponent c)- Overrides:
updatein classjavax.swing.plaf.ComponentUI
-
paint
public void paint(java.awt.Graphics g, javax.swing.JComponent c)- Overrides:
paintin classjavax.swing.plaf.ComponentUI
-
paintMinimizedRibbonSeparator
protected abstract void paintMinimizedRibbonSeparator(java.awt.Graphics g)
-
paintBackground
protected abstract void paintBackground(java.awt.Graphics g)
Paints the ribbon background.- Parameters:
g- Graphics context.
-
getContextualTaskGroupBounds
public java.awt.Rectangle getContextualTaskGroupBounds(RibbonContextualTaskGroup group)
Description copied from class:RibbonUIReturns the bounds of the specified contextual task group.- Specified by:
getContextualTaskGroupBoundsin classRibbonUI- Parameters:
group- Contextual task group.- Returns:
- The bounds of the specified contextual task group.
-
getBandGap
private int getBandGap()
Returns the layout gap for the bands in the associated ribbon.- Returns:
- The layout gap for the bands in the associated ribbon.
-
getTabButtonGap
protected int getTabButtonGap()
Returns the layout gap for the tab buttons in the associated ribbon.- Returns:
- The layout gap for the tab buttons in the associated ribbon.
-
createLayoutManager
protected java.awt.LayoutManager createLayoutManager()
Invoked byinstallUIto create a layout manager object to manage theJRibbon.- Returns:
- a layout manager object
-
syncSelectedTask
private void syncSelectedTask()
-
syncRibbonState
private void syncRibbonState()
-
processTaskSelection
private void processTaskSelection(RibbonTask task, JRibbonTaskToggleButton taskToggleButton)
-
getCurrentlyShownRibbonTasks
private java.util.List<RibbonTask> getCurrentlyShownRibbonTasks()
Returns the list of currently shown ribbon tasks. This method is for internal use only.- Returns:
- The list of currently shown ribbon tasks.
-
isShowingScrollsForTaskToggleButtons
public boolean isShowingScrollsForTaskToggleButtons()
- Specified by:
isShowingScrollsForTaskToggleButtonsin classRibbonUI
-
getTaskToggleButtons
public java.util.Map<RibbonTask,JCommandButton> getTaskToggleButtons()
-
getAnchoredCommandButtons
public java.util.List<JCommandButton> getAnchoredCommandButtons()
-
handleMouseWheelEvent
public void handleMouseWheelEvent(java.awt.event.MouseWheelEvent e)
- Specified by:
handleMouseWheelEventin classRibbonUI
-
scrollAndRevealTaskToggleButton
private void scrollAndRevealTaskToggleButton(JCommandButton taskToggleButton)
-
-