java.lang.Object javax.swing.plaf.ComponentUI javax.swing.plaf.TabbedPaneUI javax.swing.plaf.basic.BasicTabbedPaneUI javax.swing.plaf.metal.MetalTabbedPaneUI
public class MetalTabbedPaneUI
BasicTabbedPaneUI 的 Metal 子类。
警告:此类的已序列化对象与以后的 Swing 版本不兼容。当前序列化支持适用于短期存储或运行相同 Swing 版本的应用程序之间的 RMI。从 1.4 版本开始,已在 java.beans
包中添加了支持所有 JavaBeansTM 长期存储的功能。请参见 XMLEncoder
。
嵌套类摘要 | |
---|---|
class |
MetalTabbedPaneUI.TabbedPaneLayout 此内部类由于编译器故障而被标记为 "public"。 |
从类 javax.swing.plaf.basic.BasicTabbedPaneUI 继承的嵌套类/接口 |
---|
BasicTabbedPaneUI.FocusHandler, BasicTabbedPaneUI.MouseHandler, BasicTabbedPaneUI.PropertyChangeHandler, BasicTabbedPaneUI.TabSelectionHandler |
字段摘要 | |
---|---|
protected int |
minTabWidth |
protected Color |
selectColor |
protected Color |
selectHighlight |
protected Color |
tabAreaBackground |
从类 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 |
从接口 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 |
构造方法摘要 | |
---|---|
MetalTabbedPaneUI() |
方法摘要 | |
---|---|
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 委托开始绘制指定的组件。 |
从类 javax.swing.plaf.ComponentUI 继承的方法 |
---|
contains, getAccessibleChild, getAccessibleChildrenCount, getPreferredSize |
从类 java.lang.Object 继承的方法 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
字段详细信息 |
---|
protected int minTabWidth
protected Color tabAreaBackground
protected Color selectColor
protected Color selectHighlight
构造方法详细信息 |
---|
public MetalTabbedPaneUI()
方法详细信息 |
---|
public static ComponentUI createUI(JComponent x)
protected LayoutManager createLayoutManager()
BasicTabbedPaneUI
复制的描述
installUI
调用,用于创建布局管理器对象以管理
JTabbedPane
。
BasicTabbedPaneUI
中的
createLayoutManager
BasicTabbedPaneUI.TabbedPaneLayout
,
JTabbedPane.getTabLayoutPolicy()
protected void installDefaults()
BasicTabbedPaneUI
中的
installDefaults
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
BasicTabbedPaneUI
复制的描述
BasicTabbedPaneUI
中的
paintTabBorder
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
),然后立刻调用
paint
。通常无需由子类重写此方法;所有呈现代码的外观都应位于
paint
方法中。
ComponentUI
中的
update
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)
BasicTabbedPaneUI
中的
paintTabBackground
protected int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected)
BasicTabbedPaneUI
中的
getTabLabelShiftX
protected int getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected)
BasicTabbedPaneUI
中的
getTabLabelShiftY
protected int getBaselineOffset()
getTabLabelShiftY
相同。
BasicTabbedPaneUI
中的
getBaselineOffset
public void paint(Graphics g, JComponent c)
ComponentUI
复制的描述
ComponentUI.update
方法中调用此方法。子类应该重写此方法并使用指定
Graphics
对象来呈现组件的内容。
BasicTabbedPaneUI
中的
paint
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)
BasicTabbedPaneUI
中的
paintFocusIndicator
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)
BasicTabbedPaneUI
中的
calculateMaxTabHeight
protected int getTabRunOverlay(int tabPlacement)
BasicTabbedPaneUI
中的
getTabRunOverlay
protected boolean shouldRotateTabRuns(int tabPlacement, int selectedRun)
protected boolean shouldPadTabRun(int tabPlacement, int run)
BasicTabbedPaneUI
中的
shouldPadTabRun