javax.swing.plaf.basic
Class BasicTabbedPaneUI

java.lang.Object
  extended byjavax.swing.plaf.ComponentUI
      extended byjavax.swing.plaf.TabbedPaneUI
          extended byjavax.swing.plaf.basic.BasicTabbedPaneUI
All Implemented Interfaces:
SwingConstants
Direct Known Subclasses:
MetalTabbedPaneUI

public class BasicTabbedPaneUI
extends TabbedPaneUI
implements SwingConstants

A Basic L&F implementation of TabbedPaneUI.

Author:
Amy Fowler, Philip Milne, Steve Wilson, Tom Santos, Dave Moore

Nested Class Summary
private  class BasicTabbedPaneUI.ContainerHandler
           
private static class BasicTabbedPaneUI.DownAction
           
 class BasicTabbedPaneUI.FocusHandler
          This inner class is marked "public" due to a compiler bug.
private static class BasicTabbedPaneUI.LeftAction
           
 class BasicTabbedPaneUI.MouseHandler
          This inner class is marked "public" due to a compiler bug.
private static class BasicTabbedPaneUI.NextAction
           
private static class BasicTabbedPaneUI.PageDownAction
           
private static class BasicTabbedPaneUI.PageUpAction
           
private static class BasicTabbedPaneUI.PreviousAction
           
 class BasicTabbedPaneUI.PropertyChangeHandler
          This inner class is marked "public" due to a compiler bug.
private static class BasicTabbedPaneUI.RequestFocusAction
           
private static class BasicTabbedPaneUI.RequestFocusForVisibleAction
           
private static class BasicTabbedPaneUI.RightAction
           
private  class BasicTabbedPaneUI.ScrollableTabButton
           
private  class BasicTabbedPaneUI.ScrollableTabPanel
           
private  class BasicTabbedPaneUI.ScrollableTabSupport
           
private  class BasicTabbedPaneUI.ScrollableTabViewport
           
private static class BasicTabbedPaneUI.ScrollTabsBackwardAction
           
private static class BasicTabbedPaneUI.ScrollTabsForwardAction
           
private static class BasicTabbedPaneUI.SetSelectedIndexAction
          Selects a tab in the JTabbedPane based on the String of the action command.
 class BasicTabbedPaneUI.TabbedPaneLayout
          This inner class is marked "public" due to a compiler bug.
private  class BasicTabbedPaneUI.TabbedPaneScrollLayout
           
 class BasicTabbedPaneUI.TabSelectionHandler
          This inner class is marked "public" due to a compiler bug.
private static class BasicTabbedPaneUI.UpAction
           
 
Field Summary
protected  Rectangle calcRect
          A rectangle used for general layout calculations in order to avoid constructing many new Rectangles on the fly.
private  ContainerListener containerListener
           
protected  Insets contentBorderInsets
           
private static int CROP_SEGMENT
           
private  Insets currentPadInsets
           
private  Insets currentTabAreaInsets
           
protected  Color darkShadow
           
protected  KeyStroke downKey
          Deprecated. As of Java 2 platform v1.3.
protected  Color focus
           
protected  FocusListener focusListener
           
protected  Color highlight
           
private  Vector htmlViews
           
protected  KeyStroke leftKey
          Deprecated. As of Java 2 platform v1.3.
protected  Color lightHighlight
           
protected  int maxTabHeight
           
protected  int maxTabWidth
           
private  InputMap mnemonicInputMap
          InputMap used for mnemonics.
private  Hashtable mnemonicToIndexMap
           
protected  MouseListener mouseListener
           
protected  java.beans.PropertyChangeListener propertyChangeListener
           
protected  Rectangle[] rects
           
protected  KeyStroke rightKey
          Deprecated. As of Java 2 platform v1.3.
protected  int runCount
           
private  Color selectedColor
           
protected  int selectedRun
           
protected  Insets selectedTabPadInsets
           
protected  Color shadow
           
protected  Insets tabAreaInsets
           
protected  ChangeListener tabChangeListener
           
private  int tabCount
          Number of tabs.
protected  Insets tabInsets
           
protected  JTabbedPane tabPane
           
