JIDE 3.5.15

com.jidesoft.plaf.basic
Class BasicJideTabbedPaneUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.TabbedPaneUI
          extended by com.jidesoft.plaf.JideTabbedPaneUI
              extended by com.jidesoft.plaf.basic.BasicJideTabbedPaneUI
All Implemented Interfaces:
EventListener, DocumentListener, SwingConstants
Direct Known Subclasses:
VsnetJideTabbedPaneUI

public class BasicJideTabbedPaneUI
extends JideTabbedPaneUI
implements SwingConstants, DocumentListener

A basic L&f implementation of JideTabbedPaneUI


Nested Class Summary
protected  class BasicJideTabbedPaneUI.ActivateTabAction
           
 class BasicJideTabbedPaneUI.DefaultMouseHandler
           
 class BasicJideTabbedPaneUI.DefaultMouseMotionHandler
           
 class BasicJideTabbedPaneUI.MouseHandler
          This inner class is marked "public" due to a compiler bug.
 class BasicJideTabbedPaneUI.MouseMotionHandler
           
 class BasicJideTabbedPaneUI.MouseWheelHandler
           
 class BasicJideTabbedPaneUI.PropertyChangeHandler
          This inner class is marked "public" due to a compiler bug.
 class BasicJideTabbedPaneUI.RolloverMouseHandler
           
 class BasicJideTabbedPaneUI.RolloverMouseMotionHandler
           
 class BasicJideTabbedPaneUI.ScrollableTabPanel
           
 class BasicJideTabbedPaneUI.ScrollableTabSupport
           
 class BasicJideTabbedPaneUI.ScrollableTabViewport
           
 class BasicJideTabbedPaneUI.TabbedPaneLayout
          This inner class is marked "public" due to a compiler bug.
protected  class BasicJideTabbedPaneUI.TabbedPaneScrollLayout
           
 class BasicJideTabbedPaneUI.TabCloseButton
          Deprecated. replaced by JideTabbedPane.NoFocusButton
protected  class BasicJideTabbedPaneUI.TabEditor
           
 class BasicJideTabbedPaneUI.TabFocusListener
           
 class BasicJideTabbedPaneUI.TabSelectionHandler
          This inner class is marked "public" due to a compiler bug.
static class BasicJideTabbedPaneUI.TabSpaceAllocator
           
 
Field Summary
protected  Color _activeBackground
           
protected  Color _activeTabForeground
           
protected  int _additionalWidth
           
protected  boolean _alwaysShowLineBorder
           
protected  Color _background
           
protected  int _buttonMargin
           
protected  int _buttonSize
           
protected  Rectangle _calcRect
          A rectangle used for general layout calculations in order to avoid constructing many new Rectangles on the fly.
protected  int _closeButtonAlignment
           
protected  Color _closeButtonColor
           
protected  int _closeButtonLeftMargin
           
protected  int _closeButtonMargin
           
protected  int _closeButtonMarginHorizon
           
protected  int _closeButtonMarginSize
           
protected  int _closeButtonMarginVertical
           
protected  int _closeButtonRightMargin
           
protected  JButton[] _closeButtons
           
protected  Color _closeButtonSelectedColor
           
protected  int _compressedStyleCloseButtonMarginHorizon
           
protected  int _compressedStyleCloseButtonMarginVertical
           
protected  int _compressedStyleIconMargin
           
protected  int _compressedStyleNoIconRectSize
           
protected  Color _darkShadow
           
protected  Color _defaultTabBorderShadowColor
           
 DropTarget _dt
           
protected  int _editingTab
           
protected  int _fitStyleBoundSize
           
protected  int _fitStyleFirstTabMargin
           
protected  int _fitStyleIconMinWidth
           
protected  int _fitStyleTextMinWidth
           
protected  int _fixedStyleRectSize
           
protected  Color _focus
           
protected  int _gripLeftMargin
           
protected  int _gripperHeight
           
protected  int _gripperWidth
           
protected  Color _highlight
           
protected  int _iconMargin
           
protected  boolean _ignoreContentBorderInsetsIfNoTabs
           
protected  Color _inactiveSelectedTabForeground
           
protected  Color _inactiveTabForeground
           
protected  int _indexMouseOver
           
protected  boolean _isEditing
           
protected  Color _lightHighlight
           
protected  int _maxTabHeight
           
protected  int _maxTabWidth
           
protected  boolean _mouseEnter
           
protected  MouseListener _mouseListener
           
protected  MouseMotionListener _mousemotionListener
           
protected  MouseWheelListener _mouseWheelListener
           
protected  int _noIconMargin
           
protected  Color _officeTabBorderColor
           
protected  String _oldPostfix
           
protected  String _oldPrefix
           
protected  String _oldValue
           
protected  Component _originalFocusComponent
           
protected  Color _popupColor
           
protected  PropertyChangeListener _propertyChangeListener
           
protected  Rectangle[] _rects
           
protected  int _rectSizeExtend
           
protected  int _runCount
           
protected  Color _selectColor1
           
protected  Color _selectColor2
           
protected  Color _selectColor3
           
protected  Color _selectedColor
           
protected  int _selectedRun
           
protected  Font _selectedTabFont
           
protected  Insets _selectedTabPadInsets
           
protected  Color _shadow
           
protected  boolean _showCloseButtonOnTab
           
protected  boolean _showFocusIndicator
           
protected  boolean _showIconOnTab
           
protected  Insets _tabAreaInsets
           
protected  Color _tabBackground
           
protected  ChangeListener _tabChangeListener
           
protected  int _tabCount
          Number of tabs.
protected  BasicJideTabbedPaneUI.TabEditor _tabEditor
           
protected  FocusListener _tabFocusListener
           
protected  Insets _tabInsets
           
protected  Component _tabLeadingComponent
           
protected  Color _tabListBackground
           
protected  ChangeListener _tabModelChangeListener
           
protected  JideTabbedPane _tabPane
           
protected  int _tabRectPadding
           
protected  int _tabRunOverlay
           
protected  int[] _tabRuns
           
 BasicJideTabbedPaneUI.ScrollableTabSupport _tabScroller
           
protected  Component _tabTrailingComponent
           
protected  int _textIconGap
           
protected  int _textMarginVertical
           
protected  int _textPadding
           
protected  Color _unselectColor1
           
protected  Color _unselectColor2
           
protected  Color _unselectColor3
           
static String BUTTON_NAME_CLOSE
           
static String BUTTON_NAME_SCROLL_BACKWARD
           
static String BUTTON_NAME_SCROLL_FORWARD
           
static String BUTTON_NAME_TAB_LIST
           
static int DEFAULT_LEFT_MARGIN
           
static int EXCEL_LEFT_MARGIN
           
static int OFFICE2003_LEFT_MARGIN
           
protected  boolean PAINT_CONTENT_BORDER
           
protected  boolean PAINT_CONTENT_BORDER_EDGE
           
protected  boolean PAINT_TAB
           
protected  boolean PAINT_TAB_BACKGROUND
           
protected  boolean PAINT_TAB_BORDER
           
protected  boolean PAINT_TABAREA
           
protected  Polygon tabRegion
           
protected  BasicJideTabbedPaneUI.TabSpaceAllocator tryTabSpacer
           
 
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
BasicJideTabbedPaneUI()
           
 
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, FontMetrics metrics)
           
protected  int calculateTabWidth(int tabPlacement, int tabIndex, FontMetrics metrics)
           
 void cancelTabEditing()
          Cancels the editing and discards the change.
 void changedUpdate(DocumentEvent e)
           
protected  ChangeListener createChangeListener()
           
protected  BasicJideTabbedPaneUI.TabEditor createDefaultTabEditor()
           
protected  com.jidesoft.plaf.basic.BasicJideTabbedPaneUI.DropListener createDropListener()
           
protected  FocusListener createFocusListener()
           
protected  LayoutManager createLayoutManager()
          Invoked by installUI to create a layout manager object to manage the JTabbedPane.
protected  MouseListener createMouseListener()
           
protected  MouseMotionListener createMouseMotionListener()
           
protected  MouseWheelListener createMouseWheelListener()
           
protected  BasicJideTabbedPaneUI.TabCloseButton createNoFocusButton(int type)
          Deprecated. replaced by JideTabbedPane.createNoFocusButton(int)
protected  PropertyChangeListener createPropertyChangeListener()
           
static ComponentUI createUI(JComponent c)
           
 boolean editTabAt(int tabIndex)
          Edits the tab at the index.
 void ensureActiveTabIsVisible(boolean scrollLeft)
          Scroll the selected tab visible in case the tab is outside of the viewport.
 void ensureCloseButtonCreated()
           
