java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.TabbedPaneUI
javax.swing.plaf.basic.BasicTabbedPaneUI
- All Implemented Interfaces:
SwingConstants
- Direct Known Subclasses:
MetalTabbedPaneUI
,SynthTabbedPaneUI
A Basic L&F implementation of TabbedPaneUI.
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
This class should be treated as a "protected" inner class.class
This class should be treated as a "protected" inner class.class
This class should be treated as a "protected" inner class.class
This class should be treated as a "protected" inner class.class
This class should be treated as a "protected" inner class. -
Field Summary
Modifier and TypeFieldDescriptionprotected Rectangle
A rectangle used for general layout calculations in order to avoid constructing many new Rectangles on the fly.protected Insets
Content border insetsprotected Color
Dark shadow colorprotected KeyStroke
Deprecated.As of Java 2 platform v1.3.protected Color
Focus colorprotected FocusListener
Focus change listenerprotected Color
Highlight colorprotected KeyStroke
Deprecated.As of Java 2 platform v1.3.protected Color
Light highlight colorprotected int
Maximum tab heightprotected int
Maximum tab widthprotected MouseListener
Mouse change listenerprotected PropertyChangeListener
Property change listenerprotected Rectangle[]
Tab rectsprotected KeyStroke
Deprecated.As of Java 2 platform v1.3.protected int
Run countprotected int
Selected runprotected Insets
Selected tab insetsprotected Color
Shadow colorprotected Insets
Tab area insetsprotected ChangeListener
Tab change listenerprotected Insets
Tab insetsprotected JTabbedPane
The tab paneprotected int
Tab run overlayprotected int[]
Tab runsprotected int
Text icon gapprotected KeyStroke
Deprecated.As of Java 2 platform v1.3.Fields declared in interface 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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
assureRectsCreated
(int tabCount) Assures the tab rectangles are created.protected int
calculateMaxTabHeight
(int tabPlacement) Calculates the maximum tab height.protected int
calculateMaxTabWidth
(int tabPlacement) Calculates the maximum tab width.protected int
calculateTabAreaHeight
(int tabPlacement, int horizRunCount, int maxTabHeight) Calculates the tab area height.protected int
calculateTabAreaWidth
(int tabPlacement, int vertRunCount, int maxTabWidth) Calculates the tab area width.protected int
calculateTabHeight
(int tabPlacement, int tabIndex, int fontHeight) Calculates the tab height.protected int
calculateTabWidth
(int tabPlacement, int tabIndex, FontMetrics metrics) Calculates the tab width.protected ChangeListener
Creates a change listener.protected FocusListener
Creates a focus listener.protected LayoutManager
Invoked byinstallUI
to create a layout manager object to manage theJTabbedPane
.protected MouseListener
Creates a mouse listener.protected PropertyChangeListener
Creates a property change listener.protected JButton
createScrollButton
(int direction) Creates and returns a JButton that will provide the user with a way to scroll the tabs in a particular direction.static ComponentUI
Creates a UI.protected void
Expands the tab runs array.protected int
getBaseline
(int tab) Returns the baseline for the specified tab.int
getBaseline
(JComponent c, int width, int height) Returns the baseline.protected int
Returns the amount the baseline is offset by.Returns an enum indicating how the baseline of the component changes as the size changes.protected Insets
getContentBorderInsets
(int tabPlacement) Returns the content border insets.protected int
Returns the index of the tab that has focus.protected FontMetrics
Returns the font metrics.protected Icon
getIconForTab
(int tabIndex) Returns the icon for a tab.protected int
getNextTabIndex
(int base) Returns the next tab index.protected int
getNextTabIndexInRun
(int tabCount, int base) Returns the next tab index in the run.protected int
getNextTabRun
(int baseRun) Returns the next tab run.protected int
getPreviousTabIndex
(int base) Returns the previous tab index.protected int
getPreviousTabIndexInRun
(int tabCount, int base) Returns the previous tab index in the run.protected int
getPreviousTabRun
(int baseRun) Returns the previous tab run.protected int
Returns the tab the mouse is currently over, or-1
if the mouse is no longer over any tab.protected int
getRunForTab
(int tabCount, int tabIndex) Returns the run for a tab.protected Insets
getSelectedTabPadInsets
(int tabPlacement) Returns the selected tab pad insets.protected Insets
getTabAreaInsets
(int tabPlacement) Returns the tab area insets.protected Rectangle
getTabBounds
(int tabIndex, Rectangle dest) Returns the bounds of the specified tab in the coordinate space of the JTabbedPane component.getTabBounds
(JTabbedPane pane, int i) Returns the bounds of the specified tab index.protected Insets
getTabInsets
(int tabPlacement, int tabIndex) Returns the tab insets.protected int
getTabLabelShiftX
(int tabPlacement, int tabIndex, boolean isSelected) Returns the tab label shift x.protected int
getTabLabelShiftY
(int tabPlacement, int tabIndex, boolean isSelected) Returns the tab label shift y.int
getTabRunCount
(JTabbedPane pane) Returns the tab run count.protected int
getTabRunIndent
(int tabPlacement, int run) Returns the tab run indent.protected int
getTabRunOffset
(int tabPlacement, int tabCount, int tabIndex, boolean forward) Returns the tab run offset.protected int
getTabRunOverlay
(int tabPlacement) Returns the tab run overlay.protected View
getTextViewForTab
(int tabIndex) Returns the text View object required to render stylized text (HTML) for the specified tab or null if no specialized text rendering is needed for this tab.protected Component
Returns the visible component.protected void
Creates and installs any required subcomponents for the JTabbedPane.protected void
Installs the defaults.protected void
Installs the keyboard actions.protected void
Installs the listeners.protected int
lastTabInRun
(int tabCount, int run) Returns the last tab in a run.protected void
layoutLabel
(int tabPlacement, FontMetrics metrics, int tabIndex, String title, Icon icon, Rectangle tabRect, Rectangle iconRect, Rectangle textRect, boolean isSelected) Lays out a label.protected void
navigateSelectedTab
(int direction) Navigates the selected tab.protected void
paintContentBorder
(Graphics g, int tabPlacement, int selectedIndex) Paints the content border.protected void
paintContentBorderBottomEdge
(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) Paints the content border bottom edge.protected void
paintContentBorderLeftEdge
(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) Paints the content border left edge.protected void
paintContentBorderRightEdge
(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) Paints the content border right edge.protected void
paintContentBorderTopEdge
(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) Paints the content border top edge.protected void
paintFocusIndicator
(Graphics g, int tabPlacement, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect, boolean isSelected) Paints the focus indicator.protected void
paintIcon
(Graphics g, int tabPlacement, int tabIndex, Icon icon, Rectangle iconRect, boolean isSelected) Paints an icon.protected void
paintTab
(Graphics g, int tabPlacement, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect) Paints a tab.protected void
paintTabArea
(Graphics g, int tabPlacement, int selectedIndex) Paints the tabs in the tab area.protected void
paintTabBackground
(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) Paints the tab background.protected void
paintTabBorder
(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) Paints the border around a tab.protected void
paintText
(Graphics g, int tabPlacement, Font font, FontMetrics metrics, int tabIndex, String title, Rectangle textRect, boolean isSelected) Paints text.protected static void
rotateInsets
(Insets topInsets, Insets targetInsets, int targetPlacement) Rotates the insets.protected void
selectAdjacentRunTab
(int tabPlacement, int tabIndex, int offset) Selects an adjacent run of tabs.protected void
selectNextTab
(int current) Selects the next tab.protected void
selectNextTabInRun
(int current) Selects the next tab in the run.protected void
selectPreviousTab
(int current) Selects the previous tab.protected void
selectPreviousTabInRun
(int current) Selects the previous tab in the run.protected void
setRolloverTab
(int index) Sets the tab the mouse is currently over toindex
.protected void
setVisibleComponent
(Component component) Sets the visible component.protected boolean
shouldPadTabRun
(int tabPlacement, int run) Returns whether or not the tab run should be padded.protected boolean
shouldRotateTabRuns
(int tabPlacement) Returns whether or not the tab run should be rotated.int
tabForCoordinate
(JTabbedPane pane, int x, int y) Returns the tab index which intersects the specified point in the JTabbedPane's coordinate space.protected void
Removes any installed subcomponents from the JTabbedPane.protected void
Uninstalls the defaults.protected void
Uninstalls the keyboard actions.protected void
Uninstalls the listeners.Methods declared in class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSize, installUI, paint, uninstallUI, update
-
Field Details
-
tabPane
The tab pane -
highlight
Highlight color -
lightHighlight
Light highlight color -
shadow
Shadow color -
darkShadow
Dark shadow color -
focus
Focus color -
textIconGap
protected int textIconGapText icon gap -
tabRunOverlay
protected int tabRunOverlayTab run overlay -
tabInsets
Tab insets -
selectedTabPadInsets
Selected tab insets -
tabAreaInsets
Tab area insets -
contentBorderInsets
Content border insets -
upKey
Deprecated.As of Java 2 platform v1.3.As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details. -
downKey
Deprecated.As of Java 2 platform v1.3.As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details. -
leftKey
Deprecated.As of Java 2 platform v1.3.As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details. -
rightKey
Deprecated.As of Java 2 platform v1.3.As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details. -
tabRuns
protected int[] tabRunsTab runs -
runCount
protected int runCountRun count -
selectedRun
protected int selectedRunSelected run -
rects
Tab rects -
maxTabHeight
protected int maxTabHeightMaximum tab height -
maxTabWidth
protected int maxTabWidthMaximum tab width -
tabChangeListener
Tab change listener -
propertyChangeListener
Property change listener -
mouseListener
Mouse change listener -
focusListener
Focus change listener -
calcRect
A rectangle used for general layout calculations in order to avoid constructing many new Rectangles on the fly.
-
-
Constructor Details
-
BasicTabbedPaneUI
public BasicTabbedPaneUI()Constructs aBasicTabbedPaneUI
.
-
-
Method Details
-
createUI
Creates a UI.- Parameters:
c
- a component- Returns:
- a UI
-
createLayoutManager
Invoked byinstallUI
to create a layout manager object to manage theJTabbedPane
.- Returns:
- a layout manager object
- See Also:
-
installComponents
protected void installComponents()Creates and installs any required subcomponents for the JTabbedPane. Invoked by installUI.- Since:
- 1.4
-
createScrollButton
Creates and returns a JButton that will provide the user with a way to scroll the tabs in a particular direction. The returned JButton must be instance of UIResource.- Parameters:
direction
- One of the SwingConstants constants: SOUTH, NORTH, EAST or WEST- Returns:
- Widget for user to
- Throws:
IllegalArgumentException
- if direction is not one of NORTH, SOUTH, EAST or WEST- Since:
- 1.5
- See Also:
-
uninstallComponents
protected void uninstallComponents()Removes any installed subcomponents from the JTabbedPane. Invoked by uninstallUI.- Since:
- 1.4
-
installDefaults
protected void installDefaults()Installs the defaults. -
uninstallDefaults
protected void uninstallDefaults()Uninstalls the defaults. -
installListeners
protected void installListeners()Installs the listeners. -
uninstallListeners
protected void uninstallListeners()Uninstalls the listeners. -
createMouseListener
-
createFocusListener
-
createChangeListener
Creates a change listener.- Returns:
- a change listener
-
createPropertyChangeListener
Creates a property change listener.- Returns:
- a property change listener
-
installKeyboardActions
protected void installKeyboardActions()Installs the keyboard actions. -
uninstallKeyboardActions
protected void uninstallKeyboardActions()Uninstalls the keyboard actions. -
setRolloverTab
protected void setRolloverTab(int index) Sets the tab the mouse is currently over toindex
.index
will be -1 if the mouse is no longer over any tab. No checking is done to ensure the passed in index identifies a valid tab.- Parameters:
index
- Index of the tab the mouse is over.- Since:
- 1.5
-
getRolloverTab
protected int getRolloverTab()Returns the tab the mouse is currently over, or-1
if the mouse is no longer over any tab.- Returns:
- the tab the mouse is currently over, or
-1
if the mouse is no longer over any tab - Since:
- 1.5
-
getBaseline
Returns the baseline.- Overrides:
getBaseline
in classComponentUI
- Parameters:
c
-JComponent
baseline is being requested forwidth
- the width to get the baseline forheight
- the height to get the baseline for- Returns:
- baseline or a value < 0 indicating there is no reasonable baseline
- Throws:
NullPointerException
- ifc
isnull
IllegalArgumentException
- if width or height is < 0- Since:
- 1.6
- See Also:
-
getBaselineResizeBehavior
Returns an enum indicating how the baseline of the component changes as the size changes.- Overrides:
getBaselineResizeBehavior
in classComponentUI
- Parameters:
c
-JComponent
to return baseline resize behavior for- Returns:
- an enum indicating how the baseline changes as the component size changes
- Throws:
NullPointerException
- ifc
isnull
- Since:
- 1.6
- See Also:
-
getBaseline
protected int getBaseline(int tab) Returns the baseline for the specified tab.- Parameters:
tab
- index of tab to get baseline for- Returns:
- baseline or a value < 0 indicating there is no reasonable baseline
- Throws:
IndexOutOfBoundsException
- if index is out of range (index < 0 || index >= tab count)- Since:
- 1.6
-
getBaselineOffset
protected int getBaselineOffset()Returns the amount the baseline is offset by. This is typically the same asgetTabLabelShiftY
.- Returns:
- amount to offset the baseline by
- Since:
- 1.6
-
paintTabArea
Paints the tabs in the tab area. Invoked by paint(). The graphics parameter must be a validGraphics
object. Tab placement may be either:JTabbedPane.TOP
,JTabbedPane.BOTTOM
,JTabbedPane.LEFT
, orJTabbedPane.RIGHT
. The selected index must be a valid tabbed pane tab index (0 to tab count - 1, inclusive) or -1 if no tab is currently selected. The handling of invalid parameters is unspecified.- Parameters:
g
- the graphics object to use for renderingtabPlacement
- the placement for the tabs within the JTabbedPaneselectedIndex
- the tab index of the selected component- Since:
- 1.4
-
paintTab
protected void paintTab(Graphics g, int tabPlacement, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect) Paints a tab.- Parameters:
g
- the graphicstabPlacement
- the tab placementrects
- the tab rectanglestabIndex
- the tab indexiconRect
- the icon rectangletextRect
- the text rectangle
-
layoutLabel
protected void layoutLabel(int tabPlacement, FontMetrics metrics, int tabIndex, String title, Icon icon, Rectangle tabRect, Rectangle iconRect, Rectangle textRect, boolean isSelected) Lays out a label.- Parameters:
tabPlacement
- the tab placementmetrics
- the font metricstabIndex
- the tab indextitle
- the titleicon
- the icontabRect
- the tab rectangleiconRect
- the icon rectangletextRect
- the text rectangleisSelected
- selection status
-
paintIcon
-
paintText
protected void paintText(Graphics g, int tabPlacement, Font font, FontMetrics metrics, int tabIndex, String title, Rectangle textRect, boolean isSelected) Paints text.- Parameters:
g
- the graphicstabPlacement
- the tab placementfont
- the fontmetrics
- the font metricstabIndex
- the tab indextitle
- the titletextRect
- the text rectangleisSelected
- selection status
-
getTabLabelShiftX
protected int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected) Returns the tab label shift x.- Parameters:
tabPlacement
- the tab placementtabIndex
- the tab indexisSelected
- selection status- Returns:
- the tab label shift x
-
getTabLabelShiftY
protected int getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected) Returns the tab label shift y.- Parameters:
tabPlacement
- the tab placementtabIndex
- the tab indexisSelected
- selection status- Returns:
- the tab label shift y
-
paintFocusIndicator
protected void paintFocusIndicator(Graphics g, int tabPlacement, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect, boolean isSelected) Paints the focus indicator.- Parameters:
g
- the graphicstabPlacement
- the tab placementrects
- the tab rectanglestabIndex
- the tab indexiconRect
- the icon rectangletextRect
- the text rectangleisSelected
- selection status
-
paintTabBorder
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) Paints the border around a tab. Note that this function does not paint the background of the tab, that is done elsewhere.- Parameters:
g
- the graphics context in which to painttabPlacement
- the placement (left, right, bottom, top) of the tabtabIndex
- the index of the tab with respect to other tabsx
- the x coordinate of taby
- the y coordinate of tabw
- the width of the tabh
- the height of the tabisSelected
- aboolean
which determines whether or not the tab is selected
-
paintTabBackground
protected void paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) Paints the tab background.- Parameters:
g
- the graphics context in which to painttabPlacement
- the placement (left, right, bottom, top) of the tabtabIndex
- the index of the tab with respect to other tabsx
- the x coordinate of taby
- the y coordinate of tabw
- the width of the tabh
- the height of the tabisSelected
- aboolean
which determines whether or not the tab is selected
-
paintContentBorder
Paints the content border.- Parameters:
g
- the graphics context in which to painttabPlacement
- the placement (left, right, bottom, top) of the tabselectedIndex
- the tab index of the selected component
-
paintContentBorderTopEdge
protected void paintContentBorderTopEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) Paints the content border top edge.- Parameters:
g
- the graphics context in which to painttabPlacement
- the placement (left, right, bottom, top) of the tabselectedIndex
- the tab index of the selected componentx
- the x coordinate of taby
- the y coordinate of tabw
- the width of the tabh
- the height of the tab
-
paintContentBorderLeftEdge
protected void paintContentBorderLeftEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) Paints the content border left edge.- Parameters:
g
- the graphics context in which to painttabPlacement
- the placement (left, right, bottom, top) of the tabselectedIndex
- the tab index of the selected componentx
- the x coordinate of taby
- the y coordinate of tabw
- the width of the tabh
- the height of the tab
-
paintContentBorderBottomEdge
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) Paints the content border bottom edge.- Parameters:
g
- the graphics context in which to painttabPlacement
- the placement (left, right, bottom, top) of the tabselectedIndex
- the tab index of the selected componentx
- the x coordinate of taby
- the y coordinate of tabw
- the width of the tabh
- the height of the tab
-
paintContentBorderRightEdge
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h) Paints the content border right edge.- Parameters:
g
- the graphics context in which to painttabPlacement
- the placement (left, right, bottom, top) of the tabselectedIndex
- the tab index of the selected componentx
- the x coordinate of taby
- the y coordinate of tabw
- the width of the tabh
- the height of the tab
-
getTabBounds
Returns the bounds of the specified tab index. The bounds are with respect to the JTabbedPane's coordinate space.- Specified by:
getTabBounds
in classTabbedPaneUI
- Parameters:
pane
- the panei
- the index- Returns:
- the rectangle for the tab bounds
-
getTabRunCount
Description copied from class:TabbedPaneUI
Returns the tab run count.- Specified by:
getTabRunCount
in classTabbedPaneUI
- Parameters:
pane
- the pane- Returns:
- the tab run count
-
tabForCoordinate
Returns the tab index which intersects the specified point in the JTabbedPane's coordinate space.- Specified by:
tabForCoordinate
in classTabbedPaneUI
- Parameters:
pane
- the panex
- the x coordinatey
- the y coordinate- Returns:
- the tab for the coordinate
-
getTabBounds
Returns the bounds of the specified tab in the coordinate space of the JTabbedPane component. This is required because the tab rects are by default defined in the coordinate space of the component where they are rendered, which could be the JTabbedPane (for WRAP_TAB_LAYOUT) or a ScrollableTabPanel (SCROLL_TAB_LAYOUT). This method should be used whenever the tab rectangle must be relative to the JTabbedPane itself and the result should be placed in a designated Rectangle object (rather than instantiating and returning a new Rectangle each time). The tab index parameter must be a valid tabbed pane tab index (0 to tab count - 1, inclusive). The destination rectangle parameter must be a validRectangle
instance. The handling of invalid parameters is unspecified.- Parameters:
tabIndex
- the index of the tabdest
- the rectangle where the result should be placed- Returns:
- the resulting rectangle
- Since:
- 1.4
-
getVisibleComponent
Returns the visible component.- Returns:
- the visible component
-
setVisibleComponent
Sets the visible component.- Parameters:
component
- the component
-
assureRectsCreated
protected void assureRectsCreated(int tabCount) Assures the tab rectangles are created.- Parameters:
tabCount
- the tab count
-
expandTabRunsArray
protected void expandTabRunsArray()Expands the tab runs array. -
getRunForTab
protected int getRunForTab(int tabCount, int tabIndex) Returns the run for a tab.- Parameters:
tabCount
- the tab counttabIndex
- the tab index.- Returns:
- the run for a tab
-
lastTabInRun
protected int lastTabInRun(int tabCount, int run) Returns the last tab in a run.- Parameters:
tabCount
- the tab countrun
- the run- Returns:
- the last tab in a run
-
getTabRunOverlay
protected int getTabRunOverlay(int tabPlacement) Returns the tab run overlay.- Parameters:
tabPlacement
- the placement (left, right, bottom, top) of the tab- Returns:
- the tab run overlay
-
getTabRunIndent
protected int getTabRunIndent(int tabPlacement, int run) Returns the tab run indent.- Parameters:
tabPlacement
- the placement (left, right, bottom, top) of the tabrun
- the tab run- Returns:
- the tab run indent
-
shouldPadTabRun
protected boolean shouldPadTabRun(int tabPlacement, int run) Returns whether or not the tab run should be padded.- Parameters:
tabPlacement
- the placement (left, right, bottom, top) of the tabrun
- the tab run- Returns:
- whether or not the tab run should be padded
-
shouldRotateTabRuns
protected boolean shouldRotateTabRuns(int tabPlacement) Returns whether or not the tab run should be rotated.- Parameters:
tabPlacement
- the placement (left, right, bottom, top) of the tab- Returns:
- whether or not the tab run should be rotated
-
getIconForTab
Returns the icon for a tab.- Parameters:
tabIndex
- the index of the tab- Returns:
- the icon for a tab
-
getTextViewForTab
Returns the text View object required to render stylized text (HTML) for the specified tab or null if no specialized text rendering is needed for this tab. This is provided to support html rendering inside tabs.- Parameters:
tabIndex
- the index of the tab- Returns:
- the text view to render the tab's text or null if no specialized rendering is required
- Since:
- 1.4
-
calculateTabHeight
protected int calculateTabHeight(int tabPlacement, int tabIndex, int fontHeight) Calculates the tab height.- Parameters:
tabPlacement
- the placement (left, right, bottom, top) of the tabtabIndex
- the index of the tab with respect to other tabsfontHeight
- the font height- Returns:
- the tab height
-
calculateMaxTabHeight
protected int calculateMaxTabHeight(int tabPlacement) Calculates the maximum tab height.- Parameters:
tabPlacement
- the placement (left, right, bottom, top) of the tab- Returns:
- the maximum tab height
-
calculateTabWidth
Calculates the tab width.- Parameters:
tabPlacement
- the placement (left, right, bottom, top) of the tabtabIndex
- the index of the tab with respect to other tabsmetrics
- the font metrics- Returns:
- the tab width
-
calculateMaxTabWidth
protected int calculateMaxTabWidth(int tabPlacement) Calculates the maximum tab width.- Parameters:
tabPlacement
- the placement (left, right, bottom, top) of the tab- Returns:
- the maximum tab width
-
calculateTabAreaHeight
protected int calculateTabAreaHeight(int tabPlacement, int horizRunCount, int maxTabHeight) Calculates the tab area height.- Parameters:
tabPlacement
- the placement (left, right, bottom, top) of the tabhorizRunCount
- horizontal run countmaxTabHeight
- maximum tab height- Returns:
- the tab area height
-
calculateTabAreaWidth
protected int calculateTabAreaWidth(int tabPlacement, int vertRunCount, int maxTabWidth) Calculates the tab area width.- Parameters:
tabPlacement
- the placement (left, right, bottom, top) of the tabvertRunCount
- vertical run countmaxTabWidth
- maximum tab width- Returns:
- the tab area width
-
getTabInsets
Returns the tab insets.- Parameters:
tabPlacement
- the placement (left, right, bottom, top) of the tabtabIndex
- the tab index- Returns:
- the tab insets
-
getSelectedTabPadInsets
Returns the selected tab pad insets.- Parameters:
tabPlacement
- the placement (left, right, bottom, top) of the tab- Returns:
- the selected tab pad insets
-
getTabAreaInsets
Returns the tab area insets.- Parameters:
tabPlacement
- the placement (left, right, bottom, top) of the tab- Returns:
- the pad area insets
-
getContentBorderInsets
Returns the content border insets.- Parameters:
tabPlacement
- the placement (left, right, bottom, top) of the tab- Returns:
- the content border insets
-
getFontMetrics
-
selectNextTabInRun
protected void selectNextTabInRun(int current) Selects the next tab in the run.- Parameters:
current
- the current tab
-
selectPreviousTabInRun
protected void selectPreviousTabInRun(int current) Selects the previous tab in the run.- Parameters:
current
- the current tab
-
selectNextTab
protected void selectNextTab(int current) Selects the next tab.- Parameters:
current
- the current tab
-
selectPreviousTab
protected void selectPreviousTab(int current) Selects the previous tab.- Parameters:
current
- the current tab
-
selectAdjacentRunTab
protected void selectAdjacentRunTab(int tabPlacement, int tabIndex, int offset) Selects an adjacent run of tabs.- Parameters:
tabPlacement
- the placement (left, right, bottom, top) of the tabtabIndex
- the index of the tab with respect to other tabsoffset
- selection offset
-
getFocusIndex
protected int getFocusIndex()Returns the index of the tab that has focus.- Returns:
- index of tab that has focus
- Since:
- 1.5
-
getTabRunOffset
protected int getTabRunOffset(int tabPlacement, int tabCount, int tabIndex, boolean forward) Returns the tab run offset.- Parameters:
tabPlacement
- the placement (left, right, bottom, top) of the tabtabCount
- the tab counttabIndex
- the index of the tab with respect to other tabsforward
- forward or not- Returns:
- the tab run offset
-
getPreviousTabIndex
protected int getPreviousTabIndex(int base) Returns the previous tab index.- Parameters:
base
- the base- Returns:
- the previous tab index
-
getNextTabIndex
protected int getNextTabIndex(int base) Returns the next tab index.- Parameters:
base
- the base- Returns:
- the next tab index
-
getNextTabIndexInRun
protected int getNextTabIndexInRun(int tabCount, int base) Returns the next tab index in the run.- Parameters:
tabCount
- the tab countbase
- the base- Returns:
- the next tab index in the run
-
getPreviousTabIndexInRun
protected int getPreviousTabIndexInRun(int tabCount, int base) Returns the previous tab index in the run.- Parameters:
tabCount
- the tab countbase
- the base- Returns:
- the previous tab index in the run
-
getPreviousTabRun
protected int getPreviousTabRun(int baseRun) Returns the previous tab run.- Parameters:
baseRun
- the base run- Returns:
- the previous tab run
-
getNextTabRun
protected int getNextTabRun(int baseRun) Returns the next tab run.- Parameters:
baseRun
- the base run- Returns:
- the next tab run
-
rotateInsets
-