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 | Description |
---|---|---|
class | MetalTabbedPaneUI.TabbedPaneLayout | This class should be treated as a "protected" inner class. |
Nested classes/interfaces declared in class javax.swing.plaf.basic.BasicTabbedPaneUI
BasicTabbedPaneUI.FocusHandler, BasicTabbedPaneUI.MouseHandler, BasicTabbedPaneUI.PropertyChangeHandler, BasicTabbedPaneUI.TabSelectionHandler
Fields
Modifier and Type | Field | Description |
---|---|---|
protected int | minTabWidth | The minimum width of a pane. |
protected Color | selectColor | The color of the selected pane. |
protected Color | selectHighlight | The color of the highlight. |
protected Color | tabAreaBackground | The color of tab's background. |
Fields declared in 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 declared in 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 | Description |
---|---|
MetalTabbedPaneUI() |
Methods
Modifier and Type | Method | Description |
---|---|---|
static ComponentUI | createUI(JComponent x) | Constructs |
protected int | getBaselineOffset() | Returns the amount the baseline is offset by. |
protected Color | getColorForGap(int currentRun,
int x,
int y) | Returns the color of the gap. |
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 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. |
protected void | paintHighlightBelowTab() | Paints highlights below tab. |
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. |
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. |
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. |
protected boolean | shouldFillGap(int currentRun,
int tabIndex,
int x,
int y) | Returns |
protected boolean | shouldRotateTabRuns(int tabPlacement,
int selectedRun) | Returns |
Methods declared in class javax.swing.plaf.basic.BasicTabbedPaneUI
assureRectsCreated, calculateMaxTabHeight, calculateMaxTabWidth, calculateTabAreaHeight, calculateTabAreaWidth, calculateTabHeight, calculateTabWidth, createChangeListener, createFocusListener, createLayoutManager, createMouseListener, createPropertyChangeListener, createScrollButton, expandTabRunsArray, getBaseline, getBaseline, getBaselineResizeBehavior, getContentBorderInsets, getFocusIndex, getFontMetrics, getIconForTab, getNextTabIndex, getNextTabIndexInRun, getNextTabRun, getPreviousTabIndex, getPreviousTabIndexInRun, getPreviousTabRun, getRolloverTab, getRunForTab, getSelectedTabPadInsets, getTabAreaInsets, getTabBounds, getTabBounds, getTabInsets, getTabRunIndent, getTabRunOffset, getTabRunOverlay, getTextViewForTab, getVisibleComponent, installComponents, installDefaults, installKeyboardActions, installListeners, lastTabInRun, layoutLabel, navigateSelectedTab, paintContentBorder, paintContentBorderBottomEdge, paintContentBorderLeftEdge, paintContentBorderRightEdge, paintContentBorderTopEdge, paintFocusIndicator, paintIcon, paintTab, paintTabArea, paintTabBackground, paintTabBorder, paintText, rotateInsets, selectAdjacentRunTab, selectNextTab, selectNextTabInRun, selectPreviousTab, selectPreviousTabInRun, setRolloverTab, setVisibleComponent, shouldPadTabRun, shouldRotateTabRuns, tabForCoordinate, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners
Methods declared in class javax.swing.plaf.TabbedPaneUI
getTabRunCount
Methods declared in class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSize, installUI, paint, uninstallUI, update
Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Fields
minTabWidth
protected int minTabWidth
The minimum width of a pane.
tabAreaBackground
protected Color tabAreaBackground
The color of tab's background.
selectColor
protected Color selectColor
The color of the selected pane.
selectHighlight
protected Color selectHighlight
The color of the highlight.
Constructors
MetalTabbedPaneUI
public MetalTabbedPaneUI()
Methods
createUI
public static ComponentUI createUI(JComponent x)
Constructs MetalTabbedPaneUI
.
- Parameters:
-
x
- a component - Returns:
- an instance of
MetalTabbedPaneUI
paintTopTabBorder
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 ofGraphics
-
x
- an X coordinate -
y
- an Y coordinate -
w
- a width -
h
- a height -
btm
- bottom -
rght
- right -
isSelected
- a selection
shouldFillGap
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
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
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 ofGraphics
-
x
- an X coordinate -
y
- an Y coordinate -
w
- a width -
h
- a height -
btm
- bottom -
rght
- right -
isSelected
- a selection
paintBottomTabBorder
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 ofGraphics
-
x
- an X coordinate -
y
- an Y coordinate -
w
- a width -
h
- a height -
btm
- bottom -
rght
- right -
isSelected
- a selection
paintRightTabBorder
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 ofGraphics
-
x
- an X coordinate -
y
- an Y coordinate -
w
- a width -
h
- a height -
btm
- bottom -
rght
- right -
isSelected
- a selection
getTabLabelShiftX
protected int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected)
Overridden to do nothing for the Java L&F.
- Overrides:
-
getTabLabelShiftX
in classBasicTabbedPaneUI
- Parameters:
-
tabPlacement
- the tab placement -
tabIndex
- the tab index -
isSelected
- selection status - Returns:
- the tab label shift x
getTabLabelShiftY
protected int getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected)
Overridden to do nothing for the Java L&F.
- Overrides:
-
getTabLabelShiftY
in classBasicTabbedPaneUI
- Parameters:
-
tabPlacement
- the tab placement -
tabIndex
- the tab index -
isSelected
- selection status - Returns:
- the tab label shift y
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
paintHighlightBelowTab
protected void paintHighlightBelowTab()
Paints highlights below tab.
shouldRotateTabRuns
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.
© 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/en/java/javase/11/docs/api/java.desktop/javax/swing/plaf/metal/MetalTabbedPaneUI.html