public class MetalTabbedPaneUI extends BasicTabbedPaneUI
警告:序列化该类的对象与以后的Swing版本不兼容。当前的序列化支持适用于短期贮藏或RMI运行相同Swing版本的应用程序之间。为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()
installDefaults
方法重写,继承类
BasicTabbedPaneUI
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
BasicTabbedPaneUI
paintTabBorder
方法重写,继承类
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
,然后立即打电话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)
paintTabBackground
方法重写,继承类
BasicTabbedPaneUI
protected int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected)
getTabLabelShiftX
方法重写,继承类
BasicTabbedPaneUI
protected int getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected)
getTabLabelShiftY
方法重写,继承类
BasicTabbedPaneUI
protected int getBaselineOffset()
getTabLabelShiftY
相同。
getBaselineOffset
方法重写,继承类
BasicTabbedPaneUI
public void paint(Graphics g, JComponent c)
ComponentUI
ComponentUI.update
方法调用时指定的组件正在粉刷。子类应重写此方法,并使用指定的
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)
paintFocusIndicator
方法重写,继承类
BasicTabbedPaneUI
protected void paintContentBorderTopEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
paintContentBorderTopEdge
方法重写,继承类
BasicTabbedPaneUI
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
paintContentBorderBottomEdge
方法重写,继承类
BasicTabbedPaneUI
protected void paintContentBorderLeftEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
paintContentBorderLeftEdge
方法重写,继承类
BasicTabbedPaneUI
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
paintContentBorderRightEdge
方法重写,继承类
BasicTabbedPaneUI
protected int calculateMaxTabHeight(int tabPlacement)
calculateMaxTabHeight
方法重写,继承类
BasicTabbedPaneUI
protected int getTabRunOverlay(int tabPlacement)
getTabRunOverlay
方法重写,继承类
BasicTabbedPaneUI
protected boolean shouldRotateTabRuns(int tabPlacement, int selectedRun)
protected boolean shouldPadTabRun(int tabPlacement, int run)
shouldPadTabRun
方法重写,继承类
BasicTabbedPaneUI
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.