public class

MetalTabbedPaneUI

extends BasicTabbedPaneUI
java.lang.Object
   ↳ javax.swing.plaf.ComponentUI
     ↳ javax.swing.plaf.TabbedPaneUI
       ↳ javax.swing.plaf.basic.BasicTabbedPaneUI
         ↳ javax.swing.plaf.metal.MetalTabbedPaneUI

Class Overview

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 JavaBeansTM has been added to the java.beans package. Please see XMLEncoder.

Summary

Nested Classes
class MetalTabbedPaneUI.TabbedPaneLayout This inner class is marked "public" due to a compiler bug. 
[Expand]
Inherited Constants
From interface javax.swing.SwingConstants
Fields
protected int minTabWidth
protected Color selectColor
protected Color selectHighlight
protected Color tabAreaBackground
[Expand]
Inherited Fields
From class javax.swing.plaf.basic.BasicTabbedPaneUI
Public Constructors
MetalTabbedPaneUI()
Public Methods
static ComponentUI createUI(JComponent x)
void paint(Graphics g, JComponent c)
Paints the specified component appropriate for the look and feel.
void update(Graphics g, JComponent c)
Notifies this UI delegate that it's time to paint the specified component.
Protected Methods
int calculateMaxTabHeight(int tabPlacement)
LayoutManager createLayoutManager()
Invoked by installUI to create a layout manager object to manage the JTabbedPane.
int getBaselineOffset()
Returns the amount the baseline is offset by.
Color getColorForGap(int currentRun, int x, int y)
int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected)
Overridden to do nothing for the Java L&F.
int getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected)
Overridden to do nothing for the Java L&F.
int getTabRunOverlay(int tabPlacement)
void installDefaults()
void paintBottomTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)
void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
void paintContentBorderLeftEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
void paintContentBorderTopEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
void paintFocusIndicator(Graphics g, int tabPlacement, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect, boolean isSelected)
void paintHighlightBelowTab()
void paintLeftTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)
void paintRightTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)
void paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
this function draws the border around each tab note that this function does now draw the background of the tab.
void paintTopTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)
boolean shouldFillGap(int currentRun, int tabIndex, int x, int y)
boolean shouldPadTabRun(int tabPlacement, int run)
boolean shouldRotateTabRuns(int tabPlacement, int selectedRun)
[Expand]
Inherited Methods
From class javax.swing.plaf.basic.BasicTabbedPaneUI
From class javax.swing.plaf.TabbedPaneUI
From class javax.swing.plaf.ComponentUI
From class java.lang.Object

Fields

protected int minTabWidth

protected Color selectColor

protected Color selectHighlight

protected Color tabAreaBackground

Public Constructors

public MetalTabbedPaneUI ()

Public Methods

public static ComponentUI createUI (JComponent x)

public void paint (Graphics g, JComponent c)

Paints the specified component appropriate for the look and feel. This method is invoked from the ComponentUI.update method when the specified component is being painted. Subclasses should override this method and use the specified Graphics object to render the content of the component.

Parameters
g the Graphics context in which to paint
c the component being painted; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components

public void update (Graphics g, JComponent c)

Notifies this UI delegate that it's time to paint the specified component. This method is invoked by JComponent when the specified component is being painted. By default this method will fill the specified component with its background color (if its opaque property is true) and then immediately call paint. In general this method need not be overridden by subclasses; all look-and-feel rendering code should reside in the paint method.

Parameters
g the Graphics context in which to paint
c the component being painted; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components

Protected Methods

protected int calculateMaxTabHeight (int tabPlacement)

protected LayoutManager createLayoutManager ()

Invoked by installUI to create a layout manager object to manage the JTabbedPane.

Returns
  • a layout manager object

protected int getBaselineOffset ()

Returns the amount the baseline is offset by. This is typically the same as getTabLabelShiftY.

Returns
  • amount to offset the baseline by

protected Color getColorForGap (int currentRun, int x, int y)

protected int getTabLabelShiftX (int tabPlacement, int tabIndex, boolean isSelected)

Overridden to do nothing for the Java L&F.

protected int getTabLabelShiftY (int tabPlacement, int tabIndex, boolean isSelected)

Overridden to do nothing for the Java L&F.

protected int getTabRunOverlay (int tabPlacement)

protected void installDefaults ()

protected void paintBottomTabBorder (int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)

protected void paintContentBorderBottomEdge (Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)

protected void paintContentBorderLeftEdge (Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)

protected void paintContentBorderRightEdge (Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)

protected void paintContentBorderTopEdge (Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)

protected void paintFocusIndicator (Graphics g, int tabPlacement, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect, boolean isSelected)

protected void paintHighlightBelowTab ()

protected void paintLeftTabBorder (int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)

protected void paintRightTabBorder (int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)

protected void paintTabBackground (Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)

protected void paintTabBorder (Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)

this function draws the border around each tab note that this function does now draw the background of the tab. that is done elsewhere

protected void paintTopTabBorder (int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)

protected boolean shouldFillGap (int currentRun, int tabIndex, int x, int y)

protected boolean shouldPadTabRun (int tabPlacement, int run)

protected boolean shouldRotateTabRuns (int tabPlacement, int selectedRun)