public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
Modifier and Type | Class and Description |
---|---|
class |
BasicTabbedPaneUI.FocusHandler
这个类应该被视为一个“受保护的”内部类。
|
class |
BasicTabbedPaneUI.MouseHandler
这个类应该被视为一个“受保护的”内部类。
|
class |
BasicTabbedPaneUI.PropertyChangeHandler
这个类应该被视为一个“受保护的”内部类。
|
class |
BasicTabbedPaneUI.TabbedPaneLayout
这个类应该被视为一个“受保护的”内部类。
|
class |
BasicTabbedPaneUI.TabSelectionHandler
这个类应该被视为一个“受保护的”内部类。
|
Modifier and Type | Field and Description |
---|---|
protected Rectangle |
calcRect
一个用于一般布局计算的矩形,以避免在飞行中构造许多新的矩形。
|
protected Insets |
contentBorderInsets |
protected Color |
darkShadow |
protected KeyStroke |
downKey
过时的。
作为java 2平台V1.3。
|
protected Color |
focus |
protected FocusListener |
focusListener |
protected Color |
highlight |
protected KeyStroke |
leftKey
过时的。
作为java 2平台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平台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平台V1.3。
|
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 |
---|
BasicTabbedPaneUI() |
Modifier and Type | Method and Description |
---|---|
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)
返回通过组件的坐标空间的指定标签的范围。
|
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)为指定的标签或空如果没有专门的文本呈现的是这个标签所需要的。
|
protected Component |
getVisibleComponent() |
protected void |
installComponents()
创建并安装所需的任何部分的通过。
|
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)
返回选项卡索引相交在通过指定点的坐标空间。
|
protected void |
uninstallComponents()
删除任何已安装的组件从通过。
|
protected void |
uninstallDefaults() |
protected void |
uninstallKeyboardActions() |
protected void |
uninstallListeners() |
void |
uninstallUI(JComponent c)
逆转形态,完成指定的组件在
installUI 。
|
contains, getAccessibleChild, getAccessibleChildrenCount, getPreferredSize, update
protected JTabbedPane tabPane
protected Color highlight
protected Color lightHighlight
protected Color shadow
protected Color darkShadow
protected Color focus
protected int textIconGap
protected int tabRunOverlay
protected Insets tabInsets
protected Insets selectedTabPadInsets
protected Insets tabAreaInsets
protected Insets contentBorderInsets
@Deprecated protected KeyStroke upKey
@Deprecated protected KeyStroke downKey
@Deprecated protected KeyStroke leftKey
@Deprecated protected KeyStroke rightKey
protected int[] tabRuns
protected int runCount
protected int selectedRun
protected Rectangle[] rects
protected int maxTabHeight
protected int maxTabWidth
protected ChangeListener tabChangeListener
protected PropertyChangeListener propertyChangeListener
protected MouseListener mouseListener
protected FocusListener focusListener
protected transient Rectangle calcRect
public static ComponentUI createUI(JComponent c)
public void installUI(JComponent c)
ComponentUI
ComponentUI
实例被安装在指定组件的UI代理。这种方法应该完全配置的组件外观和感觉,包括以下内容:
LayoutManager
组件上的必要。PropertyChangeListener
变化适当。installUI
方法重写,继承类
ComponentUI
c
-组件,UI代理被安装
ComponentUI.uninstallUI(javax.swing.JComponent)
,
JComponent.setUI(javax.swing.plaf.ComponentUI)
,
JComponent.updateUI()
public void uninstallUI(JComponent c)
ComponentUI
installUI
。这个方法被调用时,这个
UIComponent
实例被作为指定组件的UI代理删除。这种方法应该撤消配置进行
installUI
,小心留下的
JComponent
实例在干净的状态(没有多余的听众,外观和感觉的特定属性的对象,等)。这应包括以下几个方面:
uninstallUI
方法重写,继承类
ComponentUI
c
-从这个UI代理被删除的组件;这种说法常常被忽视,但可能如果UI对象是无状态的,共享由多个组件
ComponentUI.installUI(javax.swing.JComponent)
,
JComponent.updateUI()
protected LayoutManager createLayoutManager()
installUI
创建布局管理器对象来管理
JTabbedPane
。
BasicTabbedPaneUI.TabbedPaneLayout
,
JTabbedPane.getTabLayoutPolicy()
protected void installComponents()
protected JButton createScrollButton(int direction)
direction
之一-- swingconstants常数:南、北、东或西
IllegalArgumentException
如果方向不一的北,南,东或西
JTabbedPane.setTabPlacement(int)
,
SwingConstants
protected void uninstallComponents()
protected void installDefaults()
protected void uninstallDefaults()
protected void installListeners()
protected void uninstallListeners()
protected MouseListener createMouseListener()
protected FocusListener createFocusListener()
protected ChangeListener createChangeListener()
protected PropertyChangeListener createPropertyChangeListener()
protected void installKeyboardActions()
protected void uninstallKeyboardActions()
protected void setRolloverTab(int index)
index
。
index
将1如果鼠标不再在任何标签。没有做检查,以确保在索引中传递的标识一个有效的标签。
index
-标签鼠标超过指数。
protected int getRolloverTab()
-1
如果鼠标不再在任何标签。
-1
如果鼠标不再在任何标签
public Dimension getMinimumSize(JComponent c)
ComponentUI
null
返回,最小尺寸将由组件的布局管理器的计算(这是与一个特定的布局管理器安装任何组件的首选方法)。此方法的默认实现调用
getPreferredSize
和返回值。
getMinimumSize
方法重写,继承类
ComponentUI
c
最小尺寸的是被查询的成分;这种说法常常被忽视,但可能如果UI对象是无状态的,共享由多个组件
Dimension
对象或
null
JComponent.getMinimumSize()
,
LayoutManager.minimumLayoutSize(java.awt.Container)
,
ComponentUI.getPreferredSize(javax.swing.JComponent)
public Dimension getMaximumSize(JComponent c)
ComponentUI
null
返回,最大规模将由组件的布局管理器的计算(这是与一个特定的布局管理器安装任何组件的首选方法)。此方法的默认实现调用
getPreferredSize
和返回值。
getMaximumSize
方法重写,继承类
ComponentUI
c
-其最大尺寸被查询的成分;这种说法常常被忽视,但可能如果UI对象是无状态的,共享由多个组件
Dimension
对象或
null
JComponent.getMaximumSize()
,
LayoutManager2.maximumLayoutSize(java.awt.Container)
public int getBaseline(JComponent c, int width, int height)
getBaseline
方法重写,继承类
ComponentUI
c
-
JComponent
基线被要求
width
的宽度得到基线
height
-高度得到基线
null
c
NullPointerException
IllegalArgumentException
如果宽度或高度小于0
JComponent.getBaseline(int, int)
public Component.BaselineResizeBehavior getBaselineResizeBehavior(JComponent c)
getBaselineResizeBehavior
方法重写,继承类
ComponentUI
c
-
JComponent
返回基线调整行为
null
c
NullPointerException
JComponent.getBaseline(int, int)
protected int getBaseline(int tab)
tab
索引标签获得基线
IndexOutOfBoundsException
如果索引超出范围(指数<0 | |指数> =标签计数)
protected int getBaselineOffset()
getTabLabelShiftY
相同。
public void paint(Graphics g, JComponent c)
ComponentUI
ComponentUI.update
方法调用时指定的组件正在粉刷。子类应重写此方法,并使用指定的
Graphics
对象呈现的成分含量。
paint
方法重写,继承类
ComponentUI
g
-其中
Graphics
背景画
c
-正在绘制的构件;这种说法常常被忽视,但可能如果UI对象是无状态的,共享由多个组件
ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)
protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex)
Graphics
对象。标签的位置可以是:
JTabbedPane.TOP
,
JTabbedPane.BOTTOM
,
JTabbedPane.LEFT
,或
JTabbedPane.RIGHT
。选定的指标必须是一个有效的选项卡式窗格选项卡索引(0标签计数1,含)或1如果没有标签是当前选择。无效参数的处理是未指定的。
g
-用于渲染的图形对象
tabPlacement
在通过对标签的位置
selectedIndex
-选定的组件”选项卡索引
protected void paintTab(Graphics g, int tabPlacement, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect)
protected void layoutLabel(int tabPlacement, FontMetrics metrics, int tabIndex, String title, Icon icon, Rectangle tabRect, Rectangle iconRect, Rectangle textRect, boolean isSelected)
protected void paintIcon(Graphics g, int tabPlacement, int tabIndex, Icon icon, Rectangle iconRect, boolean isSelected)
protected void paintText(Graphics g, int tabPlacement, Font font, FontMetrics metrics, int tabIndex, String title, Rectangle textRect, boolean isSelected)
protected int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected)
protected int getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected)
protected void paintFocusIndicator(Graphics g, int tabPlacement, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect, boolean isSelected)
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
protected void paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
protected void paintContentBorder(Graphics g, int tabPlacement, int selectedIndex)
protected void paintContentBorderTopEdge(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 paintContentBorderBottomEdge(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)
public Rectangle getTabBounds(JTabbedPane pane, int i)
getTabBounds
方法重写,继承类
TabbedPaneUI
public int getTabRunCount(JTabbedPane pane)
getTabRunCount
方法重写,继承类
TabbedPaneUI
public int tabForCoordinate(JTabbedPane pane, int x, int y)
tabForCoordinate
方法重写,继承类
TabbedPaneUI
protected Rectangle getTabBounds(int tabIndex, Rectangle dest)
Rectangle
实例。无效参数的处理是未指定的。
tabIndex
-标签索引
dest
的矩形,结果应放
protected Component getVisibleComponent()
protected void setVisibleComponent(Component component)
protected void assureRectsCreated(int tabCount)
protected void expandTabRunsArray()
protected int getRunForTab(int tabCount, int tabIndex)
protected int lastTabInRun(int tabCount, int run)
protected int getTabRunOverlay(int tabPlacement)
protected int getTabRunIndent(int tabPlacement, int run)
protected boolean shouldPadTabRun(int tabPlacement, int run)
protected boolean shouldRotateTabRuns(int tabPlacement)
protected Icon getIconForTab(int tabIndex)
protected View getTextViewForTab(int tabIndex)
tabIndex
-标签索引
protected int calculateTabHeight(int tabPlacement, int tabIndex, int fontHeight)
protected int calculateMaxTabHeight(int tabPlacement)
protected int calculateTabWidth(int tabPlacement, int tabIndex, FontMetrics metrics)
protected int calculateMaxTabWidth(int tabPlacement)
protected int calculateTabAreaHeight(int tabPlacement, int horizRunCount, int maxTabHeight)
protected int calculateTabAreaWidth(int tabPlacement, int vertRunCount, int maxTabWidth)
protected Insets getTabInsets(int tabPlacement, int tabIndex)
protected Insets getSelectedTabPadInsets(int tabPlacement)
protected Insets getTabAreaInsets(int tabPlacement)
protected Insets getContentBorderInsets(int tabPlacement)
protected FontMetrics getFontMetrics()
protected void navigateSelectedTab(int direction)
protected void selectNextTabInRun(int current)
protected void selectPreviousTabInRun(int current)
protected void selectNextTab(int current)
protected void selectPreviousTab(int current)
protected void selectAdjacentRunTab(int tabPlacement, int tabIndex, int offset)
protected int getFocusIndex()
protected int getTabRunOffset(int tabPlacement, int tabCount, int tabIndex, boolean forward)
protected int getPreviousTabIndex(int base)
protected int getNextTabIndex(int base)
protected int getNextTabIndexInRun(int tabCount, int base)
protected int getPreviousTabIndexInRun(int tabCount, int base)
protected int getPreviousTabRun(int baseRun)
protected int getNextTabRun(int baseRun)
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.