| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
A Basic L&F implementation of TabbedPaneUI.
Nested Class Summary | |
---|---|
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. |
class |
This class should be treated as a "protected" inner class. |
Field Summary | |
---|---|
protected transient Rectangle |
calcRect
A rectangle used for general layout calculations in order to avoid constructing many new Rectangles on the fly. |
protected Insets |
contentBorderInsets
|
protected Color |
darkShadow
|
protected KeyStroke |
downKey
As of Java 2 platform v1.3 this previously undocumented field is no longer used. |
protected Color |
focus
|
protected FocusListener |
focusListener
|
protected Color |
highlight
|
protected KeyStroke |
leftKey
As of Java 2 platform v1.3 this previously undocumented field is no longer used. |
protected Color |
lightHighlight
|
protected int |
maxTabHeight
|
protected int |
maxTabWidth
|
protected MouseListener |
mouseListener
|
protected PropertyChangeListener |
propertyChangeListener
|
protected Rectangle[] |
rects
|
protected KeyStroke |
rightKey
As of Java 2 platform v1.3 this previously undocumented field is no longer used. |
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
As of Java 2 platform v1.3 this previously undocumented field is no longer used. |
Constructor Summary | |
---|---|
|
Method Summary | |
---|---|
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 |
|
protected FocusListener |
|
protected LayoutManager |
Invoked by installUI to create
a layout manager object to manage
the JTabbedPane .
|
protected MouseListener |
|
protected PropertyChangeListener |
|
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 |
|
protected void |
|
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. |
Component.BaselineResizeBehavior |
Returns an enum indicating how the baseline of the component changes as the size changes. |
protected Insets |
getContentBorderInsets(int tabPlacement) |
protected int |
Returns the index of the tab that has focus. |
protected FontMetrics |
|
protected Icon |
getIconForTab(int tabIndex) |
Dimension |
Returns the specified component's maximum size appropriate for the look and feel. |
Dimension |
Returns the specified component's minimum size appropriate for the look and feel. |
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 |
Returns the tab the mouse is currently over, or if the mouse is no longer over any tab. |
protected int |
getRunForTab(int tabCount, int tabIndex) |
protected Insets |
getSelectedTabPadInsets(int tabPlacement) |
protected Insets |
getTabAreaInsets(int tabPlacement) |
protected Rectangle |
getTabBounds(int tabIndex, Rectangle dest) Returns the bounds of the specified tab in the coordinate space of the JTabbedPane component. |
Rectangle |
getTabBounds(JTabbedPane pane, int i) Returns the bounds of the specified tab index. |
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) 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 |
|
protected void |
Creates and installs any required subcomponents for the JTabbedPane. |
protected void |
|
protected void |
|
protected void |
|
void |
Configures the specified component appropriate for the look and feel. |
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) Paints the specified component appropriate for the look and feel. |
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 |
|
protected void |
|
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) |
protected void |
paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) this function draws the border around each tab note that this function does now draw the background of the tab. |
protected void |
|
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) Sets the tab the mouse is currently over to 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) 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 |
|
protected void |
|
protected void |
|
void |
Reverses configuration which was done on the specified component during installUI .
|
Methods inherited from class javax.swing.plaf.TabbedPaneUI |
---|
getTabBounds, getTabRunCount, tabForCoordinate |
Methods inherited from class javax.swing.plaf.ComponentUI |
---|
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, installUI, paint, uninstallUI, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected transient Rectangle calcRect
protected Insets contentBorderInsets
protected Color darkShadow
protected KeyStroke downKey
protected Color focus
protected FocusListener focusListener
protected Color highlight
protected KeyStroke leftKey
protected Color lightHighlight
protected int maxTabHeight
protected int maxTabWidth
protected MouseListener mouseListener
protected PropertyChangeListener propertyChangeListener
protected Rectangle[] rects
protected KeyStroke rightKey
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
Constructor Detail |
---|
public BasicTabbedPaneUI()
Method Detail |
---|
protected void assureRectsCreated(int tabCount)
tabCount
protected int calculateMaxTabHeight(int tabPlacement)
tabPlacement
protected int calculateMaxTabWidth(int tabPlacement)
tabPlacement
protected int calculateTabAreaHeight(int tabPlacement, int horizRunCount, int maxTabHeight)
tabPlacement
horizRunCount
maxTabHeight
protected int calculateTabAreaWidth(int tabPlacement, int vertRunCount, int maxTabWidth)
tabPlacement
vertRunCount
maxTabWidth
protected int calculateTabHeight(int tabPlacement, int tabIndex, int fontHeight)
tabPlacement
tabIndex
fontHeight
protected int calculateTabWidth(int tabPlacement, int tabIndex, FontMetrics metrics)
tabPlacement
tabIndex
metrics
protected ChangeListener createChangeListener()
protected FocusListener createFocusListener()
protected LayoutManager createLayoutManager()
installUI
to create
a layout manager object to manage
the JTabbedPane
.
protected MouseListener createMouseListener()
protected PropertyChangeListener createPropertyChangeListener()
protected JButton createScrollButton(int direction)
direction
- One of the SwingConstants constants:
SOUTH, NORTH, EAST or WESTpublic static ComponentUI createUI(JComponent c)
c
protected void expandTabRunsArray()
protected int getBaseline(int tab)
tab
- index of tab to get baseline forpublic int getBaseline(JComponent c, int width, int height)
getBaseline
in class ComponentUI
c
width
height
protected int getBaselineOffset()
getTabLabelShiftY
.
public Component.BaselineResizeBehavior getBaselineResizeBehavior(JComponent c)
getBaselineResizeBehavior
in class ComponentUI
c
protected Insets getContentBorderInsets(int tabPlacement)
tabPlacement
protected int getFocusIndex()
protected FontMetrics getFontMetrics()
protected Icon getIconForTab(int tabIndex)
tabIndex
public Dimension getMaximumSize(JComponent c)
getMaximumSize
in class ComponentUI
c
public Dimension getMinimumSize(JComponent c)
getMinimumSize
in class ComponentUI
c
protected int getNextTabIndex(int base)
base
protected int getNextTabIndexInRun(int tabCount, int base)
tabCount
base
protected int getNextTabRun(int baseRun)
baseRun
protected int getPreviousTabIndex(int base)
base
protected int getPreviousTabIndexInRun(int tabCount, int base)
tabCount
base
protected int getPreviousTabRun(int baseRun)
baseRun
protected int getRolloverTab()
protected int getRunForTab(int tabCount, int tabIndex)
tabCount
tabIndex
protected Insets getSelectedTabPadInsets(int tabPlacement)
tabPlacement
protected Insets getTabAreaInsets(int tabPlacement)
tabPlacement
protected Rectangle getTabBounds(int tabIndex, Rectangle dest)
Rectangle
instance.
The handling of invalid parameters is unspecified.
tabIndex
- the index of the tabdest
- the rectangle where the result should be placedpublic Rectangle getTabBounds(JTabbedPane pane, int i)
getTabBounds
in class TabbedPaneUI
pane
i
protected Insets getTabInsets(int tabPlacement, int tabIndex)
tabPlacement
tabIndex
protected int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected)
tabPlacement
tabIndex
isSelected
protected int getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected)
tabPlacement
tabIndex
isSelected
public int getTabRunCount(JTabbedPane pane)
getTabRunCount
in class TabbedPaneUI
pane
protected int getTabRunIndent(int tabPlacement, int run)
tabPlacement
run
protected int getTabRunOffset(int tabPlacement, int tabCount, int tabIndex, boolean forward)
tabPlacement
tabCount
tabIndex
forward
protected int getTabRunOverlay(int tabPlacement)
tabPlacement
protected View getTextViewForTab(int tabIndex)
tabIndex
- the index of the tabprotected Component getVisibleComponent()
protected void installComponents()
protected void installDefaults()
protected void installKeyboardActions()
protected void installListeners()
public void installUI(JComponent c)
installUI
in class ComponentUI
c
protected int lastTabInRun(int tabCount, int run)
tabCount
run
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
protected void navigateSelectedTab(int direction)
direction
public void paint(Graphics g, JComponent c)
paint
in class ComponentUI
g
c
protected void paintContentBorder(Graphics g, int tabPlacement, int selectedIndex)
g
tabPlacement
selectedIndex
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
g
tabPlacement
selectedIndex
x
y
w
h
protected void paintContentBorderLeftEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
g
tabPlacement
selectedIndex
x
y
w
h
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
g
tabPlacement
selectedIndex
x
y
w
h
protected void paintContentBorderTopEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
g
tabPlacement
selectedIndex
x
y
w
h
protected void paintFocusIndicator(Graphics g, int tabPlacement, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect, boolean isSelected)
g
tabPlacement
rects
tabIndex
iconRect
textRect
isSelected
protected void paintIcon(Graphics g, int tabPlacement, int tabIndex, Icon icon, Rectangle iconRect, boolean isSelected)
g
tabPlacement
tabIndex
icon
iconRect
isSelected
protected void paintTab(Graphics g, int tabPlacement, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect)
g
tabPlacement
rects
tabIndex
iconRect
textRect
protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex)
Graphics
object. Tab placement may be either:
JTabbedPane.TOP
, JTabbedPane.BOTTOM
,
JTabbedPane.LEFT
, or JTabbedPane.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.
g
- the graphics object to use for renderingtabPlacement
- the placement for the tabs within the JTabbedPaneselectedIndex
- the tab index of the selected componentprotected void paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
g
tabPlacement
tabIndex
x
y
w
h
isSelected
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
g
tabPlacement
tabIndex
x
y
w
h
isSelected
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
protected static void rotateInsets(Insets topInsets, Insets targetInsets, int targetPlacement)
topInsets
targetInsets
targetPlacement
protected void selectAdjacentRunTab(int tabPlacement, int tabIndex, int offset)
tabPlacement
tabIndex
offset
protected void selectNextTab(int current)
current
protected void selectNextTabInRun(int current)
current
protected void selectPreviousTab(int current)
current
protected void selectPreviousTabInRun(int current)
current
protected void setRolloverTab(int index)
index
.
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.
index
- Index of the tab the mouse is over.protected void setVisibleComponent(Component component)
component
protected boolean shouldPadTabRun(int tabPlacement, int run)
tabPlacement
run
protected boolean shouldRotateTabRuns(int tabPlacement)
tabPlacement
public int tabForCoordinate(JTabbedPane pane, int x, int y)
tabForCoordinate
in class TabbedPaneUI
pane
x
y
protected void uninstallComponents()
protected void uninstallDefaults()
protected void uninstallKeyboardActions()
protected void uninstallListeners()
public void uninstallUI(JComponent c)
uninstallUI
in class ComponentUI
c
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |