©
本文档使用
php.cn手册 发布
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
1 2 3 4 |
|
1 |
|
TabbedPaneUI 的基本 L&F 实现。
嵌套类摘要 | |
---|---|
class |
BasicTabbedPaneUI.FocusHandler
此类应视为“受保护”内部类。 |
class |
BasicTabbedPaneUI.MouseHandler
此类应视为“受保护”内部类。 |
class |
BasicTabbedPaneUI.PropertyChangeHandler
此类应视为“受保护”内部类。 |
class |
BasicTabbedPaneUI.TabbedPaneLayout
此类应视为“受保护”内部类。 |
class |
BasicTabbedPaneUI.TabSelectionHandler
此类应视为“受保护”内部类。 |
字段摘要 | |
---|---|
protected Rectangle |
calcRect
用于通用布局计算以避免运行中构造多个新 Rectangle 的矩形。 |
protected Insets |
contentBorderInsets
|
protected Color |
darkShadow
|
protected KeyStroke |
downKey
已过时。 从 Java 2 platform v1.3 开始。 |
protected Color |
focus
|
protected FocusListener |
focusListener
|
protected Color |
highlight
|
protected KeyStroke |
leftKey
已过时。 从 Java 2 platform v1.3 开始。 |
protected Color |
lightHighlight
|
protected int |
maxTabHeight
|
protected int |
maxTabWidth
|
protected MouseListener |
mouseListener
|
protected PropertyChangeListener |
propertyChangeListener
|
protected Rectangle[] |
rects
|
protected KeyStroke |
rightKey
已过时。 从 Java 2 platform v1.3 开始。 |
protected int |
runCount
|
protected int |
selectedRun
|
protected Insets |
selectedTabPadInsets
|
protected Color |
shadow
|
protected Insets |
tabAreaInsets
|
protected ChangeListener |
tabChangeListener
|
protected Insets |
tabInsets
|
protected JTabbedPane |
tabPane
|
protected int |
tabRunOverlay
|
protected int[] |
tabRuns
|
protected int |
textIconGap
|
protected KeyStroke |
upKey
已过时。 从 Java 2 platform v1.3 开始。 |
从接口 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 |
构造方法摘要 | |
---|---|
BasicTabbedPaneUI()
|
方法摘要 | |
---|---|
protected void |
assureRectsCreated(int tabCount)
|
protected int |
calculateMaxTabHeight(int tabPlacement)
|
protected int |
calculateMaxTabWidth(int tabPlacement)
|
protected int |
calculateTabAreaHeight(int tabPlacement,
int horizRunCount,
int maxTabHeight)
|
protected int |
calculateTabAreaWidth(int tabPlacement,
int vertRunCount,
int maxTabWidth)
|
protected int |
calculateTabHeight(int tabPlacement,
int tabIndex,
int fontHeight)
|
protected int |
calculateTabWidth(int tabPlacement,
int tabIndex,
FontMetrics metrics)
|
protected ChangeListener |
createChangeListener()
|
protected FocusListener |
createFocusListener()
|
protected LayoutManager |
createLayoutManager()
由 installUI 调用,用于创建布局管理器对象以管理 JTabbedPane 。 |
protected MouseListener |
createMouseListener()
|
protected PropertyChangeListener |
createPropertyChangeListener()
|
protected JButton |
createScrollButton(int direction)
创建并返回一个 JButton,它将为用户提供朝某一特定方向滚动选项卡的方式。 |
static ComponentUI |
createUI(JComponent c)
|
protected void |
expandTabRunsArray()
|
protected int |
getBaseline(int tab)
返回指定选项卡的基线。 |
int |
getBaseline(JComponent c,
int width,
int height)
返回基线。 |
protected int |
getBaselineOffset()
返回基线偏移的距离。 |
Component.BaselineResizeBehavior |
getBaselineResizeBehavior(JComponent c)
返回一个枚举,它指示该组件的基线如何随大小的改变而发生更改。 |
protected Insets |
getContentBorderInsets(int tabPlacement)
|
protected int |
getFocusIndex()
返回具有焦点的选项卡的索引。 |
protected FontMetrics |
getFontMetrics()
|
protected Icon |
getIconForTab(int tabIndex)
|
Dimension |
getMaximumSize(JComponent c)
返回指定组件的适合外观的最大大小。 |
Dimension |
getMinimumSize(JComponent c)
返回指定组件的适合外观的最小大小。 |
protected int |
getNextTabIndex(int base)
|
protected int |
getNextTabIndexInRun(int tabCount,
int base)
|
protected int |
getNextTabRun(int baseRun)
|
protected int |
getPreviousTabIndex(int base)
|
protected int |
getPreviousTabIndexInRun(int tabCount,
int base)
|
protected int |
getPreviousTabRun(int baseRun)
|
protected int |
getRolloverTab()
返回当前有鼠标位于其上方的选项卡;如果鼠标不再位于任何选项卡上,则返回 -1 。 |
protected int |
getRunForTab(int tabCount,
int tabIndex)
|
protected Insets |
getSelectedTabPadInsets(int tabPlacement)
|
protected Insets |
getTabAreaInsets(int tabPlacement)
|
protected Rectangle |
getTabBounds(int tabIndex,
Rectangle dest)
返回 JTabbedPane 组件的坐标空间中指定选项卡的边界。 |
Rectangle |
getTabBounds(JTabbedPane pane,
int i)
返回指定选项卡索引的边界。 |
protected Insets |
getTabInsets(int tabPlacement,
int tabIndex)
|
protected int |
getTabLabelShiftX(int tabPlacement,
int tabIndex,
boolean isSelected)
|
protected int |
getTabLabelShiftY(int tabPlacement,
int tabIndex,
boolean isSelected)
|
int |
getTabRunCount(JTabbedPane pane)
|
protected int |
getTabRunIndent(int tabPlacement,
int run)
|
protected int |
getTabRunOffset(int tabPlacement,
int tabCount,
int tabIndex,
boolean forward)
|
protected int |
getTabRunOverlay(int tabPlacement)
|
protected View |
getTextViewForTab(int tabIndex)
返回为指定选项卡呈现样式化文本 (HTML) 所需的文本 View 对象;如果此选项卡不需要任何特殊化的文本呈现,则返回 null。 |
protected Component |
getVisibleComponent()
|
protected void |
installComponents()
创建并安装 JTabbedPane 的所有必需的子组件。 |
protected void |
installDefaults()
|
protected void |
installKeyboardActions()
|
protected void |
installListeners()
|
void |
installUI(JComponent c)
配置指定组件,使其适合外观。 |
protected int |
lastTabInRun(int tabCount,
int run)
|
protected void |
layoutLabel(int tabPlacement,
FontMetrics metrics,
int tabIndex,
String title,
Icon icon,
Rectangle tabRect,
Rectangle iconRect,
Rectangle textRect,
boolean isSelected)
|
protected void |
navigateSelectedTab(int direction)
|
void |
paint(Graphics g,
JComponent c)
绘制指定组件,使其适合外观。 |
protected void |
paintContentBorder(Graphics g,
int tabPlacement,
int selectedIndex)
|
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 |
paintIcon(Graphics g,
int tabPlacement,
int tabIndex,
Icon icon,
Rectangle iconRect,
boolean isSelected)
|
protected void |
paintTab(Graphics g,
int tabPlacement,
Rectangle[] rects,
int tabIndex,
Rectangle iconRect,
Rectangle textRect)
|
protected void |
paintTabArea(Graphics g,
int tabPlacement,
int selectedIndex)
在选项卡区域绘制选项卡。 |
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 |
paintText(Graphics g,
int tabPlacement,
Font font,
FontMetrics metrics,
int tabIndex,
String title,
Rectangle textRect,
boolean isSelected)
|
protected static void |
rotateInsets(Insets topInsets,
Insets targetInsets,
int targetPlacement)
|
protected void |
selectAdjacentRunTab(int tabPlacement,
int tabIndex,
int offset)
|
protected void |
selectNextTab(int current)
|
protected void |
selectNextTabInRun(int current)
|
protected void |
selectPreviousTab(int current)
|
protected void |
selectPreviousTabInRun(int current)
|
protected void |
setRolloverTab(int index)
将当前有鼠标位于其上方的选项卡设置为 index 。 |
protected void |
setVisibleComponent(Component component)
|
protected boolean |
shouldPadTabRun(int tabPlacement,
int run)
|
protected boolean |
shouldRotateTabRuns(int tabPlacement)
|
int |
tabForCoordinate(JTabbedPane pane,
int x,
int y)
返回与 JTabbedPane 的坐标空间中的指定点相交的选项卡索引。 |
protected void |
uninstallComponents()
从 JTabbedPane 移除所有已安装的子组件。 |
protected void |
uninstallDefaults()
|
protected void |
uninstallKeyboardActions()
|
protected void |
uninstallListeners()
|
void |
uninstallUI(JComponent c)
在 installUI 期间,在指定组件上反向执行的配置操作。 |
从类 javax.swing.plaf.ComponentUI 继承的方法 |
---|
contains, getAccessibleChild, getAccessibleChildrenCount, getPreferredSize, update |
从类 java.lang.Object 继承的方法 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
字段详细信息 |
---|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 2 |
|
1 2 |
|
1 2 |
|
1 2 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
构造方法详细信息 |
---|
1 |
|
方法详细信息 |
---|
1 |
|
1 |
|
ComponentUI
复制的描述ComponentUI
实例将作为 UI 委托安装在指定组件上时,可调用此方法。此方法应该为外观完整地配置组件,包括以下方面:
LayoutManager
。
PropertyChangeListener
。
ComponentUI
中的 installUI
c
- 将安装此 UI 委托的组件ComponentUI.uninstallUI(javax.swing.JComponent)
,
JComponent.setUI(javax.swing.plaf.ComponentUI)
,
JComponent.updateUI()
1 |
|
ComponentUI
复制的描述installUI
期间,在指定组件上反向执行的配置操作。当此 UIComponent
实例将作为 UI 委托从指定组件上移除时,可调用此方法。此方法应该取消在 installUI
中执行的配置操作,非常小心地使 JComponent
实例处于某种洁净状态(没有额外的侦听器、没有特定于外观的属性对象等等)。配置内容应该包括以下方面:
ComponentUI
中的 uninstallUI
c
- 从中移除此 UI 委托的组件;此参数常被忽略,但如果 UI 对象是无状态的并由多个组件共享,则可以使用该参数ComponentUI.installUI(javax.swing.JComponent)
,
JComponent.updateUI()
1 |
|
installUI
调用,用于创建布局管理器对象以管理 JTabbedPane
。
BasicTabbedPaneUI.TabbedPaneLayout
,
JTabbedPane.getTabLayoutPolicy()
1 |
|
1 |
|
direction
- SwingConstants 常量之一:SOUTH、NORTH、EAST 或 WEST
IllegalArgumentException
- 如果方向不为 NORTH、SOUTH、EAST 或 WEST 之一JTabbedPane.setTabPlacement(int)
,
SwingConstants
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
index
。如果鼠标不再位于任何选项卡上,则 index
将为 -1。没有执行任何检查来确保传入的索引标识有效的选项卡。
index
- 鼠标位于其上方的选项卡的索引。1 |
|
-1
。
-1
1 |
|
ComponentUI
复制的描述null
,则最小大小将由组件的布局管理器计算(对于安装了特定布局管理器的组件而言,这是首选方法)。此方法的默认实现调用 getPreferredSize
并返回该值。
ComponentUI
中的 getMinimumSize
c
- 将查询其最小大小的组件;此参数常被忽略,但如果 UI 对象是无状态的并由多个组件共享,则可以使用该参数
Dimension
对象或 null
JComponent.getMinimumSize()
,
LayoutManager.minimumLayoutSize(java.awt.Container)
,
ComponentUI.getPreferredSize(javax.swing.JComponent)
1 |
|
ComponentUI
复制的描述null
,则最大大小将由组件的布局管理器计算(对于安装了特定布局管理器的组件而言,这是首选方法)。此方法的默认实现调用 getPreferredSize
并返回该值。
ComponentUI
中的 getMaximumSize
c
- 将查询其最大大小的组件;此参数常被忽略,但如果 UI 对象是无状态的并由多个组件共享,则可以使用该参数
Dimension
对象或 null
JComponent.getMaximumSize()
,
LayoutManager2.maximumLayoutSize(java.awt.Container)
1 2 3 |
|
ComponentUI
中的 getBaseline
c
- 为其请求基线的 JComponent
width
- 为其获取基线的宽度height
- 为其获取基线的高度
NullPointerException
- 如果 c
为 null
IllegalArgumentException
- 如果宽度或高度 < 0JComponent.getBaseline(int, int)
1 |
|
ComponentUI
中的 getBaselineResizeBehavior
c
- 为其返回调整大小行为的 JComponent
NullPointerException
- 如果 c
为 null
JComponent.getBaseline(int, int)
1 |
|
tab
- 获取其基线的选项卡的索引
IndexOutOfBoundsException
- 如果索引超出范围(index = tab count)1 |
|
getTabLabelShiftY
相同。
1 2 |
|
ComponentUI
复制的描述ComponentUI.update
方法中调用此方法。子类应该重写此方法并使用指定 Graphics
对象来呈现组件的内容。
ComponentUI
中的 paint
g
- 将在其中进行绘制的 Graphics
上下文c
- 将绘制的组件;此参数常被忽略,但如果 UI 对象是无状态的并由多个组件共享,则可以使用该参数ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)
1 2 3 |
|
Graphics
对象。布局可以是以下几种之一:JTabbedPane.TOP
、JTabbedPane.BOTTOM
、JTabbedPane.LEFT
或 JTabbedPane.RIGHT
。选择的索引必须为有效的选项卡窗格选项卡索引(0 至选项卡数 - 1,包括两者);如果当前没有选项选项卡,则为 -1。无效参数的处理没有指定。
g
- 要用于呈现的图形对象tabPlacement
- JTabbedPane 中选项卡的位置selectedIndex
- 所选组件的选项卡索引1 2 3 4 5 6 |
|
1 2 3 4 5 6 7 8 9 |
|
1 2 3 4 5 6 |
|
1 2 3 4 5 6 7 8 |
|
1 2 3 |
|
1 2 3 |
|
1 2 3 4 5 6 7 |
|
1 2 3 4 5 6 7 8 |
|
1 2 3 4 5 6 7 8 |
|
1 2 3 |
|
1 2 3 4 5 6 7 |
|
1 2 3 4 5 6 7 |
|
1 2 3 4 5 6 7 |
|
1 2 3 4 5 6 7 |
|
1 2 |
|
TabbedPaneUI
中的 getTabBounds
1 |
|
TabbedPaneUI
中的 getTabRunCount
1 2 3 |
|
TabbedPaneUI
中的 tabForCoordinate
1 2 |
|
Rectangle
实例。无效参数的处理没有指定。
tabIndex
- 选项卡的索引dest
- 应将结果置于其中的矩形
1 |
|
1 |
|
1 |
|
1 |
|
1 2 |
|
1 2 |
|
1 |
|
1 2 |
|
1 2 |
|
1 |
|
1 |
|
1 |
|
tabIndex
- 选项卡的索引
1 2 3 |
|
1 |
|
1 2 3 |
|
1 |
|
1 2 3 |
|
1 2 3 |
|
1 2 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 2 3 |
|
1 |
|
1 2 3 4 |
|
1 |
|
1 |
|
1 2 |
|
1 2 |
|
1 |
|
1 |
|
1 2 3 |
|
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
版权所有 2004 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。