Class RadianceTabbedPaneUI

All Implemented Interfaces:
SwingConstants

public class RadianceTabbedPaneUI extends BasicTabbedPaneUI
UI for tabbed panes in Radiance look and feel.
  • Field Details

  • Constructor Details

    • RadianceTabbedPaneUI

      protected RadianceTabbedPaneUI()
      Creates the new UI delegate.
  • Method Details

    • createUI

      public static ComponentUI createUI(JComponent comp)
    • installUI

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

      public void uninstallUI(JComponent c)
      Overrides:
      uninstallUI in class BasicTabbedPaneUI
    • installListeners

      protected void installListeners()
      Overrides:
      installListeners in class BasicTabbedPaneUI
    • uninstallListeners

      protected void uninstallListeners()
      Overrides:
      uninstallListeners in class BasicTabbedPaneUI
    • installDefaults

      protected void installDefaults()
      Overrides:
      installDefaults in class BasicTabbedPaneUI
    • uninstallDefaults

      protected void uninstallDefaults()
      Overrides:
      uninstallDefaults in class BasicTabbedPaneUI
    • installComponents

      protected void installComponents()
      Overrides:
      installComponents in class BasicTabbedPaneUI
    • uninstallComponents

      protected void uninstallComponents()
      Overrides:
      uninstallComponents in class BasicTabbedPaneUI
    • getOutlinePainter

      private static RadianceOutlinePainter getOutlinePainter(JTabbedPane tabPane, ContainerColorTokens colorTokens)
    • paintTabBackgroundAt1X

      private static void paintTabBackgroundAt1X(Graphics2D graphics1X, JTabbedPane tabPane, int tabIndex, double scaleFactor, int width, int height, ContainerColorTokens colorTokens, Color tabColor)
    • paintRotationAwareTabBackground

      private void paintRotationAwareTabBackground(Graphics2D g, JTabbedPane tabPane, int tabIndex, int width, int height, int tabPlacement, ContainerColorTokens colorTokens)
    • paintCloseButtonImage

      private void paintCloseButtonImage(Graphics2D g, JTabbedPane tabPane, int width, int height, boolean toPaintBorder, ContainerColorTokens colorTokens)
      Retrieves the image of the close button.
    • paintTabBackground

      protected void paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
      Overrides:
      paintTabBackground in class BasicTabbedPaneUI
    • paintFocusIndicator

      protected void paintFocusIndicator(Graphics g, int tabPlacement, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect, boolean isSelected)
      Overrides:
      paintFocusIndicator in class BasicTabbedPaneUI
    • paintTabBorder

      protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
      Overrides:
      paintTabBorder in class BasicTabbedPaneUI
    • createScrollButton

      protected JButton createScrollButton(int direction)
      Overrides:
      createScrollButton in class BasicTabbedPaneUI
    • calculateTabHeight

      protected int calculateTabHeight(int tabPlacement, int tabIndex, int fontHeight)
      Overrides:
      calculateTabHeight in class BasicTabbedPaneUI
    • calculateTabWidth

      protected int calculateTabWidth(int tabPlacement, int tabIndex, FontMetrics metrics)
      Overrides:
      calculateTabWidth in class BasicTabbedPaneUI
    • calculateMaxTabHeight

      protected int calculateMaxTabHeight(int tabPlacement)
      Overrides:
      calculateMaxTabHeight in class BasicTabbedPaneUI
    • getTabRunOverlay

      protected int getTabRunOverlay(int tabPlacement)
      Overrides:
      getTabRunOverlay in class BasicTabbedPaneUI
    • paint

      public void paint(Graphics g, JComponent c)
      Overrides:
      paint in class BasicTabbedPaneUI
    • paintTab

      protected void paintTab(Graphics g, int tabPlacement, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect)
      Overrides:
      paintTab in class BasicTabbedPaneUI
    • paintTabArea

      protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex)
      Overrides:
      paintTabArea in class BasicTabbedPaneUI
    • getCloseButtonRectangleForDraw

      protected Rectangle getCloseButtonRectangleForDraw(int tabIndex, int x, int y, int width, int height)
      Retrieves the close button rectangle for drawing purposes.
      Parameters:
      tabIndex - Tab index.
      x - X coordinate of the tab.
      y - Y coordinate of the tab.
      width - The tab width.
      height - The tab height.
      Returns:
      The close button rectangle.
    • getCloseButtonRectangleForEvents

      protected Rectangle getCloseButtonRectangleForEvents(int tabIndex, int x, int y, int w, int h)
      Retrieves the close button rectangle for event handling.
      Parameters:
      tabIndex - Tab index.
      x - X coordinate of the tab.
      y - Y coordinate of the tab.
      w - The tab width.
      h - The tab height.
      Returns:
      The close button rectangle.
    • ensureCurrentLayout

      protected void ensureCurrentLayout()
      Ensures the current layout.
    • tryCloseTabs

      protected void tryCloseTabs(int tabIndex, RadianceThemingSlices.TabCloseKind tabCloseKind)
      Tries closing tabs based on the specified tab index and tab close kind.
      Parameters:
      tabIndex - Tab index.
      tabCloseKind - Tab close kind.
    • tryCloseTab

      protected void tryCloseTab(int tabIndex)
      Tries closing a single tab.
      Parameters:
      tabIndex - Tab index.
    • tryCloseTabs

      protected void tryCloseTabs(Set<Integer> tabIndexes)
      Tries closing the specified tabs.
      Parameters:
      tabIndexes - Tab indexes.
    • getTabLabelShiftX

      protected int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected)
      Overrides:
      getTabLabelShiftX in class BasicTabbedPaneUI
    • getTabLabelShiftY

      protected int getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected)
      Overrides:
      getTabLabelShiftY in class BasicTabbedPaneUI
    • getTabExtraWidth

      protected int getTabExtraWidth(int tabIndex)
      Returns extra width for the specified tab.
      Parameters:
      tabIndex - Tab index.
      Returns:
      Extra width for the specified tab.
    • getRolloverTabIndex

      public int getRolloverTabIndex()
      Returns the index of the tab currently being rolled-over.
      Returns:
      Index of the tab currently being rolled-over.
    • setTabAreaInsets

      public void setTabAreaInsets(Insets insets)
      Sets new value for tab area insets.
      Parameters:
      insets - Tab area insets.
    • getTabAreaInsets

      public Insets getTabAreaInsets()
      Returns tab area insets.
      Returns:
      Tab area insets.
    • getTabRectangle

      public Rectangle getTabRectangle(int tabIndex)
      Returns the tab rectangle for the specified tab.
      Parameters:
      tabIndex - Index of a tab.
      Returns:
      The tab rectangle for the specified parameters.
    • shouldPadTabRun

      protected boolean shouldPadTabRun(int tabPlacement, int run)
      Overrides:
      shouldPadTabRun in class BasicTabbedPaneUI
    • createLayoutManager

      protected LayoutManager createLayoutManager()
      Overrides:
      createLayoutManager in class BasicTabbedPaneUI
    • getContentBorderInsets

      protected Insets getContentBorderInsets(int tabPlacement)
      Overrides:
      getContentBorderInsets in class BasicTabbedPaneUI
    • paintContentBorderBottomEdge

      protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
      Overrides:
      paintContentBorderBottomEdge in class BasicTabbedPaneUI
    • paintContentBorderLeftEdge

      protected void paintContentBorderLeftEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
      Overrides:
      paintContentBorderLeftEdge in class BasicTabbedPaneUI
    • paintContentBorderRightEdge

      protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
      Overrides:
      paintContentBorderRightEdge in class BasicTabbedPaneUI
    • paintContentBorderTopEdge

      protected void paintContentBorderTopEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
      Overrides:
      paintContentBorderTopEdge in class BasicTabbedPaneUI
    • getTabBounds

      public Rectangle getTabBounds(JTabbedPane pane, int i)
      Overrides:
      getTabBounds in class BasicTabbedPaneUI
    • getModelStateInfo

      private StateTransitionTracker.ModelStateInfo getModelStateInfo(int tabIndex)
    • getTabState

      protected ComponentState getTabState(int tabIndex, boolean toAllowIgnoringSelectedState)
      Returns the current state for the specified tab.
      Parameters:
      tabIndex - Tab index.
      Returns:
      The current state for the specified tab.
    • paintText

      protected void paintText(Graphics g, int tabPlacement, Font font, FontMetrics metrics, int tabIndex, String title, Rectangle textRect, boolean isSelected)
      Overrides:
      paintText in class BasicTabbedPaneUI
    • paintIcon

      protected void paintIcon(Graphics g, int tabPlacement, int tabIndex, Icon icon, Rectangle iconRect, boolean isSelected)
      Overrides:
      paintIcon in class BasicTabbedPaneUI
    • createMouseListener

      protected MouseListener createMouseListener()
      Overrides:
      createMouseListener in class BasicTabbedPaneUI
    • toRotateTabsOnPlacement

      protected boolean toRotateTabsOnPlacement(int tabPlacement)
      Extension point to allow horizontal orientation of left / right placed tabs.
      Parameters:
      tabPlacement - Tab placement.
      Returns:
      Indication whether the tabs in the specified placement should be rotated.
    • getTracker

      private StateTransitionTracker getTracker(int tabIndex, boolean initialRollover, boolean initialSelected)
    • trackTabModification

      private void trackTabModification(int tabIndex, Component tabComponent)
    • update

      public void update(Graphics g, JComponent c)
      Overrides:
      update in class ComponentUI