Class MetalTabbedPaneUI

All Implemented Interfaces:
SwingConstants

public class MetalTabbedPaneUI extends BasicTabbedPaneUI
The Metal subclass of BasicTabbedPaneUI.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans has been added to the java.beans package. Please see XMLEncoder.

  • Field Details Link icon

    • minTabWidth Link icon

      protected int minTabWidth
      The minimum width of a pane.
    • tabAreaBackground Link icon

      protected Color tabAreaBackground
      The color of tab's background.
    • selectColor Link icon

      protected Color selectColor
      The color of the selected pane.
    • selectHighlight Link icon

      protected Color selectHighlight
      The color of the highlight.
  • Constructor Details Link icon

    • MetalTabbedPaneUI Link icon

      public MetalTabbedPaneUI()
      Constructs a MetalTabbedPaneUI.
  • Method Details Link icon

    • createUI Link icon

      public static ComponentUI createUI(JComponent x)
      Constructs MetalTabbedPaneUI.
      Parameters:
      x - a component
      Returns:
      an instance of MetalTabbedPaneUI
    • paintTopTabBorder Link icon

      protected void paintTopTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)
      Paints the top tab border.
      Parameters:
      tabIndex - a tab index
      g - an instance of Graphics
      x - an X coordinate
      y - an Y coordinate
      w - a width
      h - a height
      btm - bottom
      rght - right
      isSelected - a selection
    • shouldFillGap Link icon

      protected boolean shouldFillGap(int currentRun, int tabIndex, int x, int y)
      Returns true if the gap should be filled.
      Parameters:
      currentRun - the current run
      tabIndex - the tab index
      x - an X coordinate
      y - an Y coordinate
      Returns:
      true if the gap should be filled
    • getColorForGap Link icon

      protected Color getColorForGap(int currentRun, int x, int y)
      Returns the color of the gap.
      Parameters:
      currentRun - the current run
      x - an X coordinate
      y - an Y coordinate
      Returns:
      the color of the gap
    • paintLeftTabBorder Link icon

      protected void paintLeftTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)
      Paints the left tab border.
      Parameters:
      tabIndex - a tab index
      g - an instance of Graphics
      x - an X coordinate
      y - an Y coordinate
      w - a width
      h - a height
      btm - bottom
      rght - right
      isSelected - a selection
    • paintBottomTabBorder Link icon

      protected void paintBottomTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)
      Paints the bottom tab border.
      Parameters:
      tabIndex - a tab index
      g - an instance of Graphics
      x - an X coordinate
      y - an Y coordinate
      w - a width
      h - a height
      btm - bottom
      rght - right
      isSelected - a selection
    • paintRightTabBorder Link icon

      protected void paintRightTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)
      Paints the right tab border.
      Parameters:
      tabIndex - a tab index
      g - an instance of Graphics
      x - an X coordinate
      y - an Y coordinate
      w - a width
      h - a height
      btm - bottom
      rght - right
      isSelected - a selection
    • getTabLabelShiftX Link icon

      protected int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected)
      Overridden to do nothing for the Java L&F.
      Overrides:
      getTabLabelShiftX in class BasicTabbedPaneUI
      Parameters:
      tabPlacement - the tab placement
      tabIndex - the tab index
      isSelected - selection status
      Returns:
      the tab label shift x
    • getTabLabelShiftY Link icon

      protected int getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected)
      Overridden to do nothing for the Java L&F.
      Overrides:
      getTabLabelShiftY in class BasicTabbedPaneUI
      Parameters:
      tabPlacement - the tab placement
      tabIndex - the tab index
      isSelected - selection status
      Returns:
      the tab label shift y
    • getBaselineOffset Link icon

      protected int getBaselineOffset()
      Returns the amount the baseline is offset by. This is typically the same as getTabLabelShiftY.
      Overrides:
      getBaselineOffset in class BasicTabbedPaneUI
      Returns:
      amount to offset the baseline by
      Since:
      1.6
    • paintHighlightBelowTab Link icon

      protected void paintHighlightBelowTab()
      Paints highlights below tab.
    • shouldRotateTabRuns Link icon

      protected boolean shouldRotateTabRuns(int tabPlacement, int selectedRun)
      Returns true if tab runs should be rotated.
      Parameters:
      tabPlacement - a tab placement
      selectedRun - a selected run
      Returns:
      true if tab runs should be rotated.