protected  int tabRunOverlay
           
protected  int[] tabRuns
           
private  BasicTabbedPaneUI.ScrollableTabSupport tabScroller
           
protected  int textIconGap
           
protected  KeyStroke upKey
          Deprecated. As of Java 2 platform v1.3.
private  Component visibleComponent
           
private  int[] xCropLen
           
private  int[] yCropLen
           
 
Fields inherited from 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
BasicTabbedPaneUI()
           
 
Method Summary
private  void addMnemonic(int index, int mnemonic)
          Adds the specified mnemonic at the specified index.
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)
           
(package private)  ActionMap createActionMap()
           
protected  ChangeListener createChangeListener()
           
private  Polygon createCroppedTabClip(int tabPlacement, Rectangle tabRect, int cropline)
           
protected  FocusListener createFocusListener()
           
private  Vector createHTMLVector()
           
protected  LayoutManager createLayoutManager()
          Invoked by installUI to create a layout manager object to manage the JTabbedPane.
protected  MouseListener createMouseListener()
           
protected  java.beans.PropertyChangeListener createPropertyChangeListener()
           
static ComponentUI createUI(JComponent c)
          Returns an instance of the UI delegate for the specified component.
private  void ensureCurrentLayout()
           
protected  void expandTabRunsArray()
           
(package private)  ActionMap getActionMap()
           
private  int getClosestTab(int x, int y)
          Returns the index of the tab closest to the passed in location, note that the returned tab may not contain the location x,y.
protected  Insets getContentBorderInsets(int tabPlacement)
           
protected  FontMetrics getFontMetrics()
           
protected  Icon getIconForTab(int tabIndex)
           
(package private)  InputMap getInputMap(int condition)
           
 Dimension getMaximumSize(JComponent c)
          Returns the specified component's maximum size appropriate for the look and feel.
 Dimension getMinimumSize(JComponent c)
          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)
           
 Dimension getPreferredSize(JComponent c)
          Returns the specified component's preferred size appropriate for the look and feel.
protected  int getPreviousTabIndex(int base)
           
protected  int getPreviousTabIndexInRun(int tabCount, int base)
           
protected  int getPreviousTabRun(int baseRun)
           
protected  int getRunForTab(int tabCount, int tabIndex)
           
protected  Insets getSelectedTabPadInsets(int tabPlacement)
           
protected  Insets getTabAreaInsets(int tabPlacement)
           
private  int getTabAtLocation(int x, int y)
          Returns the tab index which intersects the specified point in the coordinate space of the component where the tabs are actually rendered, which could be the JTabbedPane (for WRAP_TAB_LAYOUT) or a ScrollableTabPanel (SCROLL_TAB_LAYOUT).
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 getVisibleComponent()
           
private  void initMnemonics()
          Installs the state needed for mnemonics.
protected  void installComponents()
          Creates and installs any required subcomponents for the JTabbedPane.
protected  void installDefaults()
           
protected  void installKeyboardActions()
           
protected  void installListeners()
           
 void installUI(JComponent c)
          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)
           
private  void paintCroppedTabEdge(Graphics g, int tabPlacement, int tabIndex, boolean isSelected, int x, int y)
           
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)
          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 paintText(Graphics g, int tabPlacement, Font font, FontMetrics metrics, int tabIndex, String title, Rectangle textRect, boolean isSelected)
           
(package private)  boolean requestFocusForVisibleComponent()
           
private  void resetMnemonics()
          Resets the mnemonics bindings to an empty state.
protected static void rotateInsets(Insets topInsets, Insets targetInsets, int targetPlacement)
           
private  boolean scrollableTabLayoutEnabled()
           
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 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.
private  Point translatePointToTabPanel(int srcx, int srcy, Point dest)
          Returns a point which is translated from the specified point in the JTabbedPane's coordinate space to the coordinate space of the ScrollableTabPanel.
protected  void uninstallComponents()
          Removes any installed subcomponents from the JTabbedPane.
protected  void uninstallDefaults()
           
protected  void uninstallKeyboardActions()
           
protected  void uninstallListeners()
           
 void uninstallUI(JComponent c)
          Reverses configuration which was done on the specified component during installUI.
