Class FlatTabbedPaneUI

  • All Implemented Interfaces:
    FlatStylingSupport.StyleableUI, SwingConstants

    public class FlatTabbedPaneUI
    extends BasicTabbedPaneUI
    implements FlatStylingSupport.StyleableUI
    Provides the Flat LaF UI delegate for JTabbedPane.
    UiDefault:
    TabbedPane.font Font, TabbedPane.background Color, TabbedPane.foreground Color, TabbedPane.shadow Color used for cropped line, TabbedPane.textIconGap int, TabbedPane.tabInsets Insets, TabbedPane.selectedTabPadInsets Insets unused, TabbedPane.tabAreaInsets Insets, TabbedPane.tabsOverlapBorder boolean, TabbedPane.tabRunOverlay int, TabbedPane.tabsOpaque boolean, TabbedPane.contentOpaque boolean unused, TabbedPane.opaque boolean, TabbedPane.selectionFollowsFocus boolean default is true , TabbedPane.disabledForeground Color, TabbedPane.selectedBackground Color optional, TabbedPane.selectedForeground Color optional, TabbedPane.underlineColor Color, TabbedPane.inactiveUnderlineColor Color, TabbedPane.disabledUnderlineColor Color, TabbedPane.hoverColor Color optional, TabbedPane.hoverForeground Color optional, TabbedPane.focusColor Color optional, TabbedPane.focusForeground Color optional, TabbedPane.tabSeparatorColor Color optional; defaults to TabbedPane.contentAreaColor, TabbedPane.contentAreaColor Color, TabbedPane.minimumTabWidth int optional, TabbedPane.maximumTabWidth int optional, TabbedPane.tabHeight int, TabbedPane.tabSelectionHeight int, TabbedPane.cardTabSelectionHeight int, TabbedPane.tabArc int, TabbedPane.tabSelectionArc int, TabbedPane.cardTabArc int, TabbedPane.selectedInsets Insets, TabbedPane.tabSelectionInsets Insets, TabbedPane.contentSeparatorHeight int, TabbedPane.showTabSeparators boolean, TabbedPane.tabSeparatorsFullHeight boolean, TabbedPane.hasFullBorder boolean, TabbedPane.rotateTabRuns boolean, TabbedPane.tabLayoutPolicy String wrap (default) or scroll, TabbedPane.tabType String underlined (default) or card, TabbedPane.tabsPopupPolicy String never or asNeeded (default), TabbedPane.scrollButtonsPolicy String never, asNeeded or asNeededSingle (default), TabbedPane.scrollButtonsPlacement String both (default) or trailing, TabbedPane.tabAreaAlignment String leading (default), center, trailing or fill, TabbedPane.tabAlignment String leading, center (default) or trailing, TabbedPane.tabWidthMode String preferred (default), equal or compact, ScrollPane.smoothScrolling boolean, TabbedPane.closeIcon Icon, TabbedPane.arrowType String chevron (default) or triangle, TabbedPane.buttonInsets Insets, TabbedPane.buttonArc int, TabbedPane.buttonHoverBackground Color, TabbedPane.buttonPressedBackground Color, TabbedPane.moreTabsButtonToolTipText String, TabbedPane.tabCloseToolTipText String
    ClientProperty:
    JTabbedPane.showTabSeparators boolean, JTabbedPane.hasFullBorder boolean
    • Field Detail

      • TAB_TYPE_UNDERLINED

        protected static final int TAB_TYPE_UNDERLINED
        Since:
        2
        See Also:
        Constant Field Values
      • foreground

        protected Color foreground
      • disabledForeground

        protected Color disabledForeground
      • selectedBackground

        protected Color selectedBackground
      • selectedForeground

        protected Color selectedForeground
      • underlineColor

        protected Color underlineColor
      • inactiveUnderlineColor

        protected Color inactiveUnderlineColor
        Since:
        2.2
      • disabledUnderlineColor

        protected Color disabledUnderlineColor
      • hoverColor

        protected Color hoverColor
      • hoverForeground

        protected Color hoverForeground
        Since:
        3.1
      • focusColor

        protected Color focusColor
      • focusForeground

        protected Color focusForeground
        Since:
        3.1
      • tabSeparatorColor

        protected Color tabSeparatorColor
      • contentAreaColor

        protected Color contentAreaColor
      • minimumTabWidth

        protected int minimumTabWidth
      • maximumTabWidth

        protected int maximumTabWidth
      • tabHeight

        protected int tabHeight
      • tabSelectionHeight

        protected int tabSelectionHeight
      • cardTabSelectionHeight

        protected int cardTabSelectionHeight
        Since:
        2
      • tabArc

        protected int tabArc
        Since:
        3.2
      • tabSelectionArc

        protected int tabSelectionArc
        Since:
        3.2
      • cardTabArc

        protected int cardTabArc
        Since:
        3.2
      • selectedInsets

        protected Insets selectedInsets
        Since:
        3.2
      • tabSelectionInsets

        protected Insets tabSelectionInsets
        Since:
        3.2
      • contentSeparatorHeight

        protected int contentSeparatorHeight
      • showTabSeparators

        protected boolean showTabSeparators
      • tabSeparatorsFullHeight

        protected boolean tabSeparatorsFullHeight
      • hasFullBorder

        protected boolean hasFullBorder
      • tabsOpaque

        protected boolean tabsOpaque
      • rotateTabRuns

        protected boolean rotateTabRuns
        Since:
        2.5
      • closeIcon

        protected Icon closeIcon
      • arrowType

        protected String arrowType
      • buttonInsets

        protected Insets buttonInsets
      • buttonArc

        protected int buttonArc
      • buttonHoverBackground

        protected Color buttonHoverBackground
      • buttonPressedBackground

        protected Color buttonPressedBackground
      • moreTabsButtonToolTipText

        protected String moreTabsButtonToolTipText
      • tabCloseToolTipText

        protected String tabCloseToolTipText
        Since:
        2
      • showContentSeparator

        protected boolean showContentSeparator
        Since:
        2
      • hideTabAreaWithOneTab

        protected boolean hideTabAreaWithOneTab
        Since:
        2
      • tabClosable

        protected boolean tabClosable
        Since:
        2
      • tabIconPlacement

        protected int tabIconPlacement
        Since:
        2
      • tabViewport

        protected JViewport tabViewport
    • Constructor Detail

      • FlatTabbedPaneUI

        public FlatTabbedPaneUI()
    • Method Detail

      • installHiddenTabsNavigation

        protected void installHiddenTabsNavigation()
      • uninstallHiddenTabsNavigation

        protected void uninstallHiddenTabsNavigation()
      • installLeadingComponent

        protected void installLeadingComponent()
      • uninstallLeadingComponent

        protected void uninstallLeadingComponent()
      • installTrailingComponent

        protected void installTrailingComponent()
      • uninstallTrailingComponent

        protected void uninstallTrailingComponent()
      • createMoreTabsButton

        protected JButton createMoreTabsButton()
      • installStyle

        protected void installStyle()
        Since:
        2
      • applyStyle

        protected void applyStyle​(Object style)
        Since:
        2
      • applyStyleProperty

        protected Object applyStyleProperty​(String key,
                                            Object value)
        Since:
        2
      • setRolloverTab

        protected void setRolloverTab​(int x,
                                      int y)
      • isRolloverTabClose

        protected boolean isRolloverTabClose()
      • setRolloverTabClose

        protected void setRolloverTabClose​(boolean rollover)
      • isPressedTabClose

        protected boolean isPressedTabClose()
      • setPressedTabClose

        protected void setPressedTabClose​(boolean pressed)
      • getRealTabAreaInsets

        protected Insets getRealTabAreaInsets​(int tabPlacement)
      • getContentBorderInsets

        protected Insets getContentBorderInsets​(int tabPlacement)
        The content border insets are used to create a separator between tabs and content. If client property JTabbedPane.hasFullBorder is true, then the content border insets are also used for the border.
        Overrides:
        getContentBorderInsets in class BasicTabbedPaneUI
      • getTabForeground

        protected Color getTabForeground​(int tabPlacement,
                                         int tabIndex,
                                         boolean isSelected)
        Since:
        3.1
      • paintTabBackground

        protected void paintTabBackground​(Graphics g,
                                          int tabPlacement,
                                          int tabIndex,
                                          int x,
                                          int y,
                                          int w,
                                          int h,
                                          boolean isSelected)
        Overrides:
        paintTabBackground in class BasicTabbedPaneUI
      • getTabBackground

        protected Color getTabBackground​(int tabPlacement,
                                         int tabIndex,
                                         boolean isSelected)
        Since:
        2
      • paintTabBorder

        protected void paintTabBorder​(Graphics g,
                                      int tabPlacement,
                                      int tabIndex,
                                      int x,
                                      int y,
                                      int w,
                                      int h,
                                      boolean isSelected)
        Overrides:
        paintTabBorder in class BasicTabbedPaneUI
      • paintCardTabBorder

        protected void paintCardTabBorder​(Graphics g,
                                          int tabPlacement,
                                          int tabIndex,
                                          int x,
                                          int y,
                                          int w,
                                          int h)
        Since:
        2
      • createCardTabOuterPath

        protected Shape createCardTabOuterPath​(int tabPlacement,
                                               int x,
                                               int y,
                                               int w,
                                               int h)
        Since:
        3.2
      • createCardTabInnerPath

        protected Shape createCardTabInnerPath​(int tabPlacement,
                                               int x,
                                               int y,
                                               int w,
                                               int h)
        Since:
        3.2
      • paintTabCloseButton

        protected void paintTabCloseButton​(Graphics g,
                                           int tabIndex,
                                           int x,
                                           int y,
                                           int w,
                                           int h)
      • paintTabSeparator

        protected void paintTabSeparator​(Graphics g,
                                         int tabPlacement,
                                         int x,
                                         int y,
                                         int w,
                                         int h)
      • paintTabSelection

        protected void paintTabSelection​(Graphics g,
                                         int tabPlacement,
                                         int tabIndex,
                                         int x,
                                         int y,
                                         int w,
                                         int h)
      • isTabbedPaneOrChildFocused

        protected boolean isTabbedPaneOrChildFocused()
        Since:
        2.2
      • paintContentBorder

        protected void paintContentBorder​(Graphics g,
                                          int tabPlacement,
                                          int selectedIndex)
        Actually does nearly the same as super.paintContentBorder() but - not using UIManager.getColor("TabbedPane.contentAreaColor") to be GUI builder friendly - tabsOverlapBorder is always true - paint full border (if enabled) - not invoking paintContentBorder*Edge() methods - repaint selection - painting active tab border style
        Overrides:
        paintContentBorder in class BasicTabbedPaneUI
      • getTabCloseBounds

        protected Rectangle getTabCloseBounds​(int tabIndex,
                                              int x,
                                              int y,
                                              int w,
                                              int h,
                                              Rectangle dest)
      • getTabCloseHitArea

        protected Rectangle getTabCloseHitArea​(int tabIndex)
      • isTabClosable

        protected boolean isTabClosable​(int tabIndex)
      • closeTab

        protected void closeTab​(int tabIndex)
      • getTabClientProperty

        protected Object getTabClientProperty​(int tabIndex,
                                              String key)
      • getTabClientPropertyInt

        protected int getTabClientPropertyInt​(int tabIndex,
                                              String key,
                                              int defaultValue)
      • ensureCurrentLayout

        protected void ensureCurrentLayout()
      • isHorizontalTabPlacement

        protected boolean isHorizontalTabPlacement()
      • isSmoothScrollingEnabled

        protected boolean isSmoothScrollingEnabled()
      • hideTabArea

        protected boolean hideTabArea()
      • getTabType

        protected int getTabType()
        Since:
        2
      • getTabsPopupPolicy

        protected int getTabsPopupPolicy()
      • getScrollButtonsPolicy

        protected int getScrollButtonsPolicy()
      • getScrollButtonsPlacement

        protected int getScrollButtonsPlacement()
      • getTabAreaAlignment

        protected int getTabAreaAlignment()
      • getTabAlignment

        protected int getTabAlignment​(int tabIndex)
      • getTabWidthMode

        protected int getTabWidthMode()
      • parseTabType

        protected static int parseTabType​(String str)
        Since:
        2
      • parseTabsPopupPolicy

        protected static int parseTabsPopupPolicy​(String str)
      • parseScrollButtonsPolicy

        protected static int parseScrollButtonsPolicy​(String str)
      • parseScrollButtonsPlacement

        protected static int parseScrollButtonsPlacement​(String str)
      • parseAlignment

        protected static int parseAlignment​(String str,
                                            int defaultValue)
      • parseTabWidthMode

        protected static int parseTabWidthMode​(String str)
      • parseTabIconPlacement

        protected static int parseTabIconPlacement​(String str)
      • ensureSelectedTabIsVisibleLater

        protected void ensureSelectedTabIsVisibleLater()
      • ensureSelectedTabIsVisible

        protected void ensureSelectedTabIsVisible()