|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
上一個類別 下一個類別 | 框架 無框架 | |||||||||
摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 |
java.lang.Object javax.swing.plaf.ComponentUI javax.swing.plaf.TabbedPaneUI javax.swing.plaf.basic.BasicTabbedPaneUI
public class BasicTabbedPaneUI
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 |
欄位詳細資訊 |
---|
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 BasicTabbedPaneUI()
方法詳細資訊 |
---|
public static ComponentUI createUI(JComponent c)
public void installUI(JComponent c)
ComponentUI
複製的描述ComponentUI
實例將作為 UI 委託安裝在指定元件上時,可調用此方法。此方法應該為外觀完整地配置元件,包括以下方面:
LayoutManager
。
PropertyChangeListener
。
ComponentUI
中的 installUI
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
實例處於某種潔淨狀態(沒有額外的偵聽器、沒有特定於外觀的屬性物件等等)。配置內容應該套件括以下方面:
ComponentUI
中的 uninstallUI
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 常數之一:SOUTH、NORTH、EAST 或 WEST
IllegalArgumentException
- 如果方向不為 NORTH、SOUTH、EAST 或 WEST 之一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
並返回該值。
ComponentUI
中的 getMinimumSize
c
- 將查詢其最小大小的元件;此參數常被忽略,但如果 UI 物件是無狀態的並由多個元件共享,則可以使用該參數
Dimension
物件或 null
JComponent.getMinimumSize()
,
LayoutManager.minimumLayoutSize(java.awt.Container)
,
ComponentUI.getPreferredSize(javax.swing.JComponent)
public Dimension getMaximumSize(JComponent c)
ComponentUI
複製的描述null
,則最大大小將由元件的佈局管理器計算(對於安裝了特定佈局管理器的元件而言,這是首選方法)。此方法的預設實作調用 getPreferredSize
並返回該值。
ComponentUI
中的 getMaximumSize
c
- 將查詢其最大大小的元件;此參數常被忽略,但如果 UI 物件是無狀態的並由多個元件共享,則可以使用該參數
Dimension
物件或 null
JComponent.getMaximumSize()
,
LayoutManager2.maximumLayoutSize(java.awt.Container)
public int getBaseline(JComponent c, int width, int height)
ComponentUI
中的 getBaseline
c
- 為其請求基線的 JComponent
width
- 為其獲取基線的寬度height
- 為其獲取基線的高度
NullPointerException
- 如果 c
為 null
IllegalArgumentException
- 如果寬度或高度 < 0JComponent.getBaseline(int, int)
public Component.BaselineResizeBehavior getBaselineResizeBehavior(JComponent c)
ComponentUI
中的 getBaselineResizeBehavior
c
- 為其返回調整大小行為的 JComponent
NullPointerException
- 如果 c
為 null
JComponent.getBaseline(int, int)
protected int getBaseline(int tab)
tab
- 獲取其基線的選項卡的索引
IndexOutOfBoundsException
- 如果索引超出範圍(index < 0 || index >= tab count)protected int getBaselineOffset()
getTabLabelShiftY
相同。
public void paint(Graphics g, JComponent c)
ComponentUI
複製的描述ComponentUI.update
方法中調用此方法。子類別應該覆寫此方法並使用指定 Graphics
物件來呈現元件的內容。
ComponentUI
中的 paint
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
- JTabbedPane 中選項卡的位置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)
TabbedPaneUI
中的 getTabBounds
public int getTabRunCount(JTabbedPane pane)
TabbedPaneUI
中的 getTabRunCount
public int tabForCoordinate(JTabbedPane pane, int x, int y)
TabbedPaneUI
中的 tabForCoordinate
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)
protected static void rotateInsets(Insets topInsets, Insets targetInsets, int targetPlacement)
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
上一個類別 下一個類別 | 框架 無框架 | |||||||||
摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 |
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。