private void updateStyle ( JTabbedPane c ) { SeaGlassContext context = getContext ( c , ENABLED ) ; SynthStyle oldStyle = style ; style = SeaGlassLookAndFeel . updateStyle ( context , this ) ; tabPlacement = tabPane . getTabPlacement ( ) ; orientation = ControlOrientation . getOrientation ( tabPlacement == LEFT || tabPlacement == RIGHT ? VERTICAL : HORIZONTAL ) ; closeButtonArmedIndex = - 1 ; Object o = c . getClientProperty ( "JTabbedPane.closeButton" ) ; if ( o != null && "left" . equals ( o ) ) { tabCloseButtonPlacement = LEFT ; } else if ( o != null && "right" . equals ( o ) ) { tabCloseButtonPlacement = RIGHT ; } else { tabCloseButtonPlacement = CENTER ; } closeButtonSize = style . getInt ( context , "closeButtonSize" , 6 ) ; closeButtonInsets = ( Insets ) style . get ( context , "closeButtonInsets" ) ; if ( closeButtonInsets == null ) { closeButtonInsets = new Insets ( 2 , 2 , 2 , 2 ) ; } o = c . getClientProperty ( "JTabbedPane.closeListener" ) ; if ( o != null && o instanceof SeaGlassTabCloseListener ) { if ( tabCloseListener == null ) { tabCloseListener = ( SeaGlassTabCloseListener ) o ; } } // Add properties other than JComponent colors, Borders and // opacity settings here: if ( style != oldStyle ) { tabRunOverlay = 0 ; textIconGap = style . getInt ( context , "TabbedPane.textIconGap" , 0 ) ; selectedTabPadInsets = ( Insets ) style . get ( context , "TabbedPane.selectedTabPadInsets" ) ; if ( selectedTabPadInsets == null ) { selectedTabPadInsets = new Insets ( 0 , 0 , 0 , 0 ) ; } if ( oldStyle != null ) { uninstallKeyboardActions ( ) ; installKeyboardActions ( ) ; } } context . dispose ( ) ; if ( tabContext != null ) { tabContext . dispose ( ) ; } tabContext = getContext ( c , Region . TABBED_PANE_TAB , ENABLED ) ; this . tabStyle = SeaGlassLookAndFeel . updateStyle ( tabContext , this ) ; tabInsets = tabStyle . getInsets ( tabContext , null ) ; if ( tabCloseContext != null ) { tabCloseContext . dispose ( ) ; } tabCloseContext = getContext ( c , SeaGlassRegion . TABBED_PANE_TAB_CLOSE_BUTTON , ENABLED ) ; this . tabCloseStyle = SeaGlassLookAndFeel . updateStyle ( tabCloseContext , this ) ; if ( tabAreaContext != null ) { tabAreaContext . dispose ( ) ; } tabAreaContext = getContext ( c , Region . TABBED_PANE_TAB_AREA , ENABLED ) ; this . tabAreaStyle = SeaGlassLookAndFeel . updateStyle ( tabAreaContext , this ) ; tabAreaInsets = tabAreaStyle . getInsets ( tabAreaContext , null ) ; if ( tabContentContext != null ) { tabContentContext . dispose ( ) ; } tabContentContext = getContext ( c , Region . TABBED_PANE_CONTENT , ENABLED ) ; this . tabContentStyle = SeaGlassLookAndFeel . updateStyle ( tabContentContext , this ) ; contentBorderInsets = tabContentStyle . getInsets ( tabContentContext , null ) ; }
Update the Synth styles when something changes .