java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.TabbedPaneUI
javax.swing.plaf.basic.BasicTabbedPaneUI
javax.swing.plaf.metal.MetalTabbedPaneUI
- 所有已实现的接口:
-
SwingConstants
BasicTabbedPaneUI的Metal子类。
警告: 该类的序列化对象将不兼容未来的Swing版本。当前的序列化支持适用于短期存储或在运行相同Swing版本的应用程序之间的RMI。从1.4开始,已将所有JavaBeans的长期存储支持添加到java.beans
包中。请参阅XMLEncoder
。
-
Nested Class Summary
Nested classes/interfaces declared in class javax.swing.plaf.basic.BasicTabbedPaneUI
BasicTabbedPaneUI.FocusHandler, BasicTabbedPaneUI.MouseHandler, BasicTabbedPaneUI.PropertyChangeHandler, BasicTabbedPaneUI.TabSelectionHandler
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
窗格的最小宽度。protected Color
选定窗格的颜色。protected Color
高亮颜色。protected Color
选项卡背景的颜色。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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ComponentUI
构造MetalTabbedPaneUI
。protected int
返回基线偏移量。protected Color
getColorForGap
(int currentRun, int x, int y) 返回间隙的颜色。protected int
getTabLabelShiftX
(int tabPlacement, int tabIndex, boolean isSelected) 覆盖以使Java L&F无效。protected int
getTabLabelShiftY
(int tabPlacement, int tabIndex, boolean isSelected) 覆盖以使Java L&F无效。protected void
paintBottomTabBorder
(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected) 绘制底部选项卡边框。protected void
绘制选项卡下方的高亮。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
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) 如果应填充间隙,则返回true
。protected boolean
shouldRotateTabRuns
(int tabPlacement, int selectedRun) 如果选项卡运行应旋转,则返回true
。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, getTabRunCount, 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.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSize, installUI, paint, uninstallUI, update
-
Field Details
-
minTabWidth
protected int minTabWidth窗格的最小宽度。 -
tabAreaBackground
选项卡背景的颜色。 -
selectColor
选定窗格的颜色。 -
selectHighlight
高亮颜色。
-
-
Constructor Details
-
MetalTabbedPaneUI
public MetalTabbedPaneUI()构造一个MetalTabbedPaneUI
。
-
-
Method Details
-
createUI
构造MetalTabbedPaneUI
。- 参数:
-
x
- 一个组件 - 返回:
-
MetalTabbedPaneUI
的一个实例
-
paintTopTabBorder
protected void paintTopTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected) 绘制顶部选项卡边框。- 参数:
-
tabIndex
- 一个选项卡索引 -
g
-Graphics
的一个实例 -
x
- 一个X坐标 -
y
- 一个Y坐标 -
w
- 一个宽度 -
h
- 一个高度 -
btm
- 底部 -
rght
- 右侧 -
isSelected
- 选择状态
-
shouldFillGap
protected boolean shouldFillGap(int currentRun, int tabIndex, int x, int y) 如果应填充间隙,则返回true
。- 参数:
-
currentRun
- 当前运行 -
tabIndex
- 选项卡索引 -
x
- 一个X坐标 -
y
- 一个Y坐标 - 返回:
-
如果应填充间隙,则返回
true
-
getColorForGap
返回间隙的颜色。- 参数:
-
currentRun
- 当前运行 -
x
- 一个X坐标 -
y
- 一个Y坐标 - 返回:
- 间隙的颜色
-
paintLeftTabBorder
protected void paintLeftTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected) 绘制左侧选项卡边框。- 参数:
-
tabIndex
- 一个选项卡索引 -
g
-Graphics
的一个实例 -
x
- 一个X坐标 -
y
- 一个Y坐标 -
w
- 一个宽度 -
h
- 一个高度 -
btm
- 底部 -
rght
- 右侧 -
isSelected
- 选择状态
-
paintBottomTabBorder
protected void paintBottomTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected) 绘制底部选项卡边框。- 参数:
-
tabIndex
- 一个选项卡索引 -
g
-Graphics
的一个实例 -
x
- 一个X坐标 -
y
- 一个Y坐标 -
w
- 一个宽度 -
h
- 一个高度 -
btm
- 底部 -
rght
- 右侧 -
isSelected
- 选择状态
-
paintRightTabBorder
protected void paintRightTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected) 绘制右侧选项卡边框。- 参数:
-
tabIndex
- 一个选项卡索引 -
g
-Graphics
的一个实例 -
x
- 一个X坐标 -
y
- 一个Y坐标 -
w
- 一个宽度 -
h
- 一个高度 -
btm
- 底部 -
rght
- 右侧 -
isSelected
- 选择状态
-
getTabLabelShiftX
protected int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected) 覆盖以使Java L&F无效。- 覆盖:
-
getTabLabelShiftX
在类BasicTabbedPaneUI
中 - 参数:
-
tabPlacement
- 选项卡位置 -
tabIndex
- 选项卡索引 -
isSelected
- 选择状态 - 返回:
- 选项卡标签偏移量x
-
getTabLabelShiftY
protected int getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected) 覆盖以使Java L&F无效。- 覆盖:
-
getTabLabelShiftY
在类BasicTabbedPaneUI
中 - 参数:
-
tabPlacement
- 选项卡位置 -
tabIndex
- 选项卡索引 -
isSelected
- 选择状态 - 返回:
- 选项卡标签偏移量y
-
getBaselineOffset
protected int getBaselineOffset()返回基线偏移量。通常与getTabLabelShiftY
相同。- 覆盖:
-
getBaselineOffset
在类BasicTabbedPaneUI
中 - 返回:
- 基线偏移量
- 自1.6起:
- 1.6
-
paintHighlightBelowTab
protected void paintHighlightBelowTab()绘制选项卡下方的高亮。 -
shouldRotateTabRuns
protected boolean shouldRotateTabRuns(int tabPlacement, int selectedRun) 如果选项卡运行应旋转,则返回true
。- 参数:
-
tabPlacement
- 选项卡位置 -
selectedRun
- 选定的运行 - 返回:
-
如果选项卡运行应旋转,则返回
true
。
-