private void defineToolBars(UIDefaults d){
  d.put("ToolBar.contentMargins",new InsetsUIResource(2,2,2,2));
  d.put("ToolBar.opaque",Boolean.TRUE);
  d.put("ToolBar:Button.contentMargins",new InsetsUIResource(4,4,4,4));
  d.put("ToolBar:ToggleButton.contentMargins",new InsetsUIResource(4,4,4,4));
  addColor(d,"ToolBar:ToggleButton[Disabled+Selected].textForeground","seaGlassDisabledText",0.0f,0.0f,0.0f,0);
  d.put("ToolBarSeparator.contentMargins",new InsetsUIResource(2,0,3,0));
  addColor(d,"ToolBarSeparator.textForeground","seaGlassBorder",0.0f,0.0f,0.0f,0);
  d.put("toolbarHandleMac",new Color(0xc8191919,true));
  d.put("toolbarToggleButtonBase",new Color(0x5b7ea4,true));
  if ((!PlatformUtils.isMac())) {
    d.put("seaGlassToolBarActiveTopT",new Color(0x466c97));
    d.put("seaGlassToolBarActiveBottomB",new Color(0x466c97));
    d.put("seaGlassToolBarInactiveTopT",new Color(0xe9e9e9));
    d.put("seaGlassToolBarInactiveBottomB",new Color(0xcacaca));
  }
 else   if (PlatformUtils.isLion()) {
    d.put("seaGlassToolBarActiveTopT",new Color(0xdedede));
    d.put("seaGlassToolBarActiveBottomB",new Color(0xb0b0b0));
    d.put("seaGlassToolBarInactiveTopT",new Color(0xf3f3f3));
    d.put("seaGlassToolBarInactiveBottomB",new Color(0xdedede));
  }
 else   if (PlatformUtils.isSnowLeopard()) {
    d.put("seaGlassToolBarActiveTopT",new Color(0xc9c9c9));
    d.put("seaGlassToolBarActiveBottomB",new Color(0xa7a7a7));
    d.put("seaGlassToolBarInactiveTopT",new Color(0xe9e9e9));
    d.put("seaGlassToolBarInactiveBottomB",new Color(0xcacaca));
  }
 else {
    d.put("seaGlassToolBarActiveTopT",new Color(0xbcbcbc));
    d.put("seaGlassToolBarActiveBottomB",new Color(0xa7a7a7));
    d.put("seaGlassToolBarInactiveTopT",new Color(0xe4e4e4));
    d.put("seaGlassToolBarInactiveBottomB",new Color(0xd8d8d8));
  }
  String c=PAINTER_PREFIX + "ToolBarPainter";
  String p="ToolBar";
  d.put(p + ".contentMargins",new InsetsUIResource(2,2,2,2));
  d.put(p + ".opaque",Boolean.TRUE);
  d.put(p + ".States","WindowIsActive");
  d.put(p + ".WindowIsActive",new ToolBarWindowIsActiveState());
  d.put(p + ".backgroundPainter",new LazyPainter(c,ToolBarPainter.Which.BORDER_ENABLED));
  c=PAINTER_PREFIX + "ToolBarHandlePainter";
  d.put(p + ".handleIconPainter",new LazyPainter(c,ToolBarHandlePainter.Which.HANDLEICON_ENABLED));
  d.put(p + ".handleIcon",new SeaGlassIcon(p,"handleIconPainter",11,38));
  c=PAINTER_PREFIX + "ButtonPainter";
  p="ToolBar:Button";
  d.put(p + ".States","Enabled,Disabled,Focused,Pressed");
  d.put(p + "[Disabled].textForeground",d.get("seaGlassToolBarDisabledText"));
  d.put(p + "[Disabled].backgroundPainter",new LazyPainter(c,ButtonPainter.Which.BACKGROUND_DISABLED));
  d.put(p + "[Enabled].backgroundPainter",new LazyPainter(c,ButtonPainter.Which.BACKGROUND_ENABLED));
  d.put(p + "[Focused].backgroundPainter",new LazyPainter(c,ButtonPainter.Which.BACKGROUND_FOCUSED));
  d.put(p + "[Pressed].backgroundPainter",new LazyPainter(c,ButtonPainter.Which.BACKGROUND_PRESSED));
  d.put(p + "[Focused+Pressed].backgroundPainter",new LazyPainter(c,ButtonPainter.Which.BACKGROUND_PRESSED_FOCUSED));
  c=PAINTER_PREFIX + "ToolBarToggleButtonPainter";
  p="ToolBar:ToggleButton";
  d.put(p + ".States","Enabled,Disabled,Focused,Pressed,Selected");
  d.put(p + "[Disabled].textForeground",d.get("seaGlassToolBarDisabledText"));
  d.put(p + "[Focused].backgroundPainter",new LazyPainter(c,ToolBarToggleButtonPainter.Which.BACKGROUND_FOCUSED));
  d.put(p + "[Pressed].backgroundPainter",new LazyPainter(c,ToolBarToggleButtonPainter.Which.BACKGROUND_PRESSED));
  d.put(p + "[Focused+Pressed].backgroundPainter",new LazyPainter(c,ToolBarToggleButtonPainter.Which.BACKGROUND_PRESSED_FOCUSED));
  d.put(p + "[Selected].backgroundPainter",new LazyPainter(c,ToolBarToggleButtonPainter.Which.BACKGROUND_SELECTED));
  d.put(p + "[Focused+Selected].backgroundPainter",new LazyPainter(c,ToolBarToggleButtonPainter.Which.BACKGROUND_SELECTED_FOCUSED));
  d.put(p + "[Pressed+Selected].backgroundPainter",new LazyPainter(c,ToolBarToggleButtonPainter.Which.BACKGROUND_PRESSED_SELECTED));
  d.put(p + "[Focused+Pressed+Selected].backgroundPainter",new LazyPainter(c,ToolBarToggleButtonPainter.Which.BACKGROUND_PRESSED_SELECTED_FOCUSED));
  d.put(p + "[Disabled+Selected].backgroundPainter",new LazyPainter(c,ToolBarToggleButtonPainter.Which.BACKGROUND_DISABLED_SELECTED));
  uiDefaults.put("ToolBarSeparator[Enabled].backgroundPainter",null);
}

private void defineToolBars ( UIDefaults d ) { d . put ( "ToolBar.contentMargins" , new InsetsUIResource ( 2 , 2 , 2 , 2 ) ) ; d . put ( "ToolBar.opaque" , Boolean . TRUE ) ; d . put ( "ToolBar:Button.contentMargins" , new InsetsUIResource ( 4 , 4 , 4 , 4 ) ) ; d . put ( "ToolBar:ToggleButton.contentMargins" , new InsetsUIResource ( 4 , 4 , 4 , 4 ) ) ; addColor ( d , "ToolBar:ToggleButton[Disabled+Selected].textForeground" , "seaGlassDisabledText" , 0.0f , 0.0f , 0.0f , 0 ) ; d . put ( "ToolBarSeparator.contentMargins" , new InsetsUIResource ( 2 , 0 , 3 , 0 ) ) ; addColor ( d , "ToolBarSeparator.textForeground" , "seaGlassBorder" , 0.0f , 0.0f , 0.0f , 0 ) ; d . put ( "toolbarHandleMac" , new Color ( 0xc8191919 , true ) ) ; d . put ( "toolbarToggleButtonBase" , new Color ( 0x5b7ea4 , true ) ) ; if ( ( ! PlatformUtils . isMac ( ) ) ) { d . put ( "seaGlassToolBarActiveTopT" , new Color ( 0x466c97 ) ) ; d . put ( "seaGlassToolBarActiveBottomB" , new Color ( 0x466c97 ) ) ; d . put ( "seaGlassToolBarInactiveTopT" , new Color ( 0xe9e9e9 ) ) ; d . put ( "seaGlassToolBarInactiveBottomB" , new Color ( 0xcacaca ) ) ; } else if ( PlatformUtils . isLion ( ) ) { d . put ( "seaGlassToolBarActiveTopT" , new Color ( 0xdedede ) ) ; d . put ( "seaGlassToolBarActiveBottomB" , new Color ( 0xb0b0b0 ) ) ; d . put ( "seaGlassToolBarInactiveTopT" , new Color ( 0xf3f3f3 ) ) ; d . put ( "seaGlassToolBarInactiveBottomB" , new Color ( 0xdedede ) ) ; } else if ( PlatformUtils . isSnowLeopard ( ) ) { d . put ( "seaGlassToolBarActiveTopT" , new Color ( 0xc9c9c9 ) ) ; d . put ( "seaGlassToolBarActiveBottomB" , new Color ( 0xa7a7a7 ) ) ; d . put ( "seaGlassToolBarInactiveTopT" , new Color ( 0xe9e9e9 ) ) ; d . put ( "seaGlassToolBarInactiveBottomB" , new Color ( 0xcacaca ) ) ; } else { d . put ( "seaGlassToolBarActiveTopT" , new Color ( 0xbcbcbc ) ) ; d . put ( "seaGlassToolBarActiveBottomB" , new Color ( 0xa7a7a7 ) ) ; d . put ( "seaGlassToolBarInactiveTopT" , new Color ( 0xe4e4e4 ) ) ; d . put ( "seaGlassToolBarInactiveBottomB" , new Color ( 0xd8d8d8 ) ) ; } String c = PAINTER_PREFIX + "ToolBarPainter" ; String p = "ToolBar" ; d . put ( p + ".contentMargins" , new InsetsUIResource ( 2 , 2 , 2 , 2 ) ) ; d . put ( p + ".opaque" , Boolean . TRUE ) ; d . put ( p + ".States" , "WindowIsActive" ) ; d . put ( p + ".WindowIsActive" , new ToolBarWindowIsActiveState ( ) ) ; d . put ( p + ".backgroundPainter" , new LazyPainter ( c , ToolBarPainter . Which . BORDER_ENABLED ) ) ; c = PAINTER_PREFIX + "ToolBarHandlePainter" ; d . put ( p + ".handleIconPainter" , new LazyPainter ( c , ToolBarHandlePainter . Which . HANDLEICON_ENABLED ) ) ; d . put ( p + ".handleIcon" , new SeaGlassIcon ( p , "handleIconPainter" , 11 , 38 ) ) ; c = PAINTER_PREFIX + "ButtonPainter" ; p = "ToolBar:Button" ; d . put ( p + ".States" , "Enabled,Disabled,Focused,Pressed" ) ; d . put ( p + "[Disabled].textForeground" , d . get ( "seaGlassToolBarDisabledText" ) ) ; d . put ( p + "[Disabled].backgroundPainter" , new LazyPainter ( c , ButtonPainter . Which . BACKGROUND_DISABLED ) ) ; d . put ( p + "[Enabled].backgroundPainter" , new LazyPainter ( c , ButtonPainter . Which . BACKGROUND_ENABLED ) ) ; d . put ( p + "[Focused].backgroundPainter" , new LazyPainter ( c , ButtonPainter . Which . BACKGROUND_FOCUSED ) ) ; d . put ( p + "[Pressed].backgroundPainter" , new LazyPainter ( c , ButtonPainter . Which . BACKGROUND_PRESSED ) ) ; d . put ( p + "[Focused+Pressed].backgroundPainter" , new LazyPainter ( c , ButtonPainter . Which . BACKGROUND_PRESSED_FOCUSED ) ) ; c = PAINTER_PREFIX + "ToolBarToggleButtonPainter" ; p = "ToolBar:ToggleButton" ; d . put ( p + ".States" , "Enabled,Disabled,Focused,Pressed,Selected" ) ; d . put ( p + "[Disabled].textForeground" , d . get ( "seaGlassToolBarDisabledText" ) ) ; d . put ( p + "[Focused].backgroundPainter" , new LazyPainter ( c , ToolBarToggleButtonPainter . Which . BACKGROUND_FOCUSED ) ) ; d . put ( p + "[Pressed].backgroundPainter" , new LazyPainter ( c , ToolBarToggleButtonPainter . Which . BACKGROUND_PRESSED ) ) ; d . put ( p + "[Focused+Pressed].backgroundPainter" , new LazyPainter ( c , ToolBarToggleButtonPainter . Which . BACKGROUND_PRESSED_FOCUSED ) ) ; d . put ( p + "[Selected].backgroundPainter" , new LazyPainter ( c , ToolBarToggleButtonPainter . Which . BACKGROUND_SELECTED ) ) ; d . put ( p + "[Focused+Selected].backgroundPainter" , new LazyPainter ( c , ToolBarToggleButtonPainter . Which . BACKGROUND_SELECTED_FOCUSED ) ) ; d . put ( p + "[Pressed+Selected].backgroundPainter" , new LazyPainter ( c , ToolBarToggleButtonPainter . Which . BACKGROUND_PRESSED_SELECTED ) ) ; d . put ( p + "[Focused+Pressed+Selected].backgroundPainter" , new LazyPainter ( c , ToolBarToggleButtonPainter . Which . BACKGROUND_PRESSED_SELECTED_FOCUSED ) ) ; d . put ( p + "[Disabled+Selected].backgroundPainter" , new LazyPainter ( c , ToolBarToggleButtonPainter . Which . BACKGROUND_DISABLED_SELECTED ) ) ; uiDefaults . put ( "ToolBarSeparator[Enabled].backgroundPainter" , null ) ; }
initialize the tool bar settings .
