protected void paintTab(SeaGlassContext ss, Graphics g, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect) {
        Rectangle  tabRect       = rects[tabIndex];
        int        selectedIndex = tabPane.getSelectedIndex();
        boolean    isSelected    = selectedIndex == tabIndex;
        JComponent b             = ss.getComponent();

        boolean flipSegments    = (orientation == ControlOrientation.HORIZONTAL && !tabPane.getComponentOrientation().isLeftToRight());
        String  segmentPosition = "only";

        if (tabPane.getTabCount() > 1) {
            if (tabIndex == 0 && tabIndex == leadingTabIndex) {
                segmentPosition = flipSegments ? "last" : "first";
            } else if (tabIndex == tabPane.getTabCount() - 1 && tabIndex == trailingTabIndex) {
                segmentPosition = flipSegments ? "first" : "last";
            } else {
                segmentPosition = "middle";
            }
        }

        b.putClientProperty("JTabbedPane.Tab.segmentPosition", segmentPosition);
        updateTabContext(tabIndex, isSelected, isSelected && selectedTabIsPressed, getRolloverTab() == tabIndex,
                         getFocusIndex() == tabIndex);

        SeaGlassLookAndFeel.updateSubregion(ss, g, tabRect);

        int x      = tabRect.x;
        int y      = tabRect.y;
        int height = tabRect.height;
        int width  = tabRect.width;

        tabContext.getPainter().paintTabbedPaneTabBackground(tabContext, g, x, y, width, height, tabIndex, tabPlacement);
        tabContext.getPainter().paintTabbedPaneTabBorder(tabContext, g, x, y, width, height, tabIndex, tabPlacement);

        if (tabCloseButtonPlacement != CENTER) {
            tabRect = paintCloseButton(g, tabContext, tabIndex);
        }

        if (tabPane.getTabComponentAt(tabIndex) == null) {
            String      title   = tabPane.getTitleAt(tabIndex);
            Font        font    = ss.getStyle().getFont(ss);
            FontMetrics metrics = SwingUtilities2.getFontMetrics(tabPane, g, font);
            Icon        icon    = getIconForTab(tabIndex);

            layoutLabel(ss, tabPlacement, metrics, tabIndex, title, icon, tabRect, iconRect, textRect, isSelected);
            paintText(ss, g, tabPlacement, font, metrics, tabIndex, title, textRect, isSelected);
            paintIcon(g, tabPlacement, tabIndex, icon, iconRect, isSelected);
        }
    }
protected void paintTab ( SeaGlassContext ss , Graphics g , Rectangle [ ] rects , int tabIndex , Rectangle iconRect , Rectangle textRect ) { Rectangle tabRect = rects [ tabIndex ] ; int selectedIndex = tabPane . getSelectedIndex ( ) ; boolean isSelected = selectedIndex == tabIndex ; JComponent b = ss . getComponent ( ) ; boolean flipSegments = ( orientation == ControlOrientation . HORIZONTAL && ! tabPane . getComponentOrientation ( ) . isLeftToRight ( ) ) ; String segmentPosition = "only" ; if ( tabPane . getTabCount ( ) > 1 ) { if ( tabIndex == 0 && tabIndex == leadingTabIndex ) { segmentPosition = flipSegments ? "last" : "first" ; } else if ( tabIndex == tabPane . getTabCount ( ) - 1 && tabIndex == trailingTabIndex ) { segmentPosition = flipSegments ? "first" : "last" ; } else { segmentPosition = "middle" ; } } b . putClientProperty ( "JTabbedPane.Tab.segmentPosition" , segmentPosition ) ; updateTabContext ( tabIndex , isSelected , isSelected && selectedTabIsPressed , getRolloverTab ( ) == tabIndex , getFocusIndex ( ) == tabIndex ) ; SeaGlassLookAndFeel . updateSubregion ( ss , g , tabRect ) ; int x = tabRect . x ; int y = tabRect . y ; int height = tabRect . height ; int width = tabRect . width ; tabContext . getPainter ( ) . paintTabbedPaneTabBackground ( tabContext , g , x , y , width , height , tabIndex , tabPlacement ) ; tabContext . getPainter ( ) . paintTabbedPaneTabBorder ( tabContext , g , x , y , width , height , tabIndex , tabPlacement ) ; if ( tabCloseButtonPlacement != CENTER ) { tabRect = paintCloseButton ( g , tabContext , tabIndex ) ; } if ( tabPane . getTabComponentAt ( tabIndex ) == null ) { String title = tabPane . getTitleAt ( tabIndex ) ; Font font = ss . getStyle ( ) . getFont ( ss ) ; FontMetrics metrics = SwingUtilities2 . getFontMetrics ( tabPane , g , font ) ; Icon icon = getIconForTab ( tabIndex ) ; layoutLabel ( ss , tabPlacement , metrics , tabIndex , title , icon , tabRect , iconRect , textRect , isSelected ) ; paintText ( ss , g , tabPlacement , font , metrics , tabIndex , title , textRect , isSelected ) ; paintIcon ( g , tabPlacement , tabIndex , icon , iconRect , isSelected ) ; } }
Paint a tab.

@param ss       the SynthContext.
@param g        the Graphics context.
@param rects    the array containing the bounds for the tabs.
@param tabIndex the tab index to paint.
@param iconRect the bounds in which to paint the tab icon, if any.
@param textRect the bounds in which to paint the tab text, if any.