Class BasicRibbonUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- org.pushingpixels.flamingo.internal.ui.ribbon.RibbonUI
-
- org.pushingpixels.flamingo.internal.ui.ribbon.BasicRibbonUI
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
BasicRibbonUI.BandHostPanel
protected static class
BasicRibbonUI.BandHostPopupPanel
protected class
BasicRibbonUI.RibbonLayout
Layout for the ribbon.protected class
BasicRibbonUI.TaskToggleButtonsHostPanel
-
Field Summary
-
Fields inherited from class org.pushingpixels.flamingo.internal.ui.ribbon.RibbonUI
applicationIcon
-
-
Constructor Summary
Constructors Constructor Description BasicRibbonUI()
Creates a new basic ribbon UI delegate.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BasicRibbonUI.BandHostPanel
createBandHostPanel()
protected LayoutManager
createBandHostPanelLayoutManager()
protected LayoutManager
createLayoutManager()
Invoked byinstallUI
to create a layout manager object to manage theJRibbon
.protected LayoutManager
createTaskbarLayoutManager()
Invoked byinstallUI
to create a layout manager object to manage theJRibbon
taskbar.protected BasicRibbonUI.TaskToggleButtonsHostPanel
createTaskToggleButtonsHostPanel()
protected LayoutManager
createTaskToggleButtonsHostPanelLayoutManager()
static ComponentUI
createUI(JComponent c)
protected int
getBandGap()
Returns the layout gap for the bands in the associated ribbon.Rectangle
getContextualTaskGroupBounds(RibbonContextualTaskGroup group)
Returns the bounds of the specified contextual task group.protected List<RibbonTask>
getCurrentlyShownRibbonTasks()
Returns the list of currently shown ribbon tasks.protected int
getTabButtonGap()
Returns the layout gap for the tab buttons in the associated ribbon.int
getTaskbarHeight()
Returns the height of the taskbar area.int
getTaskToggleButtonHeight()
Returns the height of the task toggle button area.Map<RibbonTask,JRibbonTaskToggleButton>
getTaskToggleButtons()
void
handleMouseWheelEvent(MouseWheelEvent e)
protected void
installComponents()
Installs subcomponents on the associated ribbon.protected void
installDefaults()
Installs defaults on the associated ribbon.protected void
installListeners()
Installs listeners on the associated ribbon.void
installUI(JComponent c)
boolean
isShowingScrollsForBands()
boolean
isShowingScrollsForTaskToggleButtons()
protected boolean
isUsingTitlePane()
void
paint(Graphics g, JComponent c)
protected void
paintBackground(Graphics g)
Paints the ribbon background.protected void
paintMinimizedRibbonSeparator(Graphics g)
protected void
paintTaskArea(Graphics g, int x, int y, int width, int height)
Paints the task border.protected void
scrollAndRevealTaskToggleButton(JRibbonTaskToggleButton taskToggleButton)
void
setApplicationIcon(ResizableIcon applicationIcon)
Sets the application icon.protected void
syncApplicationMenuTips()
protected void
syncRibbonState()
protected void
uninstallComponents()
Uninstalls subcomponents from the associated ribbon.protected void
uninstallDefaults()
Uninstalls defaults from the associated ribbon.protected void
uninstallListeners()
Uninstalls listeners from the associated ribbon.void
uninstallUI(JComponent c)
void
update(Graphics g, JComponent c)
-
Methods inherited from class org.pushingpixels.flamingo.internal.ui.ribbon.RibbonUI
getApplicationIcon
-
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize
-
-
-
-
Field Detail
-
IS_USING_TITLE_PANE
public static final String IS_USING_TITLE_PANE
Client property marking the ribbon component to indicate whether the task bar and contextual task group headers should be shown on the title pane of the window. This is only relevant for theJRibbonFrame
.- See Also:
- Constant Field Values
-
HELP_PANEL_COMPONENTS
public static final String HELP_PANEL_COMPONENTS
- See Also:
- Constant Field Values
-
ribbon
protected JRibbon ribbon
The associated ribbon.
-
taskBarPanel
protected JPanel taskBarPanel
Taskbar panel.
-
bandScrollablePanel
protected JScrollablePanel<BasicRibbonUI.BandHostPanel> bandScrollablePanel
-
taskToggleButtonsScrollablePanel
protected JScrollablePanel<BasicRibbonUI.TaskToggleButtonsHostPanel> taskToggleButtonsScrollablePanel
-
applicationMenuButton
protected JRibbonApplicationMenuButton applicationMenuButton
-
helpPanel
protected JComponent helpPanel
-
helpButton
protected JCommandButton helpButton
-
taskToggleButtons
protected Map<RibbonTask,JRibbonTaskToggleButton> taskToggleButtons
Map of toggle buttons of all tasks.
-
taskToggleButtonGroup
protected CommandToggleButtonGroup taskToggleButtonGroup
Button group for task toggle buttons.
-
ribbonChangeListener
protected ChangeListener ribbonChangeListener
Change listener.
-
propertyChangeListener
protected PropertyChangeListener propertyChangeListener
Property change listener.
-
ribbonContainerListener
protected ContainerListener ribbonContainerListener
-
ribbonComponentListener
protected ComponentListener ribbonComponentListener
-
-
Method Detail
-
createUI
public static ComponentUI createUI(JComponent c)
-
installUI
public void installUI(JComponent c)
- Overrides:
installUI
in classComponentUI
-
uninstallUI
public void uninstallUI(JComponent c)
- Overrides:
uninstallUI
in classComponentUI
-
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.
-
createTaskToggleButtonsHostPanelLayoutManager
protected LayoutManager createTaskToggleButtonsHostPanelLayoutManager()
-
createTaskToggleButtonsHostPanel
protected BasicRibbonUI.TaskToggleButtonsHostPanel createTaskToggleButtonsHostPanel()
-
createBandHostPanel
protected BasicRibbonUI.BandHostPanel createBandHostPanel()
-
createBandHostPanelLayoutManager
protected LayoutManager createBandHostPanelLayoutManager()
-
uninstallComponents
protected void uninstallComponents()
Uninstalls subcomponents from the associated ribbon.
-
update
public void update(Graphics g, JComponent c)
- Overrides:
update
in classComponentUI
-
paint
public void paint(Graphics g, JComponent c)
- Overrides:
paint
in classComponentUI
-
paintMinimizedRibbonSeparator
protected void paintMinimizedRibbonSeparator(Graphics g)
-
paintBackground
protected void paintBackground(Graphics g)
Paints the ribbon background.- Parameters:
g
- Graphics context.
-
paintTaskArea
protected void paintTaskArea(Graphics g, int x, int y, int width, int height)
Paints the task border.- Parameters:
g
- Graphics context.x
- Left X of the tasks band bounds.y
- Top Y of the tasks band bounds.width
- Width of the tasks band bounds.height
- Height of the tasks band bounds.
-
getContextualTaskGroupBounds
public Rectangle getContextualTaskGroupBounds(RibbonContextualTaskGroup group)
Description copied from class:RibbonUI
Returns the bounds of the specified contextual task group.- Specified by:
getContextualTaskGroupBounds
in classRibbonUI
- Parameters:
group
- Contextual task group.- Returns:
- The bounds of the specified contextual task group.
-
getBandGap
protected 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 LayoutManager createLayoutManager()
Invoked byinstallUI
to create a layout manager object to manage theJRibbon
.- Returns:
- a layout manager object
-
createTaskbarLayoutManager
protected LayoutManager createTaskbarLayoutManager()
Invoked byinstallUI
to create a layout manager object to manage theJRibbon
taskbar.- Returns:
- a layout manager object
-
getTaskbarHeight
public int getTaskbarHeight()
Returns the height of the taskbar area.- Returns:
- The height of the taskbar area.
-
getTaskToggleButtonHeight
public int getTaskToggleButtonHeight()
Returns the height of the task toggle button area.- Returns:
- The height of the task toggle button area.
-
syncRibbonState
protected void syncRibbonState()
-
getCurrentlyShownRibbonTasks
protected 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.
-
isUsingTitlePane
protected boolean isUsingTitlePane()
-
syncApplicationMenuTips
protected void syncApplicationMenuTips()
-
isShowingScrollsForTaskToggleButtons
public boolean isShowingScrollsForTaskToggleButtons()
- Specified by:
isShowingScrollsForTaskToggleButtons
in classRibbonUI
-
isShowingScrollsForBands
public boolean isShowingScrollsForBands()
- Specified by:
isShowingScrollsForBands
in classRibbonUI
-
getTaskToggleButtons
public Map<RibbonTask,JRibbonTaskToggleButton> getTaskToggleButtons()
-
handleMouseWheelEvent
public void handleMouseWheelEvent(MouseWheelEvent e)
- Specified by:
handleMouseWheelEvent
in classRibbonUI
-
scrollAndRevealTaskToggleButton
protected void scrollAndRevealTaskToggleButton(JRibbonTaskToggleButton taskToggleButton)
-
setApplicationIcon
public void setApplicationIcon(ResizableIcon applicationIcon)
Description copied from class:RibbonUI
Sets the application icon. This is displayed on the application menu button.There is no check performed to see if
applicationIcon
isnull
.- Overrides:
setApplicationIcon
in classRibbonUI
- Parameters:
applicationIcon
- the application icon to set
-
-