private  void updateMnemonics()
          Reloads the mnemonics.
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tabPane

protected JTabbedPane tabPane

highlight

protected Color highlight

lightHighlight

protected Color lightHighlight

shadow

protected Color shadow

darkShadow

protected Color darkShadow

focus

protected Color focus

selectedColor

private Color selectedColor

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

protected KeyStroke 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

protected KeyStroke 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

protected KeyStroke 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

protected KeyStroke 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[] tabRuns

runCount

protected int runCount

selectedRun

protected int selectedRun

rects

protected Rectangle[] rects

maxTabHeight

protected int maxTabHeight

maxTabWidth

protected int maxTabWidth

tabChangeListener

protected ChangeListener tabChangeListener

propertyChangeListener

protected java.beans.PropertyChangeListener propertyChangeListener

mouseListener

protected MouseListener mouseListener

focusListener

protected FocusListener focusListener

containerListener

private ContainerListener containerListener

currentPadInsets

private Insets currentPadInsets

currentTabAreaInsets

private Insets currentTabAreaInsets

visibleComponent

private Component visibleComponent

htmlViews

private Vector htmlViews

mnemonicToIndexMap

private Hashtable mnemonicToIndexMap

mnemonicInputMap

private InputMap mnemonicInputMap
InputMap used for mnemonics. Only non-null if the JTabbedPane has mnemonics associated with it. Lazily created in initMnemonics.


tabScroller

private BasicTabbedPaneUI.ScrollableTabSupport tabScroller

calcRect

protected transient Rectangle calcRect
A rectangle used for general layout calculations in order to avoid constructing many new Rectangles on the fly.


tabCount

private int tabCount
Number of tabs. When the count differs, the mnemonics are updated.


xCropLen

private int[] xCropLen

yCropLen

private int[] yCropLen

CROP_SEGMENT

private static final int CROP_SEGMENT
See Also:
Constant Field Values
Constructor Detail

BasicTabbedPaneUI

public BasicTabbedPaneUI()
Method Detail

createUI

public static ComponentUI createUI(JComponent c)
Description copied from class: ComponentUI
Returns an instance of the UI delegate for the specified component. Each subclass must provide its own static createUI method that returns an instance of that UI delegate subclass. If the UI delegate subclass is stateless, it may return an instance that is shared by multiple components. If the UI delegate is stateful, then it should return a new instance per component. The default implementation of this method throws an error, as it should never be invoked.


installUI

public void installUI(JComponent c)
Description copied from class: ComponentUI
Configures the specified component appropriate for the look and feel. This method is invoked when the ComponentUI instance is being installed as the UI delegate on the specified component. This method should completely configure the component for the look and feel, including the following:
  1. Install any default property values for color, fonts, borders, icons, opacity, etc. on the component. Whenever possible, property values initialized by the client program should not be overridden.
  2. Install a LayoutManager on the component if necessary.
  3. Create/add any required sub-components to the component.
  4. Create/install event listeners on the component.
  5. Create/install a PropertyChangeListener on the component in order to detect and respond to component property changes appropriately.
  6. Install keyboard UI (mnemonics, traversal, etc.) on the component.
  7. Initialize any appropriate instance data.

Overrides:
installUI in class ComponentUI
Parameters:
c - the component where this UI delegate is being installed
See Also:
ComponentUI.uninstallUI(javax.swing.JComponent), JComponent.setUI(javax.swing.plaf.ComponentUI), JComponent.updateUI()

uninstallUI

public void uninstallUI(JComponent c)
Description copied from class: ComponentUI
Reverses configuration which was done on the specified component during installUI. This method is invoked when this UIComponent instance is being removed as the UI delegate for the specified component. This method should undo the configuration performed in installUI, being careful to leave the JComponent instance in a clean state (no extraneous listeners, look-and-feel-specific property objects, etc.). This should include the following:
  1. Remove any UI-set borders from the component.
  2. Remove any UI-set layout managers on the component.
  3. Remove any UI-added sub-components from the component.
  4. Remove any UI-added event/property listeners from the component.
  5. Remove any UI-installed keyboard UI from the component.
  6. Nullify any allocated instance data objects to allow for GC.

Overrides:
uninstallUI in class ComponentUI
Parameters:
c - the component from which this UI delegate is being removed; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
See Also:
ComponentUI.installUI(javax.swing.JComponent), JComponent.updateUI()

createLayoutManager

protected LayoutManager createLayoutManager()
Invoked by installUI to create a layout manager object to manage the JTabbedPane.

Returns:
a layout manager object
See Also:
BasicTabbedPaneUI.TabbedPaneLayout, JTabbedPane.getTabLayoutPolicy()

scrollableTabLayoutEnabled

private boolean scrollableTabLayoutEnabled()

installComponents

protected void installComponents()
Creates and installs any required subcomponents for the JTabbedPane. Invoked by installUI.

Since:
1.4

uninstallComponents

protected void uninstallComponents()
Removes any installed subcomponents from the JTabbedPane. Invoked by uninstallUI.

Since:
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 java.beans.PropertyChangeListener createPropertyChangeListener()

installKeyboardActions

protected void installKeyboardActions()

getInputMap

InputMap getInputMap(int condition)

getActionMap

ActionMap getActionMap()

createActionMap

ActionMap createActionMap()

uninstallKeyboardActions

protected void uninstallKeyboardActions()

updateMnemonics

private void updateMnemonics()
Reloads the mnemonics. This should be invoked when a memonic changes, when the title of a mnemonic changes, or when tabs are added/removed.


resetMnemonics

private void resetMnemonics()
Resets the mnemonics bindings to an empty state.


addMnemonic

private void addMnemonic(int index,
                         int mnemonic)
Adds the specified mnemonic at the specified index.


initMnemonics

private void initMnemonics()
Installs the state needed for mnemonics.


getPreferredSize

public Dimension getPreferredSize(JComponent c)
Description copied from class: ComponentUI
Returns the specified component's preferred size appropriate for the look and feel. If null is returned, the preferred size will be calculated by the component's layout manager instead (this is the preferred approach for any component with a specific layout manager installed). The default implementation of this method returns null.

Overrides:
getPreferredSize in class ComponentUI
Parameters:
c - the component whose preferred size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
See Also:
JComponent.getPreferredSize(), LayoutManager.preferredLayoutSize(java.awt.Container)

getMinimumSize

public Dimension getMinimumSize(JComponent c)
Description copied from class: ComponentUI
Returns the specified component's minimum size appropriate for the look and feel. If null is returned, the minimum size will be calculated by the component's layout manager instead (this is the preferred approach for any component with a specific layout manager installed). The default implementation of this method invokes getPreferredSize and returns that value.

Overrides:
getMinimumSize in class ComponentUI
Parameters:
c - the component whose minimum size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
Returns:
a Dimension object or null
See Also:
JComponent.getMinimumSize(), LayoutManager.minimumLayoutSize(java.awt.Container), ComponentUI.getPreferredSize(javax.swing.JComponent)

getMaximumSize

public Dimension getMaximumSize(JComponent c)
Description copied from class: ComponentUI
Returns the specified component's maximum size appropriate for the look and feel. If null is returned, the maximum size will be calculated by the component's layout manager instead (this is the preferred approach for any component with a specific layout manager installed). The default implementation of this method invokes getPreferredSize and returns that value.

Overrides:
getMaximumSize in class ComponentUI
Parameters:
c - the component whose maximum size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
Returns:
a Dimension object or null
See Also:
JComponent.getMaximumSize(), LayoutManager2.maximumLayoutSize(java.awt.Container)

paint

public void paint(Graphics g,
                  JComponent c)
Description copied from class: ComponentUI
Paints the specified component appropriate for the look and feel. This method is invoked from the ComponentUI.update method when the specified component is being painted. Subclasses should override this method and use the specified Graphics object to render the content of the component.

Overrides:
paint in class ComponentUI
Parameters:
g - the Graphics context in which to paint
c - the component being painted; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
See Also:
ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)

paintTabArea

protected void paintTabArea(Graphics g,
                            int tabPlacement,
                            int selectedIndex)
Paints the tabs in the tab area. Invoked by paint(). The graphics parameter must be a valid 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.

Parameters:
g - the graphics object to use for rendering
tabPlacement - the placement for the tabs within the JTabbedPane
selectedIndex - 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)

createCroppedTabClip

private Polygon createCroppedTabClip(int tabPlacement,
                                     Rectangle tabRect,
                                     int cropline)

paintCroppedTabEdge

private void paintCroppedTabEdge(Graphics g,
                                 int tabPlacement,
                                 int tabIndex,
                                 boolean isSelected,
                                 int x,
                                 int y)

layoutLabel

protected void layoutLabel(int tabPlacement,
                           FontMetrics metrics,
                           int tabIndex,
                           String title,
                           Icon icon,
                           Rectangle tabRect,
                           Rectangle iconRect,
                           Rectangle textRect,
                           boolean isSelected)

paintIcon

protected void paintIcon(Graphics g,
                         int tabPlacement,
                         int tabIndex,
                         Icon icon,
                         Rectangle iconRect,
                         boolean isSelected)

paintText

protected void paintText(Graphics g,
                         int tabPlacement,
                         Font font,
                         FontMetrics metrics,
                         int tabIndex,
                         String title,
                         Rectangle textRect,
                         boolean isSelected)

getTabLabelShiftX

protected int getTabLabelShiftX(int tabPlacement,
                                int tabIndex,
                                boolean isSelected)

getTabLabelShiftY

protected int getTabLabelShiftY(int tabPlacement,
                                int tabIndex,
                                boolean isSelected)

paintFocusIndicator

protected void paintFocusIndicator(Graphics g,
                                   int tabPlacement,
                                   Rectangle[] rects,
                                   int tabIndex,
                                   Rectangle iconRect,
                                   Rectangle textRect,
                                   boolean isSelected)

paintTabBorder

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. that is done elsewhere


paintTabBackground

protected void paintTabBackground(Graphics g,
                                  int tabPlacement,
                                  int tabIndex,
                                  int x,
                                  int y,
                                  int w,
                                  int h,
                                  boolean isSelected)

paintContentBorder

protected void paintContentBorder(Graphics g,
                                  int tabPlacement,
                                  int selectedIndex)

paintContentBorderTopEdge

protected void paintContentBorderTopEdge(Graphics g,
                                         int tabPlacement,
                                         int selectedIndex,
                                         int x,
                                         int y,
                                         int w,
                                         int h)

paintContentBorderLeftEdge

protected void paintContentBorderLeftEdge(Graphics g,
                                          int tabPlacement,
                                          int selectedIndex,
                                          int x,
                                          int y,
                                          int w,
                                          int h)

paintContentBorderBottomEdge

protected void paintContentBorderBottomEdge(Graphics g,
                                            int tabPlacement,
                                            int selectedIndex,
                                            int x,
                                            int y,
                                            int w,
                                            int h)

paintContentBorderRightEdge

protected void paintContentBorderRightEdge(Graphics g,
                                           int tabPlacement,
                                           int selectedIndex,
                                           int x,
                                           int y,
                                           int w,
                                           int h)

ensureCurrentLayout

private void ensureCurrentLayout()

getTabBounds

public Rectangle getTabBounds(JTabbedPane pane,
                              int i)
Returns the bounds of the specified tab index. The bounds are with respect to the JTabbedPane's coordinate space.

Specified by:
getTabBounds in class TabbedPaneUI

getTabRunCount

public int getTabRunCount(JTabbedPane pane)
Specified by:
getTabRunCount in class TabbedPaneUI

tabForCoordinate

public int tabForCoordinate(JTabbedPane pane,
                            int x,
                            int y)
Returns the tab index which intersects the specified point in the JTabbedPane's coordinate space.

Specified by:
tabForCoordinate in class TabbedPaneUI

getTabBounds

protected Rectangle getTabBounds(int tabIndex,
                                 Rectangle dest)
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 valid Rectangle instance. The handling of invalid parameters is unspecified.

Parameters:
tabIndex - the index of the tab
dest - the rectangle where the result should be placed
Returns:
the resulting rectangle
Since:
1.4

getTabAtLocation

private int getTabAtLocation(int x,
                             int y)
Returns the tab index which intersects the specified point in the coordinate space of the component where the tabs are actually rendered, which could be the JTabbedPane (for WRAP_TAB_LAYOUT) or a ScrollableTabPanel (SCROLL_TAB_LAYOUT).


getClosestTab

private int getClosestTab(int x,
                          int y)
Returns the index of the tab closest to the passed in location, note that the returned tab may not contain the location x,y.


translatePointToTabPanel

private Point translatePointToTabPanel(int srcx,
                                       int srcy,
                                       Point dest)
Returns a point which is translated from the specified point in the JTabbedPane's coordinate space to the coordinate space of the ScrollableTabPanel. This is used for SCROLL_TAB_LAYOUT ONLY.


getVisibleComponent

protected Component getVisibleComponent()

setVisibleComponent

protected void setVisibleComponent(Component component)

assureRectsCreated

protected void assureRectsCreated(int tabCount)

expandTabRunsArray

protected void expandTabRunsArray()

getRunForTab

protected int getRunForTab(int tabCount,
                           int tabIndex)

lastTabInRun

protected int lastTabInRun(int tabCount,
                           int run)

getTabRunOverlay

protected int getTabRunOverlay(int tabPlacement)

getTabRunIndent

protected int getTabRunIndent(int tabPlacement,
                              int run)

shouldPadTabRun

protected boolean shouldPadTabRun(int tabPlacement,
                                  int run)

shouldRotateTabRuns

protected boolean shouldRotateTabRuns(int tabPlacement)

getIconForTab

protected Icon getIconForTab(int tabIndex)

getTextViewForTab

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. 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)

calculateMaxTabHeight

protected int calculateMaxTabHeight(int tabPlacement)

calculateTabWidth

protected int calculateTabWidth(int tabPlacement,
                                int tabIndex,
                                FontMetrics metrics)

calculateMaxTabWidth

protected int calculateMaxTabWidth(int tabPlacement)

calculateTabAreaHeight

protected int calculateTabAreaHeight(int tabPlacement,
                                     int horizRunCount,
                                     int maxTabHeight)

calculateTabAreaWidth

protected int calculateTabAreaWidth(int tabPlacement,
                                    int vertRunCount,
                                    int maxTabWidth)

getTabInsets

protected Insets getTabInsets(int tabPlacement,
                              int tabIndex)

getSelectedTabPadInsets

protected Insets getSelectedTabPadInsets(int tabPlacement)

getTabAreaInsets

protected Insets getTabAreaInsets(int tabPlacement)

getContentBorderInsets

protected Insets getContentBorderInsets(int tabPlacement)

getFontMetrics

protected FontMetrics getFontMetrics()

navigateSelectedTab

protected void navigateSelectedTab(int direction)

selectNextTabInRun

protected void selectNextTabInRun(int current)

selectPreviousTabInRun

protected void selectPreviousTabInRun(int current)

selectNextTab

protected void selectNextTab(int current)

selectPreviousTab

protected void selectPreviousTab(int current)

selectAdjacentRunTab

protected void selectAdjacentRunTab(int tabPlacement,
                                    int tabIndex,
                                    int offset)

getTabRunOffset

protected int getTabRunOffset(int tabPlacement,
                              int tabCount,
                              int tabIndex,
                              boolean forward)

getPreviousTabIndex

protected int getPreviousTabIndex(int base)

getNextTabIndex

protected int getNextTabIndex(int base)

getNextTabIndexInRun

protected int getNextTabIndexInRun(int tabCount,
                                   int base)

getPreviousTabIndexInRun

protected int getPreviousTabIndexInRun(int tabCount,
                                       int base)

getPreviousTabRun

protected int getPreviousTabRun(int baseRun)

getNextTabRun

protected int getNextTabRun(int baseRun)

rotateInsets

protected static void rotateInsets(Insets topInsets,
                                   Insets targetInsets,
                                   int targetPlacement)

requestFocusForVisibleComponent

boolean requestFocusForVisibleComponent()

createHTMLVector

private Vector createHTMLVector()