Package com.jidesoft.plaf.basic
Class BasicJideTabbedPaneUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.TabbedPaneUI
-
- com.jidesoft.plaf.JideTabbedPaneUI
-
- com.jidesoft.plaf.basic.BasicJideTabbedPaneUI
-
- All Implemented Interfaces:
java.util.EventListener,javax.swing.event.DocumentListener,javax.swing.SwingConstants
- Direct Known Subclasses:
VsnetJideTabbedPaneUI
public class BasicJideTabbedPaneUI extends JideTabbedPaneUI implements javax.swing.SwingConstants, javax.swing.event.DocumentListener
A basic L&f implementation of JideTabbedPaneUI
-
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.Color_activeBackgroundprotected java.awt.Color_activeTabForegroundprotected int_additionalWidthprotected boolean_alwaysShowLineBorderprotected java.awt.Color_backgroundprotected int_buttonMarginprotected int_buttonSizeprotected java.awt.Rectangle_calcRectA rectangle used for general layout calculations in order to avoid constructing many new Rectangles on the fly.protected int_closeButtonAlignmentprotected java.awt.Color_closeButtonColorprotected int_closeButtonLeftMarginprotected int_closeButtonMarginprotected int_closeButtonMarginHorizonprotected int_closeButtonMarginSizeprotected int_closeButtonMarginVerticalprotected int_closeButtonRightMarginprotected javax.swing.JButton[]_closeButtonsprotected java.awt.Color_closeButtonSelectedColorprotected int_compressedStyleCloseButtonMarginHorizonprotected int_compressedStyleCloseButtonMarginVerticalprotected int_compressedStyleIconMarginprotected int_compressedStyleNoIconRectSizeprotected java.awt.Color_darkShadowprotected java.awt.Color_defaultTabBorderShadowColorjava.awt.dnd.DropTarget_dtprotected int_editingTabprotected int_fitStyleBoundSizeprotected int_fitStyleFirstTabMarginprotected int_fitStyleIconMinWidthprotected int_fitStyleTextMinWidthprotected int_fixedStyleRectSizeprotected java.awt.Color_focusprotected int_gripLeftMarginprotected int_gripperHeightprotected int_gripperWidthprotected java.awt.Color_highlightprotected int_iconMarginprotected boolean_ignoreContentBorderInsetsIfNoTabsprotected java.awt.Color_inactiveSelectedTabForegroundprotected java.awt.Color_inactiveTabForegroundprotected int_indexMouseOverprotected boolean_isEditingprotected java.awt.Color_lightHighlightprotected int_maxTabHeightprotected int_maxTabWidthprotected boolean_mouseEnterprotected java.awt.event.MouseListener_mouseListenerprotected java.awt.event.MouseMotionListener_mousemotionListenerprotected java.awt.event.MouseWheelListener_mouseWheelListenerprotected int_noIconMarginprotected java.awt.Color_officeTabBorderColorprotected java.lang.String_oldPostfixprotected java.lang.String_oldPrefixprotected java.lang.String_oldValueprotected java.awt.Component_originalFocusComponentprotected java.awt.Color_popupColorprotected java.beans.PropertyChangeListener_propertyChangeListenerprotected java.awt.Rectangle[]_rectsprotected int_rectSizeExtendprotected int_runCountprotected java.awt.Color_selectColor1protected java.awt.Color_selectColor2protected java.awt.Color_selectColor3protected java.awt.Color_selectedColorprotected int_selectedRunprotected java.awt.Font_selectedTabFontprotected java.awt.Insets_selectedTabPadInsetsprotected java.awt.Color_shadowprotected boolean_showCloseButtonOnTabprotected boolean_showFocusIndicatorprotected boolean_showIconOnTabprotected java.awt.Insets_tabAreaInsetsprotected java.awt.Color_tabBackgroundprotected javax.swing.event.ChangeListener_tabChangeListenerprotected int_tabCountNumber of tabs.protected BasicJideTabbedPaneUI.TabEditor_tabEditorprotected java.awt.event.FocusListener_tabFocusListenerprotected java.awt.Insets_tabInsetsprotected java.awt.Component_tabLeadingComponentprotected java.awt.Color_tabListBackgroundprotected javax.swing.event.ChangeListener_tabModelChangeListenerprotected JideTabbedPane_tabPaneprotected int_tabRectPaddingprotected int_tabRunOverlayprotected int[]_tabRunsBasicJideTabbedPaneUI.ScrollableTabSupport_tabScrollerprotected java.awt.Component_tabTrailingComponentprotected int_textIconGapprotected int_textMarginVerticalprotected int_textPaddingprotected java.awt.Color_unselectColor1protected java.awt.Color_unselectColor2protected java.awt.Color_unselectColor3static java.lang.StringBUTTON_NAME_CLOSEstatic java.lang.StringBUTTON_NAME_SCROLL_BACKWARDstatic java.lang.StringBUTTON_NAME_SCROLL_FORWARDstatic java.lang.StringBUTTON_NAME_TAB_LISTstatic intDEFAULT_LEFT_MARGINstatic intEXCEL_LEFT_MARGINstatic intOFFICE2003_LEFT_MARGINprotected booleanPAINT_CONTENT_BORDERprotected booleanPAINT_CONTENT_BORDER_EDGEprotected booleanPAINT_TABprotected booleanPAINT_TAB_BACKGROUNDprotected booleanPAINT_TAB_BORDERprotected booleanPAINT_TABAREAprotected java.awt.PolygontabRegionprotected BasicJideTabbedPaneUI.TabSpaceAllocatortryTabSpacer
-
Constructor Summary
Constructors Constructor Description BasicJideTabbedPaneUI()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidassureRectsCreated(int tabCount)protected intcalculateMaxTabHeight(int tabPlacement)protected intcalculateMaxTabWidth(int tabPlacement)protected intcalculateTabAreaHeight(int tabPlacement, int horizRunCount, int maxTabHeight)protected intcalculateTabAreaWidth(int tabPlacement, int vertRunCount, int maxTabWidth)protected intcalculateTabHeight(int tabPlacement, int tabIndex, java.awt.FontMetrics metrics)protected intcalculateTabWidth(int tabPlacement, int tabIndex, java.awt.FontMetrics metrics)voidcancelTabEditing()Cancels the editing and discards the change.voidchangedUpdate(javax.swing.event.DocumentEvent e)protected javax.swing.event.ChangeListenercreateChangeListener()protected BasicJideTabbedPaneUI.TabEditorcreateDefaultTabEditor()protected com.jidesoft.plaf.basic.BasicJideTabbedPaneUI.DropListenercreateDropListener()protected java.awt.event.FocusListenercreateFocusListener()protected java.awt.LayoutManagercreateLayoutManager()Invoked byinstallUIto create a layout manager object to manage theJTabbedPane.protected java.awt.event.MouseListenercreateMouseListener()protected java.awt.event.MouseMotionListenercreateMouseMotionListener()protected java.awt.event.MouseWheelListenercreateMouseWheelListener()protected BasicJideTabbedPaneUI.TabCloseButtoncreateNoFocusButton(int type)Deprecated.replaced byJideTabbedPane.createNoFocusButton(int)protected java.beans.PropertyChangeListenercreatePropertyChangeListener()static javax.swing.plaf.ComponentUIcreateUI(javax.swing.JComponent c)booleaneditTabAt(int tabIndex)Edits the tab at the index.voidensureActiveTabIsVisible(boolean scrollLeft)Scroll the selected tab visible in case the tab is outside of the viewport.voidensureCloseButtonCreated()protected voidensureCurrentLayout()protected voidensureCurrentRects(int leftMargin, int tabCount)protected voidexpandTabRunsArray()protected java.awt.ColorgetBorderEdgeColor()protected intgetColorTheme()protected java.awt.InsetsgetContentBorderInsets(int tabPlacement)protected java.lang.StringgetCurrentDisplayTitleAt(JideTabbedPane tp, int index)intgetEditingTabIndex()Gets the tab index that is editing, if any.protected java.awt.FontMetricsgetFontMetrics(int tab)protected intgetLayoutSize()protected intgetLeftMargin()java.awt.DimensiongetMaximumSize(javax.swing.JComponent c)java.awt.DimensiongetMinimumSize(javax.swing.JComponent c)protected intgetNextTabIndex(int base)protected intgetNextTabIndexInRun(int tabCount, int base)protected intgetNextTabRun(int baseRun)ThemePaintergetPainter()java.awt.DimensiongetPreferredSize(javax.swing.JComponent c)protected intgetPreviousTabIndex(int base)protected intgetPreviousTabIndexInRun(int tabCount, int base)protected intgetPreviousTabRun(int baseRun)protected java.lang.StringgetResourceString(java.lang.String key)Gets the resource string used in JideTabbedPane.protected intgetRunForTab(int tabCount, int tabIndex)protected java.awt.InsetsgetSelectedTabPadInsets(int tabPlacement)protected java.awt.InsetsgetTabAreaInsets(int tabPlacement)intgetTabAtLocation(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 java.awt.RectanglegetTabBounds(int tabIndex, java.awt.Rectangle dest)Returns the bounds of the specified tab in the coordinate space of the JTabbedPane component.java.awt.RectanglegetTabBounds(javax.swing.JTabbedPane pane, int i)Returns the bounds of the specified tab index.protected intgetTabGap()protected java.awt.InsetsgetTabInsets(int tabPlacement, int tabIndex)protected intgetTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected)protected intgetTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected)protected javax.swing.ListCellRenderergetTabListCellRenderer()java.awt.ComponentgetTabPanel()Gets the tab panel for the JideTabbedPane.protected intgetTabResizeMode()protected intgetTabRightPadding()intgetTabRunCount(javax.swing.JTabbedPane pane)protected intgetTabRunIndent(int tabPlacement, int run)protected intgetTabRunOffset(int tabPlacement, int tabCount, int tabIndex, boolean forward)protected intgetTabRunOverlay(int tabPlacement)protected intgetTabShape()protected java.awt.RectanglegetTabsTextBoundsAt(int tabIndex)protected javax.swing.text.ViewgetTextViewForTab(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 java.awt.ComponentgetVisibleComponent()voidinsertUpdate(javax.swing.event.DocumentEvent e)voidinstallColorTheme()protected voidinstallComponents()Creates and installs any required subcomponents for the JTabbedPane.protected voidinstallDefaults()protected voidinstallKeyboardActions()protected voidinstallListeners()voidinstallUI(javax.swing.JComponent c)booleanisEmptyTabArea(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 booleanisRoundedCorner()protected booleanisShowCloseButton()protected booleanisShowCloseButtonOnTab()protected booleanisShowTabButtons()protected booleanisShrinkTabs()booleanisTabEditing()Checks if the tab is being edited.protected booleanisTabLeadingComponentVisible()protected booleanisTabTopVisible(int tabPlacement)protected booleanisTabTrailingComponentVisible()protected intlastTabInRun(int tabCount, int run)protected voidlayoutLabel(int tabPlacement, java.awt.FontMetrics metrics, int tabIndex, java.lang.String title, javax.swing.Icon icon, java.awt.Rectangle tabRect, java.awt.Rectangle iconRect, java.awt.Rectangle textRect, boolean isSelected)protected voidnavigateSelectedTab(int direction)voidpaint(java.awt.Graphics g, javax.swing.JComponent c)voidpaintBackground(java.awt.Graphics g, java.awt.Component c)protected voidpaintBoxTabBorder(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)protected voidpaintButtonTabBackground(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)protected voidpaintContentBorder(java.awt.Graphics g, int tabPlacement, int selectedIndex)Paints the border of the conten pane which should reflect the tabs as well.protected voidpaintContentBorder(java.awt.Graphics g, int x, int y, int w, int h)protected voidpaintContentBorderBottomEdge(java.awt.Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)protected voidpaintContentBorderLeftEdge(java.awt.Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)protected voidpaintContentBorderRightEdge(java.awt.Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)protected voidpaintContentBorderTopEdge(java.awt.Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)protected voidpaintDefaultTabBackground(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)protected voidpaintExcelTabBackground(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)protected voidpaintExcelTabBorder(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)protected voidpaintFlatTabBackground(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)protected voidpaintFlatTabBorder(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)protected voidpaintFocusIndicator(java.awt.Graphics g, int tabPlacement, java.awt.Rectangle[] rects, int tabIndex, java.awt.Rectangle iconRect, java.awt.Rectangle textRect, boolean isSelected)protected voidpaintIcon(java.awt.Graphics g, int tabPlacement, int tabIndex, javax.swing.Icon icon, java.awt.Rectangle iconRect, boolean isSelected)protected voidpaintOffice2003TabBackground(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)protected voidpaintOffice2003TabBorder(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)protected voidpaintRoundedFlatTabBorder(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)protected voidpaintRoundedVsnetTabBorder(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)protected voidpaintTab(java.awt.Graphics g, int tabPlacement, java.awt.Rectangle[] rects, int tabIndex, java.awt.Rectangle iconRect, java.awt.Rectangle textRect)protected voidpaintTabArea(java.awt.Graphics g, int tabPlacement, int selectedIndex, java.awt.Component c)Paints the tabs in the tab area.protected voidpaintTabAreaBackground(java.awt.Graphics g, java.awt.Rectangle rect, int tabPlacement)protected voidpaintTabBackground(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)protected voidpaintTabBackgroundMouseOver(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected, java.awt.Color backgroundUnselectedColorStart, java.awt.Color backgroundUnselectedColorEnd)protected voidpaintTabBorder(java.awt.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 voidpaintTabBorderMouseOver(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)protected voidpaintText(java.awt.Graphics g, int tabPlacement, java.awt.Font font, java.awt.FontMetrics metrics, int tabIndex, java.lang.String title, java.awt.Rectangle textRect, boolean isSelected)protected voidpaintVsnetTabBackground(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)protected voidpaintVsnetTabBorder(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)protected voidpaintWindowsTabBorder(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)protected voidprepareEditor(BasicJideTabbedPaneUI.TabEditor e, int tabIndex)voidremoveUpdate(javax.swing.event.DocumentEvent e)booleanrequestFocusForVisibleComponent()protected voidresizeEditor(int tabIndex)static voidrotateInsets(java.awt.Insets topInsets, java.awt.Insets targetInsets, int targetPlacement)protected booleanscrollableTabLayoutEnabled()protected voidselectAdjacentRunTab(int tabPlacement, int tabIndex, int offset)protected voidselectNextTab(int current)protected voidselectNextTabInRun(int current)protected voidselectPreviousTab(int current)protected voidselectPreviousTabInRun(int current)protected voidsetVisibleComponent(java.awt.Component component)protected booleanshouldPadTabRun(int tabPlacement, int run)protected booleanshouldRotateTabRuns(int tabPlacement)protected booleanshowFocusIndicator()voidstartEditing(java.awt.event.MouseEvent e)protected voidstopOrCancelEditing()voidstopTabEditing()Stops the editing and commits the change.inttabForCoordinate(javax.swing.JTabbedPane pane, int x, int y)Returns the tab index which intersects the specified point in the JTabbedPane's coordinate space.voiduninstallColorTheme()protected voiduninstallComponents()Removes any installed subcomponents from the JTabbedPane.protected voiduninstallDefaults()protected voiduninstallKeyboardActions()protected voiduninstallListeners()voiduninstallUI(javax.swing.JComponent c)protected voidupdateCloseAction()protected voidupdateMnemonics()Reloads the mnemonics.
-
-
-
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 java.awt.Component _tabLeadingComponent
-
_tabTrailingComponent
protected java.awt.Component _tabTrailingComponent
-
_tabPane
protected JideTabbedPane _tabPane
-
_selectedTabFont
protected java.awt.Font _selectedTabFont
-
_tabBackground
protected java.awt.Color _tabBackground
-
_background
protected java.awt.Color _background
-
_highlight
protected java.awt.Color _highlight
-
_lightHighlight
protected java.awt.Color _lightHighlight
-
_shadow
protected java.awt.Color _shadow
-
_darkShadow
protected java.awt.Color _darkShadow
-
_focus
protected java.awt.Color _focus
-
_inactiveTabForeground
protected java.awt.Color _inactiveTabForeground
-
_inactiveSelectedTabForeground
protected java.awt.Color _inactiveSelectedTabForeground
-
_activeTabForeground
protected java.awt.Color _activeTabForeground
-
_tabListBackground
protected java.awt.Color _tabListBackground
-
_selectedColor
protected java.awt.Color _selectedColor
-
_activeBackground
protected java.awt.Color _activeBackground
-
_textIconGap
protected int _textIconGap
-
_tabRunOverlay
protected int _tabRunOverlay
-
_showIconOnTab
protected boolean _showIconOnTab
-
_showCloseButtonOnTab
protected boolean _showCloseButtonOnTab
-
_closeButtonAlignment
protected int _closeButtonAlignment
-
_tabInsets
protected java.awt.Insets _tabInsets
-
_selectedTabPadInsets
protected java.awt.Insets _selectedTabPadInsets
-
_tabAreaInsets
protected java.awt.Insets _tabAreaInsets
-
_ignoreContentBorderInsetsIfNoTabs
protected boolean _ignoreContentBorderInsetsIfNoTabs
-
_tabRuns
protected int[] _tabRuns
-
_runCount
protected int _runCount
-
_selectedRun
protected int _selectedRun
-
_rects
protected java.awt.Rectangle[] _rects
-
_additionalWidth
protected int _additionalWidth
-
_maxTabHeight
protected int _maxTabHeight
-
_maxTabWidth
protected int _maxTabWidth
-
_gripperWidth
protected int _gripperWidth
-
_gripperHeight
protected int _gripperHeight
-
_tabChangeListener
protected javax.swing.event.ChangeListener _tabChangeListener
-
_tabFocusListener
protected java.awt.event.FocusListener _tabFocusListener
-
_propertyChangeListener
protected java.beans.PropertyChangeListener _propertyChangeListener
-
_tabModelChangeListener
protected javax.swing.event.ChangeListener _tabModelChangeListener
-
_mouseListener
protected java.awt.event.MouseListener _mouseListener
-
_mousemotionListener
protected java.awt.event.MouseMotionListener _mousemotionListener
-
_mouseWheelListener
protected java.awt.event.MouseWheelListener _mouseWheelListener
-
_tabScroller
public BasicJideTabbedPaneUI.ScrollableTabSupport _tabScroller
-
_calcRect
protected transient java.awt.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 javax.swing.JButton[] _closeButtons
-
_dt
public java.awt.dnd.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 java.awt.Polygon tabRegion
-
_selectColor1
protected java.awt.Color _selectColor1
-
_selectColor2
protected java.awt.Color _selectColor2
-
_selectColor3
protected java.awt.Color _selectColor3
-
_unselectColor1
protected java.awt.Color _unselectColor1
-
_unselectColor2
protected java.awt.Color _unselectColor2
-
_unselectColor3
protected java.awt.Color _unselectColor3
-
_officeTabBorderColor
protected java.awt.Color _officeTabBorderColor
-
_defaultTabBorderShadowColor
protected java.awt.Color _defaultTabBorderShadowColor
-
_mouseEnter
protected boolean _mouseEnter
-
_indexMouseOver
protected int _indexMouseOver
-
_alwaysShowLineBorder
protected boolean _alwaysShowLineBorder
-
_showFocusIndicator
protected boolean _showFocusIndicator
-
BUTTON_NAME_CLOSE
public static final java.lang.String BUTTON_NAME_CLOSE
- See Also:
- Constant Field Values
-
BUTTON_NAME_TAB_LIST
public static final java.lang.String BUTTON_NAME_TAB_LIST
- See Also:
- Constant Field Values
-
BUTTON_NAME_SCROLL_BACKWARD
public static final java.lang.String BUTTON_NAME_SCROLL_BACKWARD
- See Also:
- Constant Field Values
-
BUTTON_NAME_SCROLL_FORWARD
public static final java.lang.String BUTTON_NAME_SCROLL_FORWARD
- See Also:
- Constant Field Values
-
tryTabSpacer
protected BasicJideTabbedPaneUI.TabSpaceAllocator tryTabSpacer
-
_closeButtonSelectedColor
protected java.awt.Color _closeButtonSelectedColor
-
_closeButtonColor
protected java.awt.Color _closeButtonColor
-
_popupColor
protected java.awt.Color _popupColor
-
_tabEditor
protected BasicJideTabbedPaneUI.TabEditor _tabEditor
-
_isEditing
protected boolean _isEditing
-
_editingTab
protected int _editingTab
-
_oldValue
protected java.lang.String _oldValue
-
_oldPrefix
protected java.lang.String _oldPrefix
-
_oldPostfix
protected java.lang.String _oldPostfix
-
_originalFocusComponent
protected java.awt.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
-
-
Method Detail
-
createUI
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
-
installUI
public void installUI(javax.swing.JComponent c)
- Overrides:
installUIin classjavax.swing.plaf.ComponentUI
-
installColorTheme
public void installColorTheme()
-
uninstallUI
public void uninstallUI(javax.swing.JComponent c)
- Overrides:
uninstallUIin classjavax.swing.plaf.ComponentUI
-
uninstallColorTheme
public void uninstallColorTheme()
-
createLayoutManager
protected java.awt.LayoutManager createLayoutManager()
Invoked byinstallUIto create a layout manager object to manage theJTabbedPane.- 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 javax.swing.event.ChangeListener createChangeListener()
-
createFocusListener
protected java.awt.event.FocusListener createFocusListener()
-
createPropertyChangeListener
protected java.beans.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 java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
- Overrides:
getPreferredSizein classjavax.swing.plaf.ComponentUI
-
getMinimumSize
public java.awt.Dimension getMinimumSize(javax.swing.JComponent c)
- Overrides:
getMinimumSizein classjavax.swing.plaf.ComponentUI
-
getMaximumSize
public java.awt.Dimension getMaximumSize(javax.swing.JComponent c)
- Overrides:
getMaximumSizein classjavax.swing.plaf.ComponentUI
-
paint
public void paint(java.awt.Graphics g, javax.swing.JComponent c)- Overrides:
paintin classjavax.swing.plaf.ComponentUI
-
paintBackground
public void paintBackground(java.awt.Graphics g, java.awt.Component c)
-
paintTabArea
protected void paintTabArea(java.awt.Graphics g, int tabPlacement, int selectedIndex, java.awt.Component c)Paints the tabs in the tab area. Invoked by paint(). The graphics parameter must be a validGraphicsobject. Tab placement may be either:JTabbedPane.TOP,JTabbedPane.BOTTOM,JTabbedPane.LEFT, orJTabbedPane.RIGHT. The selected index must be a valid tabbed pane tab index (0 to tab count - 1, inclusive) or -1 if no tab is currently selected. The handling of invalid parameters is unspecified.- Parameters:
g- the graphics object to use for renderingtabPlacement- the placement for the tabs within the JTabbedPaneselectedIndex- the tab index of the selected componentc- the component
-
paintTabAreaBackground
protected void paintTabAreaBackground(java.awt.Graphics g, java.awt.Rectangle rect, int tabPlacement)
-
paintTab
protected void paintTab(java.awt.Graphics g, int tabPlacement, java.awt.Rectangle[] rects, int tabIndex, java.awt.Rectangle iconRect, java.awt.Rectangle textRect)
-
layoutLabel
protected void layoutLabel(int tabPlacement, java.awt.FontMetrics metrics, int tabIndex, java.lang.String title, javax.swing.Icon icon, java.awt.Rectangle tabRect, java.awt.Rectangle iconRect, java.awt.Rectangle textRect, boolean isSelected)
-
paintIcon
protected void paintIcon(java.awt.Graphics g, int tabPlacement, int tabIndex, javax.swing.Icon icon, java.awt.Rectangle iconRect, boolean isSelected)
-
paintText
protected void paintText(java.awt.Graphics g, int tabPlacement, java.awt.Font font, java.awt.FontMetrics metrics, int tabIndex, java.lang.String title, java.awt.Rectangle textRect, boolean isSelected)
-
paintTabBorder
protected void paintTabBorder(java.awt.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 instancetabPlacement- the tab placementtabIndex- the tab indexx- xy- yw- widthh- heightisSelected- if the tab is selected
-
paintOffice2003TabBorder
protected void paintOffice2003TabBorder(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
-
paintExcelTabBorder
protected void paintExcelTabBorder(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
-
paintWindowsTabBorder
protected void paintWindowsTabBorder(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
-
paintTabBorderMouseOver
protected void paintTabBorderMouseOver(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
-
paintVsnetTabBorder
protected void paintVsnetTabBorder(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
-
paintRoundedVsnetTabBorder
protected void paintRoundedVsnetTabBorder(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
-
paintFlatTabBorder
protected void paintFlatTabBorder(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
-
paintRoundedFlatTabBorder
protected void paintRoundedFlatTabBorder(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
-
paintBoxTabBorder
protected void paintBoxTabBorder(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
-
paintTabBackground
protected void paintTabBackground(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
-
paintOffice2003TabBackground
protected void paintOffice2003TabBackground(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
-
paintExcelTabBackground
protected void paintExcelTabBackground(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
-
paintDefaultTabBackground
protected void paintDefaultTabBackground(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
-
paintTabBackgroundMouseOver
protected void paintTabBackgroundMouseOver(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected, java.awt.Color backgroundUnselectedColorStart, java.awt.Color backgroundUnselectedColorEnd)
-
paintVsnetTabBackground
protected void paintVsnetTabBackground(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
-
paintFlatTabBackground
protected void paintFlatTabBackground(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
-
paintButtonTabBackground
protected void paintButtonTabBackground(java.awt.Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
-
paintContentBorder
protected void paintContentBorder(java.awt.Graphics g, int tabPlacement, int selectedIndex)Paints the border of the conten pane which should reflect the tabs as well.- Parameters:
g- the Graphics instancetabPlacement- the tab placementselectedIndex- the selected tab index
-
paintContentBorderLeftEdge
protected void paintContentBorderLeftEdge(java.awt.Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
-
paintContentBorderRightEdge
protected void paintContentBorderRightEdge(java.awt.Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
-
paintContentBorder
protected void paintContentBorder(java.awt.Graphics g, int x, int y, int w, int h)
-
getBorderEdgeColor
protected java.awt.Color getBorderEdgeColor()
-
paintContentBorderTopEdge
protected void paintContentBorderTopEdge(java.awt.Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
-
paintContentBorderBottomEdge
protected void paintContentBorderBottomEdge(java.awt.Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
-
ensureCurrentLayout
protected void ensureCurrentLayout()
-
getTabBounds
public java.awt.Rectangle getTabBounds(javax.swing.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:
getTabBoundsin classjavax.swing.plaf.TabbedPaneUI
-
getTabRunCount
public int getTabRunCount(javax.swing.JTabbedPane pane)
- Specified by:
getTabRunCountin classjavax.swing.plaf.TabbedPaneUI
-
tabForCoordinate
public int tabForCoordinate(javax.swing.JTabbedPane pane, int x, int y)Returns the tab index which intersects the specified point in the JTabbedPane's coordinate space.- Specified by:
tabForCoordinatein classjavax.swing.plaf.TabbedPaneUI
-
getTabBounds
protected java.awt.Rectangle getTabBounds(int tabIndex, java.awt.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 validRectangleinstance. The handling of invalid parameters is unspecified.- Parameters:
tabIndex- the index of the tabdest- the rectangle where the result should be placed- Returns:
- the resulting rectangle
-
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 pointy- 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 pointy- y value of the point- Returns:
- true if the point is in empty tab area. Otherwise false.
-
getVisibleComponent
protected java.awt.Component getVisibleComponent()
-
setVisibleComponent
protected void setVisibleComponent(java.awt.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 javax.swing.text.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, java.awt.FontMetrics metrics)
-
calculateMaxTabHeight
protected int calculateMaxTabHeight(int tabPlacement)
-
calculateTabWidth
protected int calculateTabWidth(int tabPlacement, int tabIndex, java.awt.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 java.awt.Insets getTabInsets(int tabPlacement, int tabIndex)
-
getSelectedTabPadInsets
protected java.awt.Insets getSelectedTabPadInsets(int tabPlacement)
-
getTabAreaInsets
protected java.awt.Insets getTabAreaInsets(int tabPlacement)
-
getContentBorderInsets
protected java.awt.Insets getContentBorderInsets(int tabPlacement)
-
getFontMetrics
protected java.awt.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(java.awt.Insets topInsets, java.awt.Insets targetInsets, int targetPlacement)
-
requestFocusForVisibleComponent
public boolean requestFocusForVisibleComponent()
-
createNoFocusButton
@Deprecated protected BasicJideTabbedPaneUI.TabCloseButton createNoFocusButton(int type)
Deprecated.replaced byJideTabbedPane.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 javax.swing.ListCellRenderer getTabListCellRenderer()
-
updateCloseAction
protected void updateCloseAction()
-
getTabPanel
public java.awt.Component getTabPanel()
Description copied from class:JideTabbedPaneUIGets 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:
getTabPanelin classJideTabbedPaneUI- Returns:
- the tab panel.
-
ensureActiveTabIsVisible
public void ensureActiveTabIsVisible(boolean scrollLeft)
Description copied from class:JideTabbedPaneUIScroll the selected tab visible in case the tab is outside of the viewport. This method is called byJideTabbedPane.scrollSelectedTabToVisible(boolean)method.- Specified by:
ensureActiveTabIsVisiblein classJideTabbedPaneUI- 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:JideTabbedPaneUIChecks if the tab is being edited.- Specified by:
isTabEditingin classJideTabbedPaneUI- Returns:
- true or false.
-
createDefaultTabEditor
protected BasicJideTabbedPaneUI.TabEditor createDefaultTabEditor()
-
stopTabEditing
public void stopTabEditing()
Description copied from class:JideTabbedPaneUIStops the editing and commits the change.- Specified by:
stopTabEditingin classJideTabbedPaneUI
-
cancelTabEditing
public void cancelTabEditing()
Description copied from class:JideTabbedPaneUICancels the editing and discards the change.- Specified by:
cancelTabEditingin classJideTabbedPaneUI
-
editTabAt
public boolean editTabAt(int tabIndex)
Description copied from class:JideTabbedPaneUIEdits the tab at the index.- Specified by:
editTabAtin classJideTabbedPaneUI- 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:JideTabbedPaneUIGets the tab index that is editing, if any. -1 if no tab is being edited.- Specified by:
getEditingTabIndexin classJideTabbedPaneUI- Returns:
- the tab index or -1.
-
prepareEditor
protected void prepareEditor(BasicJideTabbedPaneUI.TabEditor e, int tabIndex)
-
getTabsTextBoundsAt
protected java.awt.Rectangle getTabsTextBoundsAt(int tabIndex)
-
insertUpdate
public void insertUpdate(javax.swing.event.DocumentEvent e)
- Specified by:
insertUpdatein interfacejavax.swing.event.DocumentListener
-
removeUpdate
public void removeUpdate(javax.swing.event.DocumentEvent e)
- Specified by:
removeUpdatein interfacejavax.swing.event.DocumentListener
-
changedUpdate
public void changedUpdate(javax.swing.event.DocumentEvent e)
- Specified by:
changedUpdatein interfacejavax.swing.event.DocumentListener
-
resizeEditor
protected void resizeEditor(int tabIndex)
-
getCurrentDisplayTitleAt
protected java.lang.String getCurrentDisplayTitleAt(JideTabbedPane tp, int index)
-
startEditing
public void startEditing(java.awt.event.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(java.awt.Graphics g, int tabPlacement, java.awt.Rectangle[] rects, int tabIndex, java.awt.Rectangle iconRect, java.awt.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 java.awt.event.MouseListener createMouseListener()
-
createMouseWheelListener
protected java.awt.event.MouseWheelListener createMouseWheelListener()
-
createMouseMotionListener
protected java.awt.event.MouseMotionListener createMouseMotionListener()
-
isTabLeadingComponentVisible
protected boolean isTabLeadingComponentVisible()
-
isTabTrailingComponentVisible
protected boolean isTabTrailingComponentVisible()
-
isTabTopVisible
protected boolean isTabTopVisible(int tabPlacement)
-
showFocusIndicator
protected boolean showFocusIndicator()
-
getResourceString
protected java.lang.String getResourceString(java.lang.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.
-
-