Class BasicCommandButtonPanelUI

Direct Known Subclasses:
RadianceCommandButtonPanelUI

public abstract class BasicCommandButtonPanelUI extends CommandButtonPanelUI
Basic UI for command button panel JCommandButtonPanel.
Author:
Kirill Grouchnikov
  • Field Details

    • SKIP_BACKGROUND_FILL

      public static final String SKIP_BACKGROUND_FILL
      Client property to mark the command button panel to not draw the background fill
      See Also:
    • buttonPanel

      protected JCommandButtonPanel buttonPanel
      The associated command button panel.
    • groupLabels

      protected JLabel[] groupLabels
      Labels of the button panel groups.
  • Constructor Details

    • BasicCommandButtonPanelUI

      public BasicCommandButtonPanelUI()
  • Method Details

    • installUI

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

      protected void installDefaults()
      Installs defaults on the associated button panel.
    • installComponents

      protected void installComponents()
      Installs sub-components on the associated button panel.
    • installListeners

      protected void installListeners()
      Installs listeners on the associated button panel.
    • uninstallUI

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

      protected void uninstallDefaults()
      Uninstalls defaults from the associated button panel.
    • uninstallComponents

      protected void uninstallComponents()
      Uninstalls sub-components from the associated button panel.
    • uninstallListeners

      protected void uninstallListeners()
      Uninstalls listeners from the associated button panel.
    • paint

      public void paint(Graphics g, JComponent c)
      Overrides:
      paint in class ComponentUI
    • paintGroupBackground

      protected abstract void paintGroupBackground(Graphics g, int groupIndex, int x, int y, int width, int height)
      Paints the background of the specified button panel group.
      Parameters:
      g - Graphics context.
      groupIndex - Group index.
      x - X coordinate of the button group bounds.
      y - Y coordinate of the button group bounds.
      width - Width of the button group bounds.
      height - Height of the button group bounds.
    • paintGroupTitleBackground

      protected abstract void paintGroupTitleBackground(Graphics g, int groupIndex, int x, int y, int width, int height)
      Paints the background of the title of specified button panel group.
      Parameters:
      g - Graphics context.
      groupIndex - Group index.
      x - X coordinate of the button group title bounds.
      y - Y coordinate of the button group title bounds.
      width - Width of the button group title bounds.
      height - Height of the button group title bounds.
    • getGroupTitleHeight

      protected abstract int getGroupTitleHeight(int groupIndex)
      Returns the height of the group title strip.
      Parameters:
      groupIndex - Group index.
      Returns:
      The height of the title strip of the specified group.
    • scrollToSelectedCommand

      public void scrollToSelectedCommand()
      Specified by:
      scrollToSelectedCommand in class CommandButtonPanelUI
    • getPreferredHeight

      public int getPreferredHeight(int buttonVisibleRows, int titleVisibleRows)
      Returns the preferred size of the associated button panel for the specified parameters.
      Parameters:
      buttonVisibleRows - Target number of visible button rows.
      titleVisibleRows - Target number of visible group title rows.
      Returns:
      The preferred size of the associated button panel for the specified parameters.
    • focusFirst

      public boolean focusFirst()
      Specified by:
      focusFirst in class CommandButtonPanelUI
    • focusLast

      public boolean focusLast()
      Specified by:
      focusLast in class CommandButtonPanelUI
    • hasFocus

      public boolean hasFocus()
      Specified by:
      hasFocus in class CommandButtonPanelUI
    • focusUp

      public boolean focusUp()
      Specified by:
      focusUp in class CommandButtonPanelUI
    • focusDown

      public boolean focusDown()
      Specified by:
      focusDown in class CommandButtonPanelUI
    • focusRight

      public boolean focusRight()
      Specified by:
      focusRight in class CommandButtonPanelUI
    • focusLeft

      public boolean focusLeft()
      Specified by:
      focusLeft in class CommandButtonPanelUI