protected  void ensureCurrentLayout()
           
protected  void ensureCurrentRects(int leftMargin, int tabCount)
           
protected  void expandTabRunsArray()
           
protected  Color getBorderEdgeColor()
           
protected  int getColorTheme()
           
protected  Insets getContentBorderInsets(int tabPlacement)
           
protected  String getCurrentDisplayTitleAt(JideTabbedPane tp, int index)
           
 int getEditingTabIndex()
          Gets the tab index that is editing, if any.
protected  FontMetrics getFontMetrics(int tab)
           
protected  int getLayoutSize()
           
protected  int getLeftMargin()
           
 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)
           
 ThemePainter getPainter()
           
 Dimension getPreferredSize(JComponent c)
           
protected  int getPreviousTabIndex(int base)
           
protected  int getPreviousTabIndexInRun(int tabCount, int base)
           
protected  int getPreviousTabRun(int baseRun)
           
protected  String getResourceString(String key)
          Gets the resource string used in JideTabbedPane.
protected  int getRunForTab(int tabCount, int tabIndex)
           
protected  Insets getSelectedTabPadInsets(int tabPlacement)
           
protected  Insets getTabAreaInsets(int tabPlacement)
           
 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  int getTabGap()
           
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)
           
protected  ListCellRenderer getTabListCellRenderer()
           
 Component getTabPanel()
          Gets the tab panel for the JideTabbedPane.
protected  int getTabResizeMode()
           
protected  int getTabRightPadding()
           
 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  int getTabShape()
           
protected  Rectangle getTabsTextBoundsAt(int tabIndex)
           
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()
           
 void insertUpdate(DocumentEvent e)
           
 void installColorTheme()
           
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)
           
 boolean isEmptyTabArea(int x, int y)
          Returns if the point resides in the empty tab area, which means it is in the tab area however no real tab contains that point.
protected  boolean isRoundedCorner()
           
protected  boolean isShowCloseButton()
           
protected  boolean isShowCloseButtonOnTab()
           
protected  boolean isShowTabButtons()
           
protected  boolean isShrinkTabs()
           
 boolean isTabEditing()
          Checks if the tab is being edited.
protected  boolean isTabLeadingComponentVisible()
           
protected  boolean isTabTopVisible(int tabPlacement)
           
protected  boolean isTabTrailingComponentVisible()
           
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)
           
 void paintBackground(Graphics g, Component c)
           
protected  void paintBoxTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
           
protected  void paintButtonTabBackground(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)
          Paints the border of the conten pane which should reflect the tabs as well.
protected  void paintContentBorder(Graphics g, 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 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 paintDefaultTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
           
protected  void paintExcelTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
           
protected  void paintExcelTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
           
protected  void paintFlatTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
           
protected  void paintFlatTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
           
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 paintOffice2003TabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
           
protected  void paintOffice2003TabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
           
protected  void paintRoundedFlatTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
           
protected  void paintRoundedVsnetTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, 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, Component c)
          Paints the tabs in the tab area.
protected  void paintTabAreaBackground(Graphics g, Rectangle rect, int tabPlacement)
           
protected  void paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
           
protected  void paintTabBackgroundMouseOver(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected, Color backgroundUnselectedColorStart, Color backgroundUnselectedColorEnd)
           
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 paintTabBorderMouseOver(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  void paintVsnetTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
           
protected  void paintVsnetTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
           
protected  void paintWindowsTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
           
protected  void prepareEditor(BasicJideTabbedPaneUI.TabEditor e, int tabIndex)
           
 void removeUpdate(DocumentEvent e)
           
 boolean requestFocusForVisibleComponent()
           
protected  void resizeEditor(int tabIndex)
           
static void rotateInsets(Insets topInsets, Insets targetInsets, int targetPlacement)
           
protected  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)
           
protected  boolean showFocusIndicator()
           
 void startEditing(MouseEvent e)
           
protected  void stopOrCancelEditing()
           
 void stopTabEditing()
          Stops the editing and commits the change.
 int tabForCoordinate(JTabbedPane pane, int x, int y)
          Returns the tab index which intersects the specified point in the JTabbedPane's coordinate space.
 void uninstallColorTheme()
           
protected  void uninstallComponents()
          Removes any installed subcomponents from the JTabbedPane.
protected  void uninstallDefaults()
           
protected  void uninstallKeyboardActions()
           
protected  void uninstallListeners()
           
 void uninstallUI(JComponent c)
           
protected  void updateCloseAction()
           
protected  void updateMnemonics()
          Reloads the mnemonics.
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_tabRectPadding

protected int _tabRectPadding

_closeButtonMarginHorizon

protected int _closeButtonMarginHorizon

_closeButtonMarginVertical

protected int _closeButtonMarginVertical

_textMarginVertical

protected int _textMarginVertical

_noIconMargin

protected int _noIconMargin

_iconMargin

protected int _iconMargin

_textPadding

protected int _textPadding

_buttonSize

protected int _buttonSize

_buttonMargin

protected int _buttonMargin

_fitStyleBoundSize

protected int _fitStyleBoundSize

_fitStyleFirstTabMargin

protected int _fitStyleFirstTabMargin

_fitStyleIconMinWidth

protected int _fitStyleIconMinWidth

_fitStyleTextMinWidth

protected int _fitStyleTextMinWidth

_compressedStyleNoIconRectSize

protected int _compressedStyleNoIconRectSize

_compressedStyleIconMargin

protected int _compressedStyleIconMargin

_compressedStyleCloseButtonMarginHorizon

protected int _compressedStyleCloseButtonMarginHorizon

_compressedStyleCloseButtonMarginVertical

protected int _compressedStyleCloseButtonMarginVertical

_fixedStyleRectSize

protected int _fixedStyleRectSize

_closeButtonMargin

protected int _closeButtonMargin

_gripLeftMargin

protected int _gripLeftMargin

_closeButtonMarginSize

protected int _closeButtonMarginSize

_closeButtonLeftMargin

protected int _closeButtonLeftMargin

_closeButtonRightMargin

protected int _closeButtonRightMargin

_tabLeadingComponent

protected Component _tabLeadingComponent

_tabTrailingComponent

protected Component _tabTrailingComponent

_tabPane

protected JideTabbedPane _tabPane

_selectedTabFont

protected Font _selectedTabFont

_tabBackground

protected Color _tabBackground

_background

protected Color _background

_highlight

protected Color _highlight

_lightHighlight

protected Color _lightHighlight

_shadow

protected Color _shadow

_darkShadow

protected Color _darkShadow

_focus

protected Color _focus

_inactiveTabForeground

protected Color _inactiveTabForeground

_inactiveSelectedTabForeground

protected Color _inactiveSelectedTabForeground

_activeTabForeground

protected Color _activeTabForeground

_tabListBackground

protected Color _tabListBackground

_selectedColor

protected Color _selectedColor

_activeBackground

protected Color _activeBackground

_textIconGap

protected int _textIconGap

_tabRunOverlay

protected int _tabRunOverlay

_showIconOnTab

protected boolean _showIconOnTab

_showCloseButtonOnTab

protected boolean _showCloseButtonOnTab

_closeButtonAlignment

protected int _closeButtonAlignment

_tabInsets

protected Insets _tabInsets

_selectedTabPadInsets

protected Insets _selectedTabPadInsets

_tabAreaInsets

protected Insets _tabAreaInsets

_ignoreContentBorderInsetsIfNoTabs

protected boolean _ignoreContentBorderInsetsIfNoTabs

_tabRuns

protected int[] _tabRuns

_runCount

protected int _runCount

_selectedRun

protected int _selectedRun

_rects

protected Rectangle[] _rects

_additionalWidth

protected int _additionalWidth

_maxTabHeight

protected int _maxTabHeight

_maxTabWidth

protected int _maxTabWidth

_gripperWidth

protected int _gripperWidth

_gripperHeight

protected int _gripperHeight

_tabChangeListener

protected ChangeListener _tabChangeListener

_tabFocusListener

protected FocusListener _tabFocusListener

_propertyChangeListener

protected PropertyChangeListener _propertyChangeListener

_tabModelChangeListener

protected ChangeListener _tabModelChangeListener

_mouseListener

protected MouseListener _mouseListener

_mousemotionListener

protected MouseMotionListener _mousemotionListener

_mouseWheelListener

protected MouseWheelListener _mouseWheelListener

_tabScroller

public BasicJideTabbedPaneUI.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

protected int _tabCount
Number of tabs. When the count differs, the mnemonics are updated.


_closeButtons

protected JButton[] _closeButtons

_dt

public DropTarget _dt

DEFAULT_LEFT_MARGIN

public static final int DEFAULT_LEFT_MARGIN
See Also:
Constant Field Values

OFFICE2003_LEFT_MARGIN

public static final int OFFICE2003_LEFT_MARGIN
See Also:
Constant Field Values

EXCEL_LEFT_MARGIN

public static final int EXCEL_LEFT_MARGIN
See Also:
Constant Field Values

_rectSizeExtend

protected int _rectSizeExtend

tabRegion

protected Polygon tabRegion

_selectColor1

protected Color _selectColor1

_selectColor2

protected Color _selectColor2

_selectColor3

protected Color _selectColor3

_unselectColor1

protected Color _unselectColor1

_unselectColor2

protected Color _unselectColor2

_unselectColor3

protected Color _unselectColor3

_officeTabBorderColor

protected Color _officeTabBorderColor

_defaultTabBorderShadowColor

protected Color _defaultTabBorderShadowColor

_mouseEnter

protected boolean _mouseEnter

_indexMouseOver

protected int _indexMouseOver

_alwaysShowLineBorder

protected boolean _alwaysShowLineBorder

_showFocusIndicator

protected boolean _showFocusIndicator

BUTTON_NAME_CLOSE

public static final String BUTTON_NAME_CLOSE
See Also:
Constant Field Values

BUTTON_NAME_TAB_LIST

public static final String BUTTON_NAME_TAB_LIST
See Also:
Constant Field Values

BUTTON_NAME_SCROLL_BACKWARD

public static final String BUTTON_NAME_SCROLL_BACKWARD
See Also:
Constant Field Values

BUTTON_NAME_SCROLL_FORWARD

public static final String BUTTON_NAME_SCROLL_FORWARD
See Also:
Constant Field Values

tryTabSpacer

protected BasicJideTabbedPaneUI.TabSpaceAllocator tryTabSpacer

_closeButtonSelectedColor

protected Color _closeButtonSelectedColor

_closeButtonColor

protected Color _closeButtonColor

_popupColor

protected Color _popupColor

_tabEditor

protected BasicJideTabbedPaneUI.TabEditor _tabEditor

_isEditing

protected boolean _isEditing

_editingTab

protected int _editingTab

_oldValue

protected String _oldValue

_oldPrefix

protected String _oldPrefix

_oldPostfix

protected String _oldPostfix

_originalFocusComponent

protected Component _originalFocusComponent

PAINT_TAB

protected final boolean PAINT_TAB
See Also:
Constant Field Values

PAINT_TAB_BORDER

protected final boolean PAINT_TAB_BORDER
See Also:
Constant Field Values

PAINT_TAB_BACKGROUND

protected final boolean PAINT_TAB_BACKGROUND
See Also:
Constant Field Values

PAINT_TABAREA

protected final boolean PAINT_TABAREA
See Also:
Constant Field Values

PAINT_CONTENT_BORDER

protected final boolean PAINT_CONTENT_BORDER
See Also:
Constant Field Values

PAINT_CONTENT_BORDER_EDGE

protected final boolean PAINT_CONTENT_BORDER_EDGE
See Also:
Constant Field Values
Constructor Detail

BasicJideTabbedPaneUI

public BasicJideTabbedPaneUI()
Method Detail

createUI

public static ComponentUI createUI(JComponent c)

installUI

public void installUI(JComponent c)
Overrides:
installUI in class ComponentUI

installColorTheme

public void installColorTheme()

uninstallUI

public void uninstallUI(JComponent c)
Overrides:
uninstallUI in class ComponentUI

uninstallColorTheme

public void uninstallColorTheme()

createLayoutManager

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

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

scrollableTabLayoutEnabled

protected boolean scrollableTabLayoutEnabled()

installComponents

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


uninstallComponents

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


installDefaults

protected void installDefaults()

uninstallDefaults

protected void uninstallDefaults()

installListeners

protected void installListeners()

createDropListener

protected com.jidesoft.plaf.basic.BasicJideTabbedPaneUI.DropListener createDropListener()

uninstallListeners

protected void uninstallListeners()

createChangeListener

protected ChangeListener createChangeListener()

createFocusListener

protected FocusListener createFocusListener()

createPropertyChangeListener

protected PropertyChangeListener createPropertyChangeListener()

installKeyboardActions

protected void installKeyboardActions()

uninstallKeyboardActions

protected void uninstallKeyboardActions()

updateMnemonics

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


getPreferredSize

public Dimension getPreferredSize(JComponent c)
Overrides:
getPreferredSize in class ComponentUI

getMinimumSize

public Dimension getMinimumSize(JComponent c)
Overrides:
getMinimumSize in class ComponentUI

getMaximumSize

public Dimension getMaximumSize(JComponent c)
Overrides:
getMaximumSize in class ComponentUI

paint

public void paint(Graphics g,
                  JComponent c)
Overrides:
paint in class ComponentUI

paintBackground

public void paintBackground(Graphics g,
                            Component c)

paintTabArea

protected void paintTabArea(Graphics g,
                            int tabPlacement,
                            int selectedIndex,
                            Component c)
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
c - the component

paintTabAreaBackground

protected void paintTabAreaBackground(Graphics g,
                                      Rectangle rect,
                                      int tabPlacement)

paintTab

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

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)

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

Parameters:
g - the Graphics instance
tabPlacement - the tab placement
tabIndex - the tab index
x - x
y - y
w - width
h - height
isSelected - if the tab is selected

paintOffice2003TabBorder

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

paintExcelTabBorder

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

paintWindowsTabBorder

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

paintTabBorderMouseOver

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

paintVsnetTabBorder

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

paintRoundedVsnetTabBorder

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

paintFlatTabBorder

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

paintRoundedFlatTabBorder

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

paintBoxTabBorder

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

paintTabBackground

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

paintOffice2003TabBackground

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

paintExcelTabBackground

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

paintDefaultTabBackground

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

paintTabBackgroundMouseOver

protected void paintTabBackgroundMouseOver(Graphics g,
                                           int tabPlacement,
                                           int tabIndex,
                                           int x,
                                           int y,
                                           int w,
                                           int h,
                                           boolean isSelected,
                                           Color backgroundUnselectedColorStart,
                                           Color backgroundUnselectedColorEnd)

paintVsnetTabBackground

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

paintFlatTabBackground

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

paintButtonTabBackground

protected void paintButtonTabBackground(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)
Paints the border of the conten pane which should reflect the tabs as well.

Parameters:
g - the Graphics instance
tabPlacement - the tab placement
selectedIndex - the selected tab index

paintContentBorderLeftEdge

protected void paintContentBorderLeftEdge(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)

paintContentBorder

protected void paintContentBorder(Graphics g,
                                  int x,
                                  int y,
                                  int w,
                                  int h)

getBorderEdgeColor

protected Color getBorderEdgeColor()

paintContentBorderTopEdge

protected void paintContentBorderTopEdge(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)

ensureCurrentLayout

protected 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

getTabAtLocation

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

Parameters:
x - x value of the point
y - y value of the point
Returns:
the tab index in the point (x, y). -1 if no tab could be found.

isEmptyTabArea

public boolean isEmptyTabArea(int x,
                              int y)
Returns if the point resides in the empty tab area, which means it is in the tab area however no real tab contains that point.

Parameters:
x - x value of the point
y - y value of the point
Returns:
true if the point is in empty tab area. Otherwise false.

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)

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

calculateTabHeight

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

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(int tab)

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

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

requestFocusForVisibleComponent

public boolean requestFocusForVisibleComponent()

createNoFocusButton

@Deprecated
protected BasicJideTabbedPaneUI.TabCloseButton createNoFocusButton(int type)
Deprecated. replaced by JideTabbedPane.createNoFocusButton(int)

Creates a button.

Parameters:
type - the button type
Returns:
the button

stopOrCancelEditing

protected void stopOrCancelEditing()

ensureCurrentRects

protected void ensureCurrentRects(int leftMargin,
                                  int tabCount)

getTabListCellRenderer

protected ListCellRenderer getTabListCellRenderer()

updateCloseAction

protected void updateCloseAction()

getTabPanel

public Component getTabPanel()
Description copied from class: JideTabbedPaneUI
Gets the tab panel for the JideTabbedPane. The tab panel contains all the tabs and the tabbed pane buttons (close, scroll left/right, list buttons). Sometimes you have to use this tab panel. For example, if you want to add a mouse listener to get double click event on tabs, you must use this tab panel to add mouse listener. In addition, as the tab panel is part of the TabbedPaneUI which is recreated when updateUI is called (which usually happens after switching L&F), you should override updateUI method in JideTabbedPane to add mouse listener so that it will get added again after updateUI.

Specified by:
getTabPanel in class JideTabbedPaneUI
Returns:
the tab panel.

ensureActiveTabIsVisible

public void ensureActiveTabIsVisible(boolean scrollLeft)
Description copied from class: JideTabbedPaneUI
Scroll the selected tab visible in case the tab is outside of the viewport. This method is called by JideTabbedPane.scrollSelectedTabToVisible(boolean) method.

Specified by:
ensureActiveTabIsVisible in class JideTabbedPaneUI
Parameters:
scrollLeft - true to scroll the first tab visible first then scroll left to make the selected tab visible. This will get a more consistent result. If false, it will simple scroll the selected tab visible. Sometimes the tab will appear as the first visible tab or the last visible tab depending on the previous viewport position.

isShowCloseButtonOnTab

protected boolean isShowCloseButtonOnTab()

isShowCloseButton

protected boolean isShowCloseButton()

ensureCloseButtonCreated

public void ensureCloseButtonCreated()

isShowTabButtons

protected boolean isShowTabButtons()

isShrinkTabs

protected boolean isShrinkTabs()

isTabEditing

public boolean isTabEditing()
Description copied from class: JideTabbedPaneUI
Checks if the tab is being edited.

Specified by:
isTabEditing in class JideTabbedPaneUI
Returns:
true or false.

createDefaultTabEditor

protected BasicJideTabbedPaneUI.TabEditor createDefaultTabEditor()

stopTabEditing

public void stopTabEditing()
Description copied from class: JideTabbedPaneUI
Stops the editing and commits the change.

Specified by:
stopTabEditing in class JideTabbedPaneUI

cancelTabEditing

public void cancelTabEditing()
Description copied from class: JideTabbedPaneUI
Cancels the editing and discards the change.

Specified by:
cancelTabEditing in class JideTabbedPaneUI

editTabAt

public boolean editTabAt(int tabIndex)
Description copied from class: JideTabbedPaneUI
Edits the tab at the index.

Specified by:
editTabAt in class JideTabbedPaneUI
Parameters:
tabIndex - the tab index.
Returns:
true if editing started. Otherwise false if the tab is already in editing mode when this method is called.

getEditingTabIndex

public int getEditingTabIndex()
Description copied from class: JideTabbedPaneUI
Gets the tab index that is editing, if any. -1 if no tab is being edited.

Specified by:
getEditingTabIndex in class JideTabbedPaneUI
Returns:
the tab index or -1.

prepareEditor

protected void prepareEditor(BasicJideTabbedPaneUI.TabEditor e,
                             int tabIndex)

getTabsTextBoundsAt

protected Rectangle getTabsTextBoundsAt(int tabIndex)

insertUpdate

public void insertUpdate(DocumentEvent e)
Specified by:
insertUpdate in interface DocumentListener

removeUpdate

public void removeUpdate(DocumentEvent e)
Specified by:
removeUpdate in interface DocumentListener

changedUpdate

public void changedUpdate(DocumentEvent e)
Specified by:
changedUpdate in interface DocumentListener

resizeEditor

protected void resizeEditor(int tabIndex)

getCurrentDisplayTitleAt

protected String getCurrentDisplayTitleAt(JideTabbedPane tp,
                                          int index)

startEditing

public void startEditing(MouseEvent e)

getPainter

public ThemePainter getPainter()

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)

isRoundedCorner

protected boolean isRoundedCorner()

getTabShape

protected int getTabShape()

getTabResizeMode

protected int getTabResizeMode()

getColorTheme

protected int getColorTheme()

getLeftMargin

protected int getLeftMargin()

getTabGap

protected int getTabGap()

getLayoutSize

protected int getLayoutSize()

getTabRightPadding

protected int getTabRightPadding()

createMouseListener

protected MouseListener createMouseListener()

createMouseWheelListener

protected MouseWheelListener createMouseWheelListener()

createMouseMotionListener

protected MouseMotionListener createMouseMotionListener()

isTabLeadingComponentVisible

protected boolean isTabLeadingComponentVisible()

isTabTrailingComponentVisible

protected boolean isTabTrailingComponentVisible()

isTabTopVisible

protected boolean isTabTopVisible(int tabPlacement)

showFocusIndicator

protected boolean showFocusIndicator()

getResourceString

protected String getResourceString(String key)
Gets the resource string used in JideTabbedPane. Subclass can override it to provide their own strings.

Parameters:
key - the resource key
Returns:
the localized string.

JIDE 3.5.15