Class MetalTabbedPaneUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.TabbedPaneUI
-
- javax.swing.plaf.basic.BasicTabbedPaneUI
-
- javax.swing.plaf.metal.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
.
Nested Classes
Modifier and Type | Class and Description |
---|---|
class |
MetalTabbedPaneUI.TabbedPaneLayout This class should be treated as a "protected" inner class. |
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicTabbedPaneUI
BasicTabbedPaneUI.FocusHandler, BasicTabbedPaneUI.MouseHandler, BasicTabbedPaneUI.PropertyChangeHandler, BasicTabbedPaneUI.TabSelectionHandler
Fields
Modifier and Type | Field and Description |
---|---|
protected int |
minTabWidth |
protected Color |
selectColor |
protected Color |
selectHighlight |
protected Color |
tabAreaBackground |
Fields inherited from class javax.swing.plaf.basic.BasicTabbedPaneUI
calcRect, contentBorderInsets, darkShadow, downKey, focus, focusListener, highlight, leftKey, lightHighlight, maxTabHeight, maxTabWidth, mouseListener, propertyChangeListener, rects, rightKey, runCount, selectedRun, selectedTabPadInsets, shadow, tabAreaInsets, tabChangeListener, tabInsets, tabPane, tabRunOverlay, tabRuns, textIconGap, upKey
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
Constructors
Constructor and Description |
---|
MetalTabbedPaneUI() |
Methods
Modifier and Type | Method and Description |
---|---|
protected int |
calculateMaxTabHeight(int tabPlacement) |
protected LayoutManager |
createLayoutManager() Invoked by |
static ComponentUI |
createUI(JComponent x) |
protected int |
getBaselineOffset() Returns the amount the baseline is offset 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() |
void |
paint(Graphics g,
JComponent c) Paints the specified component appropriately for the look and feel. |
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. |
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) |
void |
update(Graphics g,
JComponent c) Notifies this UI delegate that it is time to paint the specified component. |
Methods inherited from class javax.swing.plaf.basic.BasicTabbedPaneUI
assureRectsCreated, calculateMaxTabWidth, calculateTabAreaHeight, calculateTabAreaWidth, calculateTabHeight, calculateTabWidth, createChangeListener, createFocusListener, createMouseListener, createPropertyChangeListener, createScrollButton, expandTabRunsArray, getBaseline, getBaseline, getBaselineResizeBehavior, getContentBorderInsets, getFocusIndex, getFontMetrics, getIconForTab, getMaximumSize, getMinimumSize, getNextTabIndex, getNextTabIndexInRun, getNextTabRun, getPreviousTabIndex, getPreviousTabIndexInRun, getPreviousTabRun, getRolloverTab, getRunForTab, getSelectedTabPadInsets, getTabAreaInsets, getTabBounds, getTabBounds, getTabInsets, getTabRunCount, getTabRunIndent, getTabRunOffset, getTextViewForTab, getVisibleComponent, installComponents, installKeyboardActions, installListeners, installUI, lastTabInRun, layoutLabel, navigateSelectedTab, paintContentBorder, paintIcon, paintTab, paintTabArea, paintText, rotateInsets, selectAdjacentRunTab, selectNextTab, selectNextTabInRun, selectPreviousTab, selectPreviousTabInRun, setRolloverTab, setVisibleComponent, shouldRotateTabRuns, tabForCoordinate, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getPreferredSize
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Fields
minTabWidth
protected int minTabWidth
tabAreaBackground
protected Color tabAreaBackground
selectColor
protected Color selectColor
selectHighlight
protected Color selectHighlight
Constructors
MetalTabbedPaneUI
public MetalTabbedPaneUI()
Methods
createUI
public static ComponentUI createUI(JComponent x)
createLayoutManager
protected LayoutManager createLayoutManager()
Description copied from class: BasicTabbedPaneUI
Invoked by installUI
to create a layout manager object to manage the JTabbedPane
.
- Overrides:
-
createLayoutManager
in classBasicTabbedPaneUI
- Returns:
- a layout manager object
- See Also:
-
BasicTabbedPaneUI.TabbedPaneLayout
,JTabbedPane.getTabLayoutPolicy()
installDefaults
protected void installDefaults()
- Overrides:
-
installDefaults
in classBasicTabbedPaneUI
paintTabBorder
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
Description copied from class: BasicTabbedPaneUI
this function draws the border around each tab note that this function does now draw the background of the tab. that is done elsewhere
- Overrides:
-
paintTabBorder
in classBasicTabbedPaneUI
paintTopTabBorder
protected void paintTopTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)
shouldFillGap
protected boolean shouldFillGap(int currentRun, int tabIndex, int x, int y)
getColorForGap
protected Color getColorForGap(int currentRun, int x, int y)
paintLeftTabBorder
protected void paintLeftTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)
paintBottomTabBorder
protected void paintBottomTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)
paintRightTabBorder
protected void paintRightTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)
update
public void update(Graphics g, JComponent c)
Description copied from class: ComponentUI
Notifies this UI delegate that it is time to paint the specified component. This method is invoked by JComponent
when the specified component is being painted.
By default this method fills the specified component with its background color if its opaque
property is true
, and then immediately calls paint
. In general this method need not be overridden by subclasses; all look-and-feel rendering code should reside in the paint
method.
- Overrides:
-
update
in classComponentUI
- Parameters:
-
g
- theGraphics
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 - See Also:
-
ComponentUI.paint(java.awt.Graphics, javax.swing.JComponent)
,JComponent.paintComponent(java.awt.Graphics)
paintTabBackground
protected void paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
- Overrides:
-
paintTabBackground
in classBasicTabbedPaneUI
getTabLabelShiftX
protected int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected)
Overridden to do nothing for the Java L&F.
- Overrides:
-
getTabLabelShiftX
in classBasicTabbedPaneUI
getTabLabelShiftY
protected int getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected)
Overridden to do nothing for the Java L&F.
- Overrides:
-
getTabLabelShiftY
in classBasicTabbedPaneUI
getBaselineOffset
protected int getBaselineOffset()
Returns the amount the baseline is offset by. This is typically the same as getTabLabelShiftY
.
- Overrides:
-
getBaselineOffset
in classBasicTabbedPaneUI
- Returns:
- amount to offset the baseline by
- Since:
- 1.6
paint
public void paint(Graphics g, JComponent c)
Description copied from class: ComponentUI
Paints the specified component appropriately 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.
- Overrides:
-
paint
in classBasicTabbedPaneUI
- Parameters:
-
g
- theGraphics
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 - See Also:
ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)
paintHighlightBelowTab
protected void paintHighlightBelowTab()
paintFocusIndicator
protected void paintFocusIndicator(Graphics g, int tabPlacement, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect, boolean isSelected)
- Overrides:
-
paintFocusIndicator
in classBasicTabbedPaneUI
paintContentBorderTopEdge
protected void paintContentBorderTopEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
- Overrides:
-
paintContentBorderTopEdge
in classBasicTabbedPaneUI
paintContentBorderBottomEdge
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
- Overrides:
-
paintContentBorderBottomEdge
in classBasicTabbedPaneUI
paintContentBorderLeftEdge
protected void paintContentBorderLeftEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
- Overrides:
-
paintContentBorderLeftEdge
in classBasicTabbedPaneUI
paintContentBorderRightEdge
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
- Overrides:
-
paintContentBorderRightEdge
in classBasicTabbedPaneUI
calculateMaxTabHeight
protected int calculateMaxTabHeight(int tabPlacement)
- Overrides:
-
calculateMaxTabHeight
in classBasicTabbedPaneUI
getTabRunOverlay
protected int getTabRunOverlay(int tabPlacement)
- Overrides:
-
getTabRunOverlay
in classBasicTabbedPaneUI
shouldRotateTabRuns
protected boolean shouldRotateTabRuns(int tabPlacement, int selectedRun)
shouldPadTabRun
protected boolean shouldPadTabRun(int tabPlacement, int run)
- Overrides:
-
shouldPadTabRun
in classBasicTabbedPaneUI
© 1993, 2020, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/javase/8/docs/api/javax/swing/plaf/metal/MetalTabbedPaneUI.html