public class MetalTabbedPaneUI extends BasicTabbedPaneUI
警告:此类的序列化对象与将来的Swing版本不兼容。 当前的序列化支持适用于运行相同版本的Swing的应用程序之间的短期存储或RMI。 从1.4开始,对所有JavaBeans的长期存储的支持已经添加到java.beans
包中。 请参阅XMLEncoder
。
Modifier and Type | Class and Description |
---|---|
class |
MetalTabbedPaneUI.TabbedPaneLayout
这个类应该被视为一个“受保护”的内部类。
|
BasicTabbedPaneUI.FocusHandler, BasicTabbedPaneUI.MouseHandler, BasicTabbedPaneUI.PropertyChangeHandler, BasicTabbedPaneUI.TabSelectionHandler
Modifier and Type | Field and Description |
---|---|
protected int |
minTabWidth |
protected Color |
selectColor |
protected Color |
selectHighlight |
protected Color |
tabAreaBackground |
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
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
Constructor and Description |
---|
MetalTabbedPaneUI() |
Modifier and Type | Method and Description |
---|---|
protected int |
calculateMaxTabHeight(int tabPlacement) |
protected LayoutManager |
createLayoutManager()
调用
installUI 创建一个布局管理器对象来管理
JTabbedPane 。
|
static ComponentUI |
createUI(JComponent x) |
protected int |
getBaselineOffset()
返回基线偏移量。
|
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 int |
getTabRunOverlay(int tabPlacement) |
protected void |
installDefaults() |
void |
paint(Graphics g, JComponent c)
适当地涂抹指定的组件的外观和感觉。
|
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)
此函数绘制每个选项卡周围的边框,该函数现在绘制该选项卡的背景。
|
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)
通知这个UI委托是时候绘制指定的组件。
|
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
contains, getAccessibleChild, getAccessibleChildrenCount, getPreferredSize
protected int minTabWidth
protected Color tabAreaBackground
protected Color selectColor
protected Color selectHighlight
public static ComponentUI createUI(JComponent x)
protected LayoutManager createLayoutManager()
BasicTabbedPaneUI
installUI
创建一个布局管理器对象来管理
JTabbedPane
。
createLayoutManager
在
BasicTabbedPaneUI
类
BasicTabbedPaneUI.TabbedPaneLayout
, JTabbedPane.getTabLayoutPolicy()
protected void installDefaults()
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
BasicTabbedPaneUI
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 Color getColorForGap(int currentRun, int x, int y)
protected void paintLeftTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)
protected void paintBottomTabBorder(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)
public void update(Graphics g, JComponent c)
ComponentUI
JComponent
调用。
默认情况下,如果该方法的opaque
属性为true
,则该方法将使用其背景颜色opaque
指定的true
,然后立即调用paint
。 通常这个方法不需要被子类覆盖; 所有外观和渲染代码都应位于paint
方法中。
update
在
ComponentUI
g
- 要绘画的
Graphics
上下文
c
- 正在涂漆的部件;
这个参数经常被忽略,但如果UI对象是无状态的并且被多个组件共享,则可能会被使用
ComponentUI.paint(java.awt.Graphics, javax.swing.JComponent)
,
JComponent.paintComponent(java.awt.Graphics)
protected void paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
protected int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected)
protected int getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected)
protected int getBaselineOffset()
getTabLabelShiftY
。
getBaselineOffset
在
BasicTabbedPaneUI
类
public void paint(Graphics g, JComponent c)
ComponentUI
ComponentUI.update
指定组件正在被绘制时的方法。
子类应该覆盖此方法,并使用指定的Graphics
对象来呈现Graphics
的内容。
paint
在
BasicTabbedPaneUI
类
g
- 要绘画的
Graphics
上下文
c
- 正在涂漆的部件;
这个参数经常被忽略,但如果UI对象是无状态的并且被多个组件共享,则可能会被使用
ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)
protected void paintHighlightBelowTab()
protected void paintFocusIndicator(Graphics g, int tabPlacement, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect, boolean isSelected)
protected void paintContentBorderTopEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
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 int calculateMaxTabHeight(int tabPlacement)
protected int getTabRunOverlay(int tabPlacement)
protected boolean shouldRotateTabRuns(int tabPlacement, int selectedRun)
protected boolean shouldPadTabRun(int tabPlacement, int run)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.