模块  java.desktop

Class BasicTabbedPaneUI

    • 字段详细信息

      • tabPane

        protected JTabbedPane tabPane
        选项卡窗格
      • highlight

        protected Color highlight
        突出显示颜色
      • lightHighlight

        protected Color lightHighlight
        浅色突出颜色
      • shadow

        protected Color shadow
        阴影颜色
      • darkShadow

        protected Color darkShadow
        暗影色
      • focus

        protected Color focus
        聚焦色彩
      • textIconGap

        protected int textIconGap
        文本图标差距
      • tabRunOverlay

        protected int tabRunOverlay
        标签运行叠加
      • tabInsets

        protected Insets tabInsets
        制表符插入
      • selectedTabPadInsets

        protected Insets selectedTabPadInsets
        选定的选项卡插入
      • tabAreaInsets

        protected Insets tabAreaInsets
        标签区域插入
      • contentBorderInsets

        protected Insets contentBorderInsets
        内容边框插入
      • upKey

        @Deprecated
        protected KeyStroke upKey
        Deprecated.
        As of Java 2 platform v1.3.
        从Java 2平台v1.3开始,不再使用此前未记录的字段。 键绑定现在由LookAndFeel定义,请参阅键绑定规范以获取更多详细信息。
      • downKey

        @Deprecated
        protected KeyStroke downKey
        Deprecated.
        As of Java 2 platform v1.3.
        从Java 2平台v1.3开始,不再使用此前未记录的字段。 键绑定现在由LookAndFeel定义,请参阅键绑定规范以获取更多详细信息。
      • leftKey

        @Deprecated
        protected KeyStroke leftKey
        Deprecated.
        As of Java 2 platform v1.3.
        从Java 2平台v1.3开始,不再使用此前未记录的字段。 键绑定现在由LookAndFeel定义,请参阅键绑定规范以获取更多详细信息。
      • rightKey

        @Deprecated
        protected KeyStroke rightKey
        Deprecated.
        As of Java 2 platform v1.3.
        从Java 2平台v1.3开始,不再使用此前未记录的字段。 键绑定现在由LookAndFeel定义,请参阅键绑定规范以获取更多详细信息。
      • tabRuns

        protected int[] tabRuns
        标签运行
      • runCount

        protected int runCount
        运行计数
      • selectedRun

        protected int selectedRun
        选定的运行
      • rects

        protected Rectangle[] rects
        标签rects
      • maxTabHeight

        protected int maxTabHeight
        最大标签高度
      • maxTabWidth

        protected int maxTabWidth
        最大标签宽度
      • tabChangeListener

        protected ChangeListener tabChangeListener
        标签更改监听器
      • mouseListener

        protected MouseListener mouseListener
        鼠标更改侦听器
      • focusListener

        protected FocusListener focusListener
        专心改变听众
      • calcRect

        protected transient Rectangle calcRect
        用于一般布局计算的矩形,以避免动态构造许多新的矩形。
    • 构造方法详细信息

      • BasicTabbedPaneUI

        public BasicTabbedPaneUI()
    • 方法详细信息

      • createUI

        public static ComponentUI createUI​(JComponent c)
        创建一个UI。
        参数
        c - 组件
        结果
        用户界面
      • installComponents

        protected void installComponents()
        创建并安装JTabbedPane所需的任何子组件。 由installUI调用。
        从以下版本开始:
        1.4
      • createScrollButton

        protected JButton createScrollButton​(int direction)
        创建并返回一个JButton,它将为用户提供一种在特定方向上滚动选项卡的方法。 返回的JButton必须是UIResource的实例。
        参数
        direction - SwingConstants常量之一:SOUTH,NORTH,EAST或WEST
        结果
        用户的小部件
        异常
        IllegalArgumentException - 如果方向不是NORTH,SOUTH,EAST或WEST之一
        从以下版本开始:
        1.5
        另请参见:
        JTabbedPane.setTabPlacement(int)SwingConstants
      • uninstallComponents

        protected void uninstallComponents()
        从JTabbedPane中删除任何已安装的子组件。 由uninstallUI调用。
        从以下版本开始:
        1.4
      • installDefaults

        protected void installDefaults()
        安装默认值。
      • uninstallDefaults

        protected void uninstallDefaults()
        卸载默认值。
      • installListeners

        protected void installListeners()
        安装监听器。
      • uninstallListeners

        protected void uninstallListeners()
        卸载侦听器。
      • createMouseListener

        protected MouseListener createMouseListener()
        创建一个鼠标监听器。
        结果
        一个老鼠听众
      • createFocusListener

        protected FocusListener createFocusListener()
        创建焦点侦听器。
        结果
        一个焦点听众
      • createChangeListener

        protected ChangeListener createChangeListener()
        创建更改侦听器。
        结果
        改变倾听者
      • createPropertyChangeListener

        protected PropertyChangeListener createPropertyChangeListener()
        创建属性更改侦听器。
        结果
        属性更改侦听器
      • installKeyboardActions

        protected void installKeyboardActions()
        安装键盘操作。
      • uninstallKeyboardActions

        protected void uninstallKeyboardActions()
        卸载键盘操作。
      • setRolloverTab

        protected void setRolloverTab​(int index)
        将鼠标当前所在的选项卡设置为index 如果鼠标不再位于任何选项卡上,则index将为-1。 不进行检查以确保传入的索引标识有效选项卡。
        参数
        index - 鼠标悬停的标签索引。
        从以下版本开始:
        1.5
      • getRolloverTab

        protected int getRolloverTab()
        返回鼠标当前所在的选项卡,如果鼠标不再位于任何选项卡上,则返回 -1
        结果
        鼠标当前所在的选项卡,如果鼠标不再位于任何选项卡上, -1
        从以下版本开始:
        1.5
      • getBaseline

        protected int getBaseline​(int tab)
        返回指定选项卡的基线。
        参数
        tab - 获取基线的选项卡索引
        结果
        基线或值<0表示没有合理的基线
        异常
        IndexOutOfBoundsException - 如果索引超出范围(索引<0 ||索引> =制表符计数)
        从以下版本开始:
        1.6
      • getBaselineOffset

        protected int getBaselineOffset()
        返回基线偏移量。 这通常与getTabLabelShiftY相同。
        结果
        相当于抵消基线的数量
        从以下版本开始:
        1.6
      • paintTabArea

        protected void paintTabArea​(Graphics g,
                                    int tabPlacement,
                                    int selectedIndex)
        绘制选项卡区域中的选项卡。 由paint()调用。 graphics参数必须是有效的Graphics对象。 标签位置可以是: JTabbedPane.TOPJTabbedPane.BOTTOMJTabbedPane.LEFT ,或JTabbedPane.RIGHT 所选索引必须是有效的选项卡式窗格选项卡索引(0到选项卡计数 - 1,包括1)或-1(如果当前未选择任何选项卡)。 未指定处理无效参数。
        参数
        g - 用于渲染的图形对象
        tabPlacement - JTabbedPane中选项卡的位置
        selectedIndex - 所选组件的选项卡索引
        从以下版本开始:
        1.4
      • paintTab

        protected void paintTab​(Graphics g,
                                int tabPlacement,
                                Rectangle[] rects,
                                int tabIndex,
                                Rectangle iconRect,
                                Rectangle textRect)
        绘制标签。
        参数
        g - 图形
        tabPlacement - 选项卡位置
        rects - 矩形
        tabIndex - 选项卡索引
        iconRect - 图标矩形
        textRect - 文本矩形
      • layoutLabel

        protected void layoutLabel​(int tabPlacement,
                                   FontMetrics metrics,
                                   int tabIndex,
                                   String title,
                                   Icon icon,
                                   Rectangle tabRect,
                                   Rectangle iconRect,
                                   Rectangle textRect,
                                   boolean isSelected)
        布置标签。
        参数
        tabPlacement - 选项卡位置
        metrics - 字体度量
        tabIndex - 选项卡索引
        title - 标题
        icon - 图标
        tabRect - 选项卡矩形
        iconRect - 图标矩形
        textRect - 文本矩形
        isSelected - 选择状态
      • paintIcon

        protected void paintIcon​(Graphics g,
                                 int tabPlacement,
                                 int tabIndex,
                                 Icon icon,
                                 Rectangle iconRect,
                                 boolean isSelected)
        画一个图标。
        参数
        g - 图形
        tabPlacement - 选项卡位置
        tabIndex - 选项卡索引
        icon - 图标
        iconRect - 图标矩形
        isSelected - 选择状态
      • paintText

        protected void paintText​(Graphics g,
                                 int tabPlacement,
                                 Font font,
                                 FontMetrics metrics,
                                 int tabIndex,
                                 String title,
                                 Rectangle textRect,
                                 boolean isSelected)
        绘制文字。
        参数
        g - 图形
        tabPlacement - 选项卡位置
        font - 字体
        metrics - 字体度量标准
        tabIndex - 选项卡索引
        title - 标题
        textRect - 文本矩形
        isSelected - 选择状态
      • getTabLabelShiftX

        protected int getTabLabelShiftX​(int tabPlacement,
                                        int tabIndex,
                                        boolean isSelected)
        返回选项卡标签shift x。
        参数
        tabPlacement - 选项卡位置
        tabIndex - 选项卡索引
        isSelected - 选择状态
        结果
        标签标签移位x
      • getTabLabelShiftY

        protected int getTabLabelShiftY​(int tabPlacement,
                                        int tabIndex,
                                        boolean isSelected)
        返回选项卡标签shift y。
        参数
        tabPlacement - 选项卡位置
        tabIndex - 选项卡索引
        isSelected - 选择状态
        结果
        标签标签转移y
      • paintFocusIndicator

        protected void paintFocusIndicator​(Graphics g,
                                           int tabPlacement,
                                           Rectangle[] rects,
                                           int tabIndex,
                                           Rectangle iconRect,
                                           Rectangle textRect,
                                           boolean isSelected)
        绘制焦点指示器。
        参数
        g - 图形
        tabPlacement - 选项卡位置
        rects - 矩形
        tabIndex - 选项卡索引
        iconRect - 图标矩形
        textRect - 文本矩形
        isSelected - 选择状态
      • paintTabBorder

        protected void paintTabBorder​(Graphics g,
                                      int tabPlacement,
                                      int tabIndex,
                                      int x,
                                      int y,
                                      int w,
                                      int h,
                                      boolean isSelected)
        此函数绘制每个选项卡周围的边框,此功能现在可以绘制选项卡的背景。 这是在别处完成的
        参数
        g - 要绘制的图形上下文
        tabPlacement - 选项卡的放置(左,右,底部,顶部)
        tabIndex - 选项卡相对于其他选项卡的索引
        x - 选项卡的x坐标
        y - 选项卡的y坐标
        w - 选项卡的宽度
        h - 选项卡的高度
        isSelected - boolean确定是否选中了选项卡
      • paintTabBackground

        protected void paintTabBackground​(Graphics g,
                                          int tabPlacement,
                                          int tabIndex,
                                          int x,
                                          int y,
                                          int w,
                                          int h,
                                          boolean isSelected)
        绘制选项卡背景。
        参数
        g - 要绘制的图形上下文
        tabPlacement - 选项卡的放置(左,右,底部,顶部)
        tabIndex - 选项卡相对于其他选项卡的索引
        x - 制表符的x坐标
        y - 选项卡的y坐标
        w - 选项卡的宽度
        h - 选项卡的高度
        isSelected - boolean ,用于确定是否选中了选项卡
      • paintContentBorder

        protected void paintContentBorder​(Graphics g,
                                          int tabPlacement,
                                          int selectedIndex)
        绘制内容边框。
        参数
        g - 要绘制的图形上下文
        tabPlacement - 选项卡的放置(左,右,底部,顶部)
        selectedIndex - 所选组件的选项卡索引
      • paintContentBorderTopEdge

        protected void paintContentBorderTopEdge​(Graphics g,
                                                 int tabPlacement,
                                                 int selectedIndex,
                                                 int x,
                                                 int y,
                                                 int w,
                                                 int h)
        绘制内容边框上边缘。
        参数
        g - 要绘制的图形上下文
        tabPlacement - 选项卡的放置(左,右,底部,顶部)
        selectedIndex - 所选组件的选项卡索引
        x - 选项卡的x坐标
        y - 制表符的y坐标
        w - 选项卡的宽度
        h - 选项卡的高度
      • paintContentBorderLeftEdge

        protected void paintContentBorderLeftEdge​(Graphics g,
                                                  int tabPlacement,
                                                  int selectedIndex,
                                                  int x,
                                                  int y,
                                                  int w,
                                                  int h)
        绘制内容边框左边缘。
        参数
        g - 要绘制的图形上下文
        tabPlacement - 选项卡的放置(左,右,底部,顶部)
        selectedIndex - 所选组件的选项卡索引
        x - 选项卡的x坐标
        y - 选项卡的y坐标
        w - 选项卡的宽度
        h - 选项卡的高度
      • paintContentBorderBottomEdge

        protected void paintContentBorderBottomEdge​(Graphics g,
                                                    int tabPlacement,
                                                    int selectedIndex,
                                                    int x,
                                                    int y,
                                                    int w,
                                                    int h)
        绘制内容边框底边。
        参数
        g - 要绘制的图形上下文
        tabPlacement - 选项卡的放置(左,右,底部,顶部)
        selectedIndex - 所选组件的选项卡索引
        x - 制表符的x坐标
        y - 选项卡的y坐标
        w - 选项卡的宽度
        h - 选项卡的高度
      • paintContentBorderRightEdge

        protected void paintContentBorderRightEdge​(Graphics g,
                                                   int tabPlacement,
                                                   int selectedIndex,
                                                   int x,
                                                   int y,
                                                   int w,
                                                   int h)
        绘制内容边框右边缘。
        参数
        g - 要绘制的图形上下文
        tabPlacement - 选项卡的放置(左,右,底部,顶部)
        selectedIndex - 所选组件的选项卡索引
        x - 选项卡的x坐标
        y - 制表符的y坐标
        w - 选项卡的宽度
        h - 选项卡的高度
      • getTabBounds

        public Rectangle getTabBounds​(JTabbedPane pane,
                                      int i)
        返回指定选项卡索引的边界。 边界与JTabbedPane的坐标空间有关。
        Specified by:
        getTabBounds在类 TabbedPaneUI
        参数
        pane - 窗格
        i - 索引
        结果
        选项卡边界的矩形
      • tabForCoordinate

        public int tabForCoordinate​(JTabbedPane pane,
                                    int x,
                                    int y)
        返回与JTabbedPane坐标空间中指定点相交的选项卡索引。
        Specified by:
        tabForCoordinate ,类 TabbedPaneUI
        参数
        pane - 窗格
        x - x坐标
        y - y坐标
        结果
        坐标的选项卡
      • getTabBounds

        protected Rectangle getTabBounds​(int tabIndex,
                                         Rectangle dest)
        返回JTabbedPane组件的坐标空间中指定选项卡的边界。 这是必需的,因为默认情况下,选项卡rects是在呈现它们的组件的坐标空间中定义的,可以是JTabbedPane(对于WRAP_TAB_LAYOUT)或ScrollableTabPanel(SCROLL_TAB_LAYOUT)。 只要tab矩形必须相对于JTabbedPane本身,并且结果应放在指定的Rectangle对象中(而不是每次实例化并返回一个新的Rectangle),就应该使用此方法。 选项卡索引参数必须是有效的选项卡式窗格选项卡索引(0到选项卡计数 - 1,包括1)。 目标矩形参数必须是有效的Rectangle实例。 未指定处理无效参数。
        参数
        tabIndex - 选项卡的索引
        dest - 应放置结果的矩形
        结果
        生成的矩形
        从以下版本开始:
        1.4
      • getVisibleComponent

        protected Component getVisibleComponent()
        返回可见组件。
        结果
        可见组件
      • setVisibleComponent

        protected void setVisibleComponent​(Component component)
        设置可见组件。
        参数
        component - 组件
      • assureRectsCreated

        protected void assureRectsCreated​(int tabCount)
        确保创建矩形。
        参数
        tabCount - 标签计数
      • expandTabRunsArray

        protected void expandTabRunsArray()
        展开选项卡运行数组。
      • getRunForTab

        protected int getRunForTab​(int tabCount,
                                   int tabIndex)
        返回选项卡的运行。
        参数
        tabCount - 标签计数
        tabIndex - 选项卡索引。
        结果
        运行选项卡
      • lastTabInRun

        protected int lastTabInRun​(int tabCount,
                                   int run)
        返回运行中的最后一个选项卡。
        参数
        tabCount - 选项卡计数
        run - 奔跑
        结果
        运行中的最后一个选项卡
      • getTabRunOverlay

        protected int getTabRunOverlay​(int tabPlacement)
        返回选项卡运行覆盖。
        参数
        tabPlacement - 选项卡的放置(左,右,底部,顶部)
        结果
        选项卡运行覆盖
      • getTabRunIndent

        protected int getTabRunIndent​(int tabPlacement,
                                      int run)
        返回选项卡运行缩进。
        参数
        tabPlacement - 选项卡的放置(左,右,底部,顶部)
        run - 选项卡运行
        结果
        标签运行缩进
      • shouldPadTabRun

        protected boolean shouldPadTabRun​(int tabPlacement,
                                          int run)
        返回是否应填充制表符。
        参数
        tabPlacement - 选项卡的放置(左,右,底部,顶部)
        run - 选项卡运行
        结果
        是否应填充选项卡运行
      • shouldRotateTabRuns

        protected boolean shouldRotateTabRuns​(int tabPlacement)
        返回是否应旋转制表符。
        参数
        tabPlacement - 选项卡的放置(左,右,底部,顶部)
        结果
        是否应旋转制表符
      • getIconForTab

        protected Icon getIconForTab​(int tabIndex)
        返回选项卡的图标。
        参数
        tabIndex - 选项卡的索引
        结果
        标签的图标
      • getTextViewForTab

        protected View getTextViewForTab​(int tabIndex)
        返回呈现指定选项卡的样式化文本(HTML)所需的文本View对象;如果此选项卡不需要专门的文本呈现,则返回null。 这是为了支持选项卡内的html呈现。
        参数
        tabIndex - 选项卡的索引
        结果
        用于呈现选项卡文本的文本视图,如果不需要专门的呈现,则返回null
        从以下版本开始:
        1.4
      • calculateTabHeight

        protected int calculateTabHeight​(int tabPlacement,
                                         int tabIndex,
                                         int fontHeight)
        计算标签高度。
        参数
        tabPlacement - 选项卡的放置(左,右,底部,顶部)
        tabIndex - 选项卡相对于其他选项卡的索引
        fontHeight - 字体高度
        结果
        标签高度
      • calculateMaxTabHeight

        protected int calculateMaxTabHeight​(int tabPlacement)
        计算最大标签高度。
        参数
        tabPlacement - 选项卡的放置(左,右,底部,顶部)
        结果
        最大标签高度
      • calculateTabWidth

        protected int calculateTabWidth​(int tabPlacement,
                                        int tabIndex,
                                        FontMetrics metrics)
        计算标签宽度。
        参数
        tabPlacement - 选项卡的放置(左,右,底部,顶部)
        tabIndex - 选项卡相对于其他选项卡的索引
        metrics - 字体指标
        结果
        标签宽度
      • calculateMaxTabWidth

        protected int calculateMaxTabWidth​(int tabPlacement)
        计算最大标签宽度。
        参数
        tabPlacement - 选项卡的放置(左,右,底部,顶部)
        结果
        最大标签宽度
      • calculateTabAreaHeight

        protected int calculateTabAreaHeight​(int tabPlacement,
                                             int horizRunCount,
                                             int maxTabHeight)
        计算标签区域高度。
        参数
        tabPlacement - 选项卡的放置(左,右,底部,顶部)
        horizRunCount - 水平运行计数
        maxTabHeight - 最大标签高度
        结果
        标签区域高度
      • calculateTabAreaWidth

        protected int calculateTabAreaWidth​(int tabPlacement,
                                            int vertRunCount,
                                            int maxTabWidth)
        计算选项卡区域宽度。
        参数
        tabPlacement - 选项卡的放置(左,右,底部,顶部)
        vertRunCount - 垂直运行计数
        maxTabWidth - 最大标签宽度
        结果
        标签区域宽度
      • getTabInsets

        protected Insets getTabInsets​(int tabPlacement,
                                      int tabIndex)
        返回制表符insets。
        参数
        tabPlacement - 选项卡的放置(左,右,底部,顶部)
        tabIndex - 选项卡索引
        结果
        制表符插入
      • getSelectedTabPadInsets

        protected Insets getSelectedTabPadInsets​(int tabPlacement)
        返回选定的制表符垫插图。
        参数
        tabPlacement - 选项卡的放置(左,右,底部,顶部)
        结果
        选定的标签页插入
      • getTabAreaInsets

        protected Insets getTabAreaInsets​(int tabPlacement)
        返回选项卡区域insets。
        参数
        tabPlacement - 选项卡的放置(左,右,底部,顶部)
        结果
        垫区域插入
      • getContentBorderInsets

        protected Insets getContentBorderInsets​(int tabPlacement)
        返回内容边框insets。
        参数
        tabPlacement - 选项卡的放置(左,右,底部,顶部)
        结果
        内容边框插入
      • getFontMetrics

        protected FontMetrics getFontMetrics()
        返回字体指标。
        结果
        字体指标
      • navigateSelectedTab

        protected void navigateSelectedTab​(int direction)
        导航选定的选项卡。
        参数
        direction - 方向
      • selectNextTabInRun

        protected void selectNextTabInRun​(int current)
        选择运行中的下一个选项卡。
        参数
        current - 当前选项卡
      • selectPreviousTabInRun

        protected void selectPreviousTabInRun​(int current)
        选择运行中的上一个选项卡。
        参数
        current - 当前选项卡
      • selectNextTab

        protected void selectNextTab​(int current)
        选择下一个选项卡。
        参数
        current - 当前选项卡
      • selectPreviousTab

        protected void selectPreviousTab​(int current)
        选择上一个选项卡。
        参数
        current - 当前选项卡
      • selectAdjacentRunTab

        protected void selectAdjacentRunTab​(int tabPlacement,
                                            int tabIndex,
                                            int offset)
        选择相邻的选项卡。
        参数
        tabPlacement - 选项卡的放置(左,右,底部,顶部)
        tabIndex - 选项卡相对于其他选项卡的索引
        offset - 选择偏移量
      • getFocusIndex

        protected int getFocusIndex()
        返回具有焦点的选项卡的索引。
        结果
        具有焦点的选项卡的索引
        从以下版本开始:
        1.5
      • getTabRunOffset

        protected int getTabRunOffset​(int tabPlacement,
                                      int tabCount,
                                      int tabIndex,
                                      boolean forward)
        返回选项卡运行偏移量。
        参数
        tabPlacement - 选项卡的放置(左,右,底部,顶部)
        tabCount - 标签计数
        tabIndex - 选项卡相对于其他选项卡的索引
        forward - 前进与否
        结果
        选项卡运行偏移量
      • getPreviousTabIndex

        protected int getPreviousTabIndex​(int base)
        返回上一个选项卡索引。
        参数
        base - 基地
        结果
        上一个标签索引
      • getNextTabIndex

        protected int getNextTabIndex​(int base)
        返回下一个选项卡索引。
        参数
        base - 基地
        结果
        下一个标签索引
      • getNextTabIndexInRun

        protected int getNextTabIndexInRun​(int tabCount,
                                           int base)
        返回运行中的下一个选项卡索引。
        参数
        tabCount - 选项卡计数
        base - 基地
        结果
        运行中的下一个选项卡索引
      • getPreviousTabIndexInRun

        protected int getPreviousTabIndexInRun​(int tabCount,
                                               int base)
        返回运行中的上一个选项卡索引。
        参数
        tabCount - 选项卡计数
        base - 基地
        结果
        运行中的上一个选项卡索引
      • getPreviousTabRun

        protected int getPreviousTabRun​(int baseRun)
        返回上一个选项卡运行。
        参数
        baseRun - 基本运行
        结果
        上一个标签运行
      • getNextTabRun

        protected int getNextTabRun​(int baseRun)
        返回下一个标签运行。
        参数
        baseRun - 基本运行
        结果
        下一个标签运行
      • rotateInsets

        protected static void rotateInsets​(Insets topInsets,
                                           Insets targetInsets,
                                           int targetPlacement)
        旋转插图。
        参数
        topInsets - 顶级插图
        targetInsets - 目标insets
        targetPlacement - 目标展示位置