Class BasicRibbonUI


public class BasicRibbonUI extends RibbonUI
Basic UI for ribbon JRibbon.
  • Field Details

  • Constructor Details

    • BasicRibbonUI

      public BasicRibbonUI()
      Creates a new basic ribbon UI delegate.
  • Method Details

    • createUI

      public static ComponentUI createUI(JComponent c)
    • installUI

      public void installUI(JComponent c)
      Overrides:
      installUI in class ComponentUI
    • uninstallUI

      public void uninstallUI(JComponent c)
      Overrides:
      uninstallUI in class 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.
    • 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 class ComponentUI
    • paint

      public void paint(Graphics g, JComponent c)
      Overrides:
      paint in class ComponentUI
    • 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 class RibbonUI
      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 by installUI to create a layout manager object to manage the JRibbon.
      Returns:
      a layout manager object
    • createTaskbarLayoutManager

      protected LayoutManager createTaskbarLayoutManager()
      Invoked by installUI to create a layout manager object to manage the JRibbon 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 class RibbonUI
    • isShowingScrollsForBands

      public boolean isShowingScrollsForBands()
      Specified by:
      isShowingScrollsForBands in class RibbonUI
    • getTaskToggleButtons

      public Map<RibbonTask,JRibbonTaskToggleButton> getTaskToggleButtons()
    • handleMouseWheelEvent

      public void handleMouseWheelEvent(MouseWheelEvent e)
      Specified by:
      handleMouseWheelEvent in class RibbonUI
    • 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 is null.

      Overrides:
      setApplicationIcon in class RibbonUI
      Parameters:
      applicationIcon - the application icon to set