7027696: /jfc/Metalworks demo needs to be improved
authormrkam
Thu, 24 Mar 2011 18:15:51 +0100
changeset 8961 6e8562ef340d
parent 8960 dbf27b0abc4c
child 8962 8833da0e7bc9
7027696: /jfc/Metalworks demo needs to be improved Reviewed-by: rupashka
jdk/src/share/demo/jfc/Metalworks/AquaMetalTheme.java
jdk/src/share/demo/jfc/Metalworks/BigContrastMetalTheme.java
jdk/src/share/demo/jfc/Metalworks/ContrastMetalTheme.java
jdk/src/share/demo/jfc/Metalworks/DemoMetalTheme.java
jdk/src/share/demo/jfc/Metalworks/GreenMetalTheme.java
jdk/src/share/demo/jfc/Metalworks/KhakiMetalTheme.java
jdk/src/share/demo/jfc/Metalworks/MetalThemeMenu.java
jdk/src/share/demo/jfc/Metalworks/Metalworks.java
jdk/src/share/demo/jfc/Metalworks/MetalworksDocumentFrame.java
jdk/src/share/demo/jfc/Metalworks/MetalworksFrame.java
jdk/src/share/demo/jfc/Metalworks/MetalworksHelp.java
jdk/src/share/demo/jfc/Metalworks/MetalworksInBox.java
jdk/src/share/demo/jfc/Metalworks/MetalworksPrefs.java
jdk/src/share/demo/jfc/Metalworks/PropertiesMetalTheme.java
jdk/src/share/demo/jfc/Metalworks/UISwitchListener.java
jdk/src/share/demo/jfc/Metalworks/resources/HelpFiles/credits.html
jdk/src/share/demo/jfc/Metalworks/resources/HelpFiles/metal.html
jdk/src/share/demo/jfc/Metalworks/resources/HelpFiles/metalworks.html
jdk/src/share/demo/jfc/Metalworks/resources/HelpFiles/swing.html
jdk/src/share/demo/jfc/Metalworks/resources/HelpFiles/toc.html
--- a/jdk/src/share/demo/jfc/Metalworks/AquaMetalTheme.java	Thu Mar 24 18:13:12 2011 +0100
+++ b/jdk/src/share/demo/jfc/Metalworks/AquaMetalTheme.java	Thu Mar 24 18:15:51 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,31 +29,39 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
-
 
-import javax.swing.plaf.*;
-import javax.swing.plaf.metal.*;
-import javax.swing.*;
-import javax.swing.border.*;
-import java.awt.*;
+import javax.swing.plaf.ColorUIResource;
+import javax.swing.plaf.metal.DefaultMetalTheme;
+
 
 /**
  * This class describes a theme using "blue-green" colors.
  *
  * @author Steve Wilson
+ * @author Alexander Kouznetsov
  */
 public class AquaMetalTheme extends DefaultMetalTheme {
 
-    public String getName() { return "Oxide"; }
-
+    @Override
+    public String getName() {
+        return "Oxide";
+    }
     private final ColorUIResource primary1 = new ColorUIResource(102, 153, 153);
     private final ColorUIResource primary2 = new ColorUIResource(128, 192, 192);
     private final ColorUIResource primary3 = new ColorUIResource(159, 235, 235);
 
-    protected ColorUIResource getPrimary1() { return primary1; }
-    protected ColorUIResource getPrimary2() { return primary2; }
-    protected ColorUIResource getPrimary3() { return primary3; }
+    @Override
+    protected ColorUIResource getPrimary1() {
+        return primary1;
+    }
 
+    @Override
+    protected ColorUIResource getPrimary2() {
+        return primary2;
+    }
+
+    @Override
+    protected ColorUIResource getPrimary3() {
+        return primary3;
+    }
 }
--- a/jdk/src/share/demo/jfc/Metalworks/BigContrastMetalTheme.java	Thu Mar 24 18:13:12 2011 +0100
+++ b/jdk/src/share/demo/jfc/Metalworks/BigContrastMetalTheme.java	Thu Mar 24 18:15:51 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,9 +29,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
-
 
 import javax.swing.plaf.*;
 import javax.swing.plaf.metal.*;
@@ -39,54 +36,91 @@
 import javax.swing.border.*;
 import java.awt.*;
 
+
 /**
  * This class describes a theme using "green" colors.
  *
  * @author Steve Wilson
+ * @author Alexander Kouznetsov
  */
 public class BigContrastMetalTheme extends ContrastMetalTheme {
 
-    public String getName() { return "Low Vision"; }
+    @Override
+    public String getName() {
+        return "Low Vision";
+    }
+    private final FontUIResource controlFont = new FontUIResource("Dialog",
+            Font.BOLD, 24);
+    private final FontUIResource systemFont = new FontUIResource("Dialog",
+            Font.PLAIN, 24);
+    private final FontUIResource windowTitleFont = new FontUIResource("Dialog",
+            Font.BOLD, 24);
+    private final FontUIResource userFont = new FontUIResource("SansSerif",
+            Font.PLAIN, 24);
+    private final FontUIResource smallFont = new FontUIResource("Dialog",
+            Font.PLAIN, 20);
+
+    @Override
+    public FontUIResource getControlTextFont() {
+        return controlFont;
+    }
+
+    @Override
+    public FontUIResource getSystemTextFont() {
+        return systemFont;
+    }
 
-    private final FontUIResource controlFont = new FontUIResource("Dialog", Font.BOLD, 24);
-    private final FontUIResource systemFont = new FontUIResource("Dialog", Font.PLAIN, 24);
-    private final FontUIResource windowTitleFont = new FontUIResource("Dialog", Font.BOLD, 24);
-    private final FontUIResource userFont = new FontUIResource("SansSerif", Font.PLAIN, 24);
-    private final FontUIResource smallFont = new FontUIResource("Dialog", Font.PLAIN, 20);
+    @Override
+    public FontUIResource getUserTextFont() {
+        return userFont;
+    }
+
+    @Override
+    public FontUIResource getMenuTextFont() {
+        return controlFont;
+    }
+
+    @Override
+    public FontUIResource getWindowTitleFont() {
+        return windowTitleFont;
+    }
+
+    @Override
+    public FontUIResource getSubTextFont() {
+        return smallFont;
+    }
+
+    @Override
+    public void addCustomEntriesToTable(UIDefaults table) {
+        super.addCustomEntriesToTable(table);
+
+        final int internalFrameIconSize = 30;
+        table.put("InternalFrame.closeIcon", MetalIconFactory.
+                getInternalFrameCloseIcon(internalFrameIconSize));
+        table.put("InternalFrame.maximizeIcon", MetalIconFactory.
+                getInternalFrameMaximizeIcon(internalFrameIconSize));
+        table.put("InternalFrame.iconifyIcon", MetalIconFactory.
+                getInternalFrameMinimizeIcon(internalFrameIconSize));
+        table.put("InternalFrame.minimizeIcon", MetalIconFactory.
+                getInternalFrameAltMaximizeIcon(internalFrameIconSize));
 
 
-    public FontUIResource getControlTextFont() { return controlFont;}
-    public FontUIResource getSystemTextFont() { return systemFont;}
-    public FontUIResource getUserTextFont() { return userFont;}
-    public FontUIResource getMenuTextFont() { return controlFont;}
-    public FontUIResource getWindowTitleFont() { return windowTitleFont;}
-    public FontUIResource getSubTextFont() { return smallFont;}
+        Border blackLineBorder = new BorderUIResource(new MatteBorder(2, 2, 2, 2,
+                Color.black));
+        Border textBorder = blackLineBorder;
 
-    public void addCustomEntriesToTable(UIDefaults table) {
-         super.addCustomEntriesToTable(table);
-
-         final int internalFrameIconSize = 30;
-         table.put("InternalFrame.closeIcon", MetalIconFactory.getInternalFrameCloseIcon(internalFrameIconSize));
-         table.put("InternalFrame.maximizeIcon", MetalIconFactory.getInternalFrameMaximizeIcon(internalFrameIconSize));
-         table.put("InternalFrame.iconifyIcon", MetalIconFactory.getInternalFrameMinimizeIcon(internalFrameIconSize));
-         table.put("InternalFrame.minimizeIcon", MetalIconFactory.getInternalFrameAltMaximizeIcon(internalFrameIconSize));
+        table.put("ToolTip.border", blackLineBorder);
+        table.put("TitledBorder.border", blackLineBorder);
 
 
-        Border blackLineBorder = new BorderUIResource( new MatteBorder( 2,2,2,2, Color.black) );
-        Border textBorder = blackLineBorder;
-
-        table.put( "ToolTip.border", blackLineBorder);
-        table.put( "TitledBorder.border", blackLineBorder);
-
+        table.put("TextField.border", textBorder);
+        table.put("PasswordField.border", textBorder);
+        table.put("TextArea.border", textBorder);
+        table.put("TextPane.font", textBorder);
 
-        table.put( "TextField.border", textBorder);
-        table.put( "PasswordField.border", textBorder);
-        table.put( "TextArea.border", textBorder);
-        table.put( "TextPane.font", textBorder);
+        table.put("ScrollPane.border", blackLineBorder);
 
-        table.put( "ScrollPane.border", blackLineBorder);
-
-        table.put( "ScrollBar.width", new Integer(25) );
+        table.put("ScrollBar.width", 25);
 
 
 
--- a/jdk/src/share/demo/jfc/Metalworks/ContrastMetalTheme.java	Thu Mar 24 18:13:12 2011 +0100
+++ b/jdk/src/share/demo/jfc/Metalworks/ContrastMetalTheme.java	Thu Mar 24 18:15:51 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,75 +29,131 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
-import javax.swing.plaf.*;
-import javax.swing.plaf.basic.*;
-import javax.swing.plaf.metal.*;
-import javax.swing.*;
-import javax.swing.border.*;
-import java.awt.*;
+import javax.swing.UIDefaults;
+import javax.swing.border.Border;
+import javax.swing.border.CompoundBorder;
+import javax.swing.border.LineBorder;
+import javax.swing.plaf.BorderUIResource;
+import javax.swing.plaf.ColorUIResource;
+import javax.swing.plaf.basic.BasicBorders;
+import javax.swing.plaf.metal.DefaultMetalTheme;
+
 
 /**
  * This class describes a higher-contrast Metal Theme.
  *
  * @author Michael C. Albers
+ * @author Alexander Kouznetsov
  */
-
 public class ContrastMetalTheme extends DefaultMetalTheme {
 
-    public String getName() { return "Contrast"; }
-
+    @Override
+    public String getName() {
+        return "Contrast";
+    }
     private final ColorUIResource primary1 = new ColorUIResource(0, 0, 0);
     private final ColorUIResource primary2 = new ColorUIResource(204, 204, 204);
     private final ColorUIResource primary3 = new ColorUIResource(255, 255, 255);
-    private final ColorUIResource primaryHighlight = new ColorUIResource(102,102,102);
+    private final ColorUIResource primaryHighlight = new ColorUIResource(102,
+            102, 102);
+    private final ColorUIResource secondary2 =
+            new ColorUIResource(204, 204, 204);
+    private final ColorUIResource secondary3 =
+            new ColorUIResource(255, 255, 255);
+
+    @Override
+    protected ColorUIResource getPrimary1() {
+        return primary1;
+    }
+
+    @Override
+    protected ColorUIResource getPrimary2() {
+        return primary2;
+    }
 
-    private final ColorUIResource secondary2 = new ColorUIResource(204, 204, 204);
-    private final ColorUIResource secondary3 = new ColorUIResource(255, 255, 255);
-    private final ColorUIResource controlHighlight = new ColorUIResource(102,102,102);
+    @Override
+    protected ColorUIResource getPrimary3() {
+        return primary3;
+    }
+
+    @Override
+    public ColorUIResource getPrimaryControlHighlight() {
+        return primaryHighlight;
+    }
 
-    protected ColorUIResource getPrimary1() { return primary1; }
-    protected ColorUIResource getPrimary2() { return primary2; }
-    protected ColorUIResource getPrimary3() { return primary3; }
-    public ColorUIResource getPrimaryControlHighlight() { return primaryHighlight;}
+    @Override
+    protected ColorUIResource getSecondary2() {
+        return secondary2;
+    }
+
+    @Override
+    protected ColorUIResource getSecondary3() {
+        return secondary3;
+    }
 
-    protected ColorUIResource getSecondary2() { return secondary2; }
-    protected ColorUIResource getSecondary3() { return secondary3; }
-    public ColorUIResource getControlHighlight() { return super.getSecondary3(); }
+    @Override
+    public ColorUIResource getControlHighlight() {
+        return super.getSecondary3();
+    }
+
+    @Override
+    public ColorUIResource getFocusColor() {
+        return getBlack();
+    }
 
-    public ColorUIResource getFocusColor() { return getBlack(); }
+    @Override
+    public ColorUIResource getTextHighlightColor() {
+        return getBlack();
+    }
+
+    @Override
+    public ColorUIResource getHighlightedTextColor() {
+        return getWhite();
+    }
 
-    public ColorUIResource getTextHighlightColor() { return getBlack(); }
-    public ColorUIResource getHighlightedTextColor() { return getWhite(); }
+    @Override
+    public ColorUIResource getMenuSelectedBackground() {
+        return getBlack();
+    }
+
+    @Override
+    public ColorUIResource getMenuSelectedForeground() {
+        return getWhite();
+    }
 
-    public ColorUIResource getMenuSelectedBackground() { return getBlack(); }
-    public ColorUIResource getMenuSelectedForeground() { return getWhite(); }
-    public ColorUIResource getAcceleratorForeground() { return getBlack(); }
-    public ColorUIResource getAcceleratorSelectedForeground() { return getWhite(); }
+    @Override
+    public ColorUIResource getAcceleratorForeground() {
+        return getBlack();
+    }
 
+    @Override
+    public ColorUIResource getAcceleratorSelectedForeground() {
+        return getWhite();
+    }
 
+    @Override
     public void addCustomEntriesToTable(UIDefaults table) {
 
-        Border blackLineBorder = new BorderUIResource(new LineBorder( getBlack() ));
-        Border whiteLineBorder = new BorderUIResource(new LineBorder( getWhite() ));
+        Border blackLineBorder =
+                new BorderUIResource(new LineBorder(getBlack()));
+        Border whiteLineBorder =
+                new BorderUIResource(new LineBorder(getWhite()));
 
-        Object textBorder = new BorderUIResource( new CompoundBorder(
-                                                       blackLineBorder,
-                                                       new BasicBorders.MarginBorder()));
+        Object textBorder = new BorderUIResource(new CompoundBorder(
+                blackLineBorder,
+                new BasicBorders.MarginBorder()));
 
-        table.put( "ToolTip.border", blackLineBorder);
-        table.put( "TitledBorder.border", blackLineBorder);
-        table.put( "Table.focusCellHighlightBorder", whiteLineBorder);
-        table.put( "Table.focusCellForeground", getWhite());
+        table.put("ToolTip.border", blackLineBorder);
+        table.put("TitledBorder.border", blackLineBorder);
+        table.put("Table.focusCellHighlightBorder", whiteLineBorder);
+        table.put("Table.focusCellForeground", getWhite());
 
-        table.put( "TextField.border", textBorder);
-        table.put( "PasswordField.border", textBorder);
-        table.put( "TextArea.border", textBorder);
-        table.put( "TextPane.font", textBorder);
+        table.put("TextField.border", textBorder);
+        table.put("PasswordField.border", textBorder);
+        table.put("TextArea.border", textBorder);
+        table.put("TextPane.font", textBorder);
 
 
     }
-
 }
--- a/jdk/src/share/demo/jfc/Metalworks/DemoMetalTheme.java	Thu Mar 24 18:13:12 2011 +0100
+++ b/jdk/src/share/demo/jfc/Metalworks/DemoMetalTheme.java	Thu Mar 24 18:15:51 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,15 +29,13 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
-
 
-import javax.swing.plaf.*;
-import javax.swing.plaf.metal.*;
-import javax.swing.*;
-import javax.swing.border.*;
-import java.awt.*;
+import java.awt.Font;
+import javax.swing.UIDefaults;
+import javax.swing.plaf.FontUIResource;
+import javax.swing.plaf.metal.DefaultMetalTheme;
+import javax.swing.plaf.metal.MetalIconFactory;
+
 
 /**
  * This class describes a theme using large fonts.
@@ -45,37 +43,71 @@
  * where people will have trouble seeing what you're doing.
  *
  * @author Steve Wilson
+ * @author Alexander Kouznetsov
  */
 public class DemoMetalTheme extends DefaultMetalTheme {
 
-    public String getName() { return "Presentation"; }
+    @Override
+    public String getName() {
+        return "Presentation";
+    }
+    private final FontUIResource controlFont = new FontUIResource("Dialog",
+            Font.BOLD, 18);
+    private final FontUIResource systemFont = new FontUIResource("Dialog",
+            Font.PLAIN, 18);
+    private final FontUIResource userFont = new FontUIResource("SansSerif",
+            Font.PLAIN, 18);
+    private final FontUIResource smallFont = new FontUIResource("Dialog",
+            Font.PLAIN, 14);
 
-    private final FontUIResource controlFont = new FontUIResource("Dialog", Font.BOLD, 18);
-    private final FontUIResource systemFont = new FontUIResource("Dialog", Font.PLAIN, 18);
-    private final FontUIResource userFont = new FontUIResource("SansSerif", Font.PLAIN, 18);
-    private final FontUIResource smallFont = new FontUIResource("Dialog", Font.PLAIN, 14);
+    @Override
+    public FontUIResource getControlTextFont() {
+        return controlFont;
+    }
+
+    @Override
+    public FontUIResource getSystemTextFont() {
+        return systemFont;
+    }
+
+    @Override
+    public FontUIResource getUserTextFont() {
+        return userFont;
+    }
 
-    public FontUIResource getControlTextFont() { return controlFont;}
-    public FontUIResource getSystemTextFont() { return systemFont;}
-    public FontUIResource getUserTextFont() { return userFont;}
-    public FontUIResource getMenuTextFont() { return controlFont;}
-    public FontUIResource getWindowTitleFont() { return controlFont;}
-    public FontUIResource getSubTextFont() { return smallFont;}
+    @Override
+    public FontUIResource getMenuTextFont() {
+        return controlFont;
+    }
 
+    @Override
+    public FontUIResource getWindowTitleFont() {
+        return controlFont;
+    }
+
+    @Override
+    public FontUIResource getSubTextFont() {
+        return smallFont;
+    }
+
+    @Override
     public void addCustomEntriesToTable(UIDefaults table) {
-         super.addCustomEntriesToTable(table);
+        super.addCustomEntriesToTable(table);
 
-         final int internalFrameIconSize = 22;
-         table.put("InternalFrame.closeIcon", MetalIconFactory.getInternalFrameCloseIcon(internalFrameIconSize));
-         table.put("InternalFrame.maximizeIcon", MetalIconFactory.getInternalFrameMaximizeIcon(internalFrameIconSize));
-         table.put("InternalFrame.iconifyIcon", MetalIconFactory.getInternalFrameMinimizeIcon(internalFrameIconSize));
-         table.put("InternalFrame.minimizeIcon", MetalIconFactory.getInternalFrameAltMaximizeIcon(internalFrameIconSize));
+        final int internalFrameIconSize = 22;
+        table.put("InternalFrame.closeIcon", MetalIconFactory.
+                getInternalFrameCloseIcon(internalFrameIconSize));
+        table.put("InternalFrame.maximizeIcon", MetalIconFactory.
+                getInternalFrameMaximizeIcon(internalFrameIconSize));
+        table.put("InternalFrame.iconifyIcon", MetalIconFactory.
+                getInternalFrameMinimizeIcon(internalFrameIconSize));
+        table.put("InternalFrame.minimizeIcon", MetalIconFactory.
+                getInternalFrameAltMaximizeIcon(internalFrameIconSize));
 
 
-         table.put( "ScrollBar.width", new Integer(21) );
+        table.put("ScrollBar.width", 21);
 
 
 
     }
-
 }
--- a/jdk/src/share/demo/jfc/Metalworks/GreenMetalTheme.java	Thu Mar 24 18:13:12 2011 +0100
+++ b/jdk/src/share/demo/jfc/Metalworks/GreenMetalTheme.java	Thu Mar 24 18:15:51 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,32 +29,40 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
-
 
-import javax.swing.plaf.*;
-import javax.swing.plaf.metal.*;
-import javax.swing.*;
-import javax.swing.border.*;
-import java.awt.*;
+import javax.swing.plaf.ColorUIResource;
+import javax.swing.plaf.metal.DefaultMetalTheme;
+
 
 /**
  * This class describes a theme using "green" colors.
  *
  * @author Steve Wilson
+ * @author Alexander Kouznetsov
  */
 public class GreenMetalTheme extends DefaultMetalTheme {
 
-    public String getName() { return "Emerald"; }
-
-  // greenish colors
+    @Override
+    public String getName() {
+        return "Emerald";
+    }
+    // greenish colors
     private final ColorUIResource primary1 = new ColorUIResource(51, 102, 51);
     private final ColorUIResource primary2 = new ColorUIResource(102, 153, 102);
     private final ColorUIResource primary3 = new ColorUIResource(153, 204, 153);
 
-    protected ColorUIResource getPrimary1() { return primary1; }
-    protected ColorUIResource getPrimary2() { return primary2; }
-    protected ColorUIResource getPrimary3() { return primary3; }
+    @Override
+    protected ColorUIResource getPrimary1() {
+        return primary1;
+    }
 
+    @Override
+    protected ColorUIResource getPrimary2() {
+        return primary2;
+    }
+
+    @Override
+    protected ColorUIResource getPrimary3() {
+        return primary3;
+    }
 }
--- a/jdk/src/share/demo/jfc/Metalworks/KhakiMetalTheme.java	Thu Mar 24 18:13:12 2011 +0100
+++ b/jdk/src/share/demo/jfc/Metalworks/KhakiMetalTheme.java	Thu Mar 24 18:15:51 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,39 +29,60 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
-
 
-import javax.swing.plaf.*;
-import javax.swing.plaf.metal.*;
-import javax.swing.*;
-import javax.swing.border.*;
-import java.awt.*;
+import javax.swing.plaf.ColorUIResource;
+import javax.swing.plaf.metal.DefaultMetalTheme;
+
 
 /**
  * This class describes a theme using "khaki" colors.
  *
  * @author Steve Wilson
+ * @author Alexander Kouznetsov
  */
 public class KhakiMetalTheme extends DefaultMetalTheme {
 
-    public String getName() { return "Sandstone"; }
-
-    private final ColorUIResource primary1 = new ColorUIResource( 87,  87,  47);
+    @Override
+    public String getName() {
+        return "Sandstone";
+    }
+    private final ColorUIResource primary1 = new ColorUIResource(87, 87, 47);
     private final ColorUIResource primary2 = new ColorUIResource(159, 151, 111);
     private final ColorUIResource primary3 = new ColorUIResource(199, 183, 143);
+    private final ColorUIResource secondary1 =
+            new ColorUIResource(111, 111, 111);
+    private final ColorUIResource secondary2 =
+            new ColorUIResource(159, 159, 159);
+    private final ColorUIResource secondary3 =
+            new ColorUIResource(231, 215, 183);
 
-    private final ColorUIResource secondary1 = new ColorUIResource( 111,  111,  111);
-    private final ColorUIResource secondary2 = new ColorUIResource(159, 159, 159);
-    private final ColorUIResource secondary3 = new ColorUIResource(231, 215, 183);
+    @Override
+    protected ColorUIResource getPrimary1() {
+        return primary1;
+    }
+
+    @Override
+    protected ColorUIResource getPrimary2() {
+        return primary2;
+    }
 
-    protected ColorUIResource getPrimary1() { return primary1; }
-    protected ColorUIResource getPrimary2() { return primary2; }
-    protected ColorUIResource getPrimary3() { return primary3; }
+    @Override
+    protected ColorUIResource getPrimary3() {
+        return primary3;
+    }
+
+    @Override
+    protected ColorUIResource getSecondary1() {
+        return secondary1;
+    }
 
-    protected ColorUIResource getSecondary1() { return secondary1; }
-    protected ColorUIResource getSecondary2() { return secondary2; }
-    protected ColorUIResource getSecondary3() { return secondary3; }
+    @Override
+    protected ColorUIResource getSecondary2() {
+        return secondary2;
+    }
 
+    @Override
+    protected ColorUIResource getSecondary3() {
+        return secondary3;
+    }
 }
--- a/jdk/src/share/demo/jfc/Metalworks/MetalThemeMenu.java	Thu Mar 24 18:13:12 2011 +0100
+++ b/jdk/src/share/demo/jfc/Metalworks/MetalThemeMenu.java	Thu Mar 24 18:15:51 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,51 +29,57 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
-
 
-import javax.swing.plaf.metal.*;
-import javax.swing.*;
-import javax.swing.border.*;
-import java.awt.*;
-import java.awt.event.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import javax.swing.ButtonGroup;
+import javax.swing.JMenu;
+import javax.swing.JRadioButtonMenuItem;
+import javax.swing.UIManager;
+import javax.swing.plaf.metal.MetalLookAndFeel;
+import javax.swing.plaf.metal.MetalTheme;
+
 
 /**
  * This class describes a theme using "green" colors.
  *
  * @author Steve Wilson
+ * @author Alexander Kouznetsov
  */
-public class MetalThemeMenu extends JMenu implements ActionListener{
+@SuppressWarnings("serial")
+public class MetalThemeMenu extends JMenu implements ActionListener {
+
+    MetalTheme[] themes;
 
-  MetalTheme[] themes;
-  public MetalThemeMenu(String name, MetalTheme[] themeArray) {
-    super(name);
-    themes = themeArray;
-    ButtonGroup group = new ButtonGroup();
-    for (int i = 0; i < themes.length; i++) {
-        JRadioButtonMenuItem item = new JRadioButtonMenuItem( themes[i].getName() );
-        group.add(item);
-        add( item );
-        item.setActionCommand(i+"");
-        item.addActionListener(this);
-        if ( i == 0)
-            item.setSelected(true);
+    @SuppressWarnings("LeakingThisInConstructor")
+    public MetalThemeMenu(String name, MetalTheme[] themeArray) {
+        super(name);
+        themes = themeArray;
+        ButtonGroup group = new ButtonGroup();
+        for (int i = 0; i < themes.length; i++) {
+            JRadioButtonMenuItem item = new JRadioButtonMenuItem(themes[i].
+                    getName());
+            group.add(item);
+            add(item);
+            item.setActionCommand(i + "");
+            item.addActionListener(this);
+            if (i == 0) {
+                item.setSelected(true);
+            }
+        }
+
     }
 
-  }
+    public void actionPerformed(ActionEvent e) {
+        String numStr = e.getActionCommand();
+        MetalTheme selectedTheme = themes[Integer.parseInt(numStr)];
+        MetalLookAndFeel.setCurrentTheme(selectedTheme);
+        try {
+            UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
+        } catch (Exception ex) {
+            System.out.println("Failed loading Metal");
+            System.out.println(ex);
+        }
 
-  public void actionPerformed(ActionEvent e) {
-    String numStr = e.getActionCommand();
-    MetalTheme selectedTheme = themes[ Integer.parseInt(numStr) ];
-    MetalLookAndFeel.setCurrentTheme(selectedTheme);
-    try {
-        UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
-    } catch (Exception ex) {
-        System.out.println("Failed loading Metal");
-        System.out.println(ex);
     }
-
-  }
-
 }
--- a/jdk/src/share/demo/jfc/Metalworks/Metalworks.java	Thu Mar 24 18:13:12 2011 +0100
+++ b/jdk/src/share/demo/jfc/Metalworks/Metalworks.java	Thu Mar 24 18:15:51 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,34 +29,35 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
-
-import java.awt.*;
-import javax.swing.*;
-import javax.swing.border.*;
+import java.awt.Toolkit;
+import javax.swing.JDialog;
+import javax.swing.JFrame;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
 import javax.swing.plaf.metal.MetalLookAndFeel;
 
+
 /**
-  * This application is a demo of the Metal Look & Feel
-  *
-  * @author Steve Wilson
-  */
+ * This application is a demo of the Metal Look & Feel
+ *
+ * @author Steve Wilson
+ * @author Alexander Kouznetsov
+ */
 public class Metalworks {
 
-    public static void main( String[] args ) {
+    public static void main(String[] args) {
         UIManager.put("swing.boldMetal", Boolean.FALSE);
         JDialog.setDefaultLookAndFeelDecorated(true);
         JFrame.setDefaultLookAndFeelDecorated(true);
         Toolkit.getDefaultToolkit().setDynamicLayout(true);
-        System.setProperty("sun.awt.noerasebackground","true");
-
+        System.setProperty("sun.awt.noerasebackground", "true");
         try {
             UIManager.setLookAndFeel(new MetalLookAndFeel());
-        }
-        catch ( UnsupportedLookAndFeelException e ) {
-            System.out.println ("Metal Look & Feel not supported on this platform. \nProgram Terminated");
+        } catch (UnsupportedLookAndFeelException e) {
+            System.out.println(
+                    "Metal Look & Feel not supported on this platform. \n"
+                    + "Program Terminated");
             System.exit(0);
         }
         JFrame frame = new MetalworksFrame();
--- a/jdk/src/share/demo/jfc/Metalworks/MetalworksDocumentFrame.java	Thu Mar 24 18:13:12 2011 +0100
+++ b/jdk/src/share/demo/jfc/Metalworks/MetalworksDocumentFrame.java	Thu Mar 24 18:15:51 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,21 +29,32 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
-import java.awt.*;
-import java.awt.event.*;
-import java.util.*;
-import javax.swing.*;
-import javax.swing.border.*;
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.Insets;
+import java.awt.LayoutManager;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import javax.swing.JComponent;
+import javax.swing.JInternalFrame;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
+import javax.swing.JTextField;
+import javax.swing.border.EmptyBorder;
 
 
 /**
-  * This is a subclass of JInternalFrame which displays documents.
-  *
-  * @author Steve Wilson
-  */
+ * This is a subclass of JInternalFrame which displays documents.
+ *
+ * @author Steve Wilson
+ */
+@SuppressWarnings("serial")
 public class MetalworksDocumentFrame extends JInternalFrame {
 
     static int openFrameCount = 0;
@@ -59,27 +70,27 @@
         top.setLayout(new BorderLayout());
         top.add(buildAddressPanel(), BorderLayout.NORTH);
 
-        JTextArea content = new JTextArea( 15, 30 );
-        content.setBorder( new EmptyBorder(0,5 ,0, 5) );
+        JTextArea content = new JTextArea(15, 30);
+        content.setBorder(new EmptyBorder(0, 5, 0, 5));
         content.setLineWrap(true);
 
 
 
         JScrollPane textScroller = new JScrollPane(content,
-                                                   JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
-                                                   JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED );
-        top.add( textScroller, BorderLayout.CENTER);
+                JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
+                JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
+        top.add(textScroller, BorderLayout.CENTER);
 
 
         setContentPane(top);
         pack();
-        setLocation( offset * openFrameCount, offset *openFrameCount);
+        setLocation(offset * openFrameCount, offset * openFrameCount);
 
     }
 
     private JPanel buildAddressPanel() {
         JPanel p = new JPanel();
-        p.setLayout( new LabeledPairLayout() );
+        p.setLayout(new LabeledPairLayout());
 
 
         JLabel toLabel = new JLabel("To: ", JLabel.RIGHT);
@@ -103,83 +114,79 @@
 
     }
 
+
     class LabeledPairLayout implements LayoutManager {
 
-      Vector labels = new Vector();
-      Vector fields = new Vector();
-
-      int yGap = 2;
-      int xGap = 2;
+        List<Component> labels = new ArrayList<Component>();
+        List<Component> fields = new ArrayList<Component>();
+        int yGap = 2;
+        int xGap = 2;
 
-      public void addLayoutComponent(String s, Component c) {
-          if (s.equals("label")) {
-              labels.addElement(c);
-          }  else {
-              fields.addElement(c);
-          }
-      }
+        public void addLayoutComponent(String s, Component c) {
+            if (s.equals("label")) {
+                labels.add(c);
+            } else {
+                fields.add(c);
+            }
+        }
 
-      public void layoutContainer(Container c) {
-          Insets insets = c.getInsets();
+        public void layoutContainer(Container c) {
+            Insets insets = c.getInsets();
 
-          int labelWidth = 0;
-          Enumeration labelIter = labels.elements();
-          while(labelIter.hasMoreElements()) {
-              JComponent comp = (JComponent)labelIter.nextElement();
-              labelWidth = Math.max( labelWidth, comp.getPreferredSize().width );
-          }
+            int labelWidth = 0;
+            for (Component comp : labels) {
+                labelWidth = Math.max(labelWidth, comp.getPreferredSize().width);
+            }
 
-          int yPos = insets.top;
+            int yPos = insets.top;
 
-          Enumeration fieldIter = fields.elements();
-          labelIter = labels.elements();
-          while(labelIter.hasMoreElements() && fieldIter.hasMoreElements()) {
-              JComponent label = (JComponent)labelIter.nextElement();
-              JComponent field = (JComponent)fieldIter.nextElement();
-              int height = Math.max(label.getPreferredSize().height, field.getPreferredSize().height);
-              label.setBounds( insets.left, yPos, labelWidth, height );
-              field.setBounds( insets.left + labelWidth + xGap,
-                                 yPos,
-                                 c.getSize().width - (labelWidth +xGap + insets.left + insets.right),
-                                 height );
-              yPos += (height + yGap);
-          }
+            Iterator<Component> fieldIter = fields.listIterator();
+            Iterator<Component> labelIter = labels.listIterator();
+            while (labelIter.hasNext() && fieldIter.hasNext()) {
+                JComponent label = (JComponent) labelIter.next();
+                JComponent field = (JComponent) fieldIter.next();
+                int height = Math.max(label.getPreferredSize().height, field.
+                        getPreferredSize().height);
+                label.setBounds(insets.left, yPos, labelWidth, height);
+                field.setBounds(insets.left + labelWidth + xGap,
+                        yPos,
+                        c.getSize().width - (labelWidth + xGap + insets.left
+                        + insets.right),
+                        height);
+                yPos += (height + yGap);
+            }
 
-      }
-
+        }
 
-      public Dimension minimumLayoutSize(Container c) {
-          Insets insets = c.getInsets();
+        public Dimension minimumLayoutSize(Container c) {
+            Insets insets = c.getInsets();
 
-          int labelWidth = 0;
-          Enumeration labelIter = labels.elements();
-          while(labelIter.hasMoreElements()) {
-              JComponent comp = (JComponent)labelIter.nextElement();
-              labelWidth = Math.max( labelWidth, comp.getPreferredSize().width );
-          }
+            int labelWidth = 0;
+            for (Component comp : labels) {
+                labelWidth = Math.max(labelWidth, comp.getPreferredSize().width);
+            }
 
-          int yPos = insets.top;
+            int yPos = insets.top;
 
-          labelIter = labels.elements();
-          Enumeration fieldIter = fields.elements();
-          while(labelIter.hasMoreElements() && fieldIter.hasMoreElements()) {
-              JComponent label = (JComponent)labelIter.nextElement();
-              JComponent field = (JComponent)fieldIter.nextElement();
-              int height = Math.max(label.getPreferredSize().height, field.getPreferredSize().height);
-              yPos += (height + yGap);
-          }
-          return new Dimension( labelWidth * 3 , yPos );
-      }
+            Iterator<Component> labelIter = labels.listIterator();
+            Iterator<Component> fieldIter = fields.listIterator();
+            while (labelIter.hasNext() && fieldIter.hasNext()) {
+                Component label = labelIter.next();
+                Component field = fieldIter.next();
+                int height = Math.max(label.getPreferredSize().height, field.
+                        getPreferredSize().height);
+                yPos += (height + yGap);
+            }
+            return new Dimension(labelWidth * 3, yPos);
+        }
 
-      public Dimension preferredLayoutSize(Container c) {
-          Dimension d = minimumLayoutSize(c);
-          d.width *= 2;
-          return d;
-      }
+        public Dimension preferredLayoutSize(Container c) {
+            Dimension d = minimumLayoutSize(c);
+            d.width *= 2;
+            return d;
+        }
 
-      public void removeLayoutComponent(Component c) {}
-
+        public void removeLayoutComponent(Component c) {
+        }
+    }
 }
-
-
-}
--- a/jdk/src/share/demo/jfc/Metalworks/MetalworksFrame.java	Thu Mar 24 18:13:12 2011 +0100
+++ b/jdk/src/share/demo/jfc/Metalworks/MetalworksFrame.java	Thu Mar 24 18:15:51 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,50 +29,70 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
-import java.awt.*;
-import java.io.*;
-import java.awt.event.*;
-import java.beans.*;
-import javax.swing.*;
-import javax.swing.border.*;
-
-import javax.swing.plaf.metal.*;
+import java.awt.Dimension;
+import java.awt.Toolkit;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.io.InputStream;
+import javax.swing.ButtonGroup;
+import javax.swing.JCheckBoxMenuItem;
+import javax.swing.JComponent;
+import javax.swing.JDesktopPane;
+import javax.swing.JFileChooser;
+import javax.swing.JFrame;
+import javax.swing.JInternalFrame;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JRadioButtonMenuItem;
+import javax.swing.UIManager;
+import javax.swing.plaf.metal.DefaultMetalTheme;
+import javax.swing.plaf.metal.MetalTheme;
+import javax.swing.plaf.metal.OceanTheme;
 
 
 /**
-  * This is the main container frame for the Metalworks demo app
-  *
-  * @author Steve Wilson
-  */
-public class MetalworksFrame extends JFrame {
+ * This is the main container frame for the Metalworks demo app
+ *
+ * @author Steve Wilson
+ * @author Alexander Kouznetsov
+ */
+@SuppressWarnings("serial")
+public final class MetalworksFrame extends JFrame {
 
     JMenuBar menuBar;
     JDesktopPane desktop;
     JInternalFrame toolPalette;
     JCheckBoxMenuItem showToolPaletteMenuItem;
-
-    static final Integer DOCLAYER = new Integer(5);
-    static final Integer TOOLLAYER = new Integer(6);
-    static final Integer HELPLAYER = new Integer(7);
-
-    static final String ABOUTMSG = "Metalworks \n \nAn application written to show off the Java Look & Feel. \n \nWritten by the JavaSoft Look & Feel Team \n  Michael Albers\n  Tom Santos\n  Jeff Shapiro\n  Steve Wilson";
-
+    static final Integer DOCLAYER = 5;
+    static final Integer TOOLLAYER = 6;
+    static final Integer HELPLAYER = 7;
+    static final String ABOUTMSG = "Metalworks \n \nAn application written to "
+            + "show off the Java Look & Feel. \n \nWritten by the JavaSoft "
+            + "Look & Feel Team \n  Michael Albers\n  Tom Santos\n  "
+            + "Jeff Shapiro\n  Steve Wilson";
 
     public MetalworksFrame() {
         super("Metalworks");
         final int inset = 50;
         Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
-        setBounds ( inset, inset, screenSize.width - inset*2, screenSize.height - inset*2 );
+        setBounds(inset, inset, screenSize.width - inset * 2, screenSize.height - inset
+                * 2);
         buildContent();
         buildMenus();
         this.addWindowListener(new WindowAdapter() {
-                               public void windowClosing(WindowEvent e) {
-                                   quit();
-                               }});
-        UIManager.addPropertyChangeListener(new UISwitchListener((JComponent)getRootPane()));
+
+            @Override
+            public void windowClosing(WindowEvent e) {
+                quit();
+            }
+        });
+        UIManager.addPropertyChangeListener(new UISwitchListener(
+                (JComponent) getRootPane()));
     }
 
     protected void buildMenus() {
@@ -87,20 +107,23 @@
         // load a theme from a text file
         MetalTheme myTheme = null;
         try {
-            InputStream istream = getClass().getResourceAsStream("/resources/MyTheme.theme");
-            myTheme =  new PropertiesMetalTheme(istream);
-        } catch (NullPointerException e) {System.out.println(e);}
+            InputStream istream = getClass().getResourceAsStream(
+                    "/resources/MyTheme.theme");
+            myTheme = new PropertiesMetalTheme(istream);
+        } catch (NullPointerException e) {
+            System.out.println(e);
+        }
 
         // build an array of themes
         MetalTheme[] themes = { new OceanTheme(),
-                                new DefaultMetalTheme(),
-                                new GreenMetalTheme(),
-                                new AquaMetalTheme(),
-                                new KhakiMetalTheme(),
-                                new DemoMetalTheme(),
-                                new ContrastMetalTheme(),
-                                new BigContrastMetalTheme(),
-                                myTheme };
+            new DefaultMetalTheme(),
+            new GreenMetalTheme(),
+            new AquaMetalTheme(),
+            new KhakiMetalTheme(),
+            new DemoMetalTheme(),
+            new ContrastMetalTheme(),
+            new BigContrastMetalTheme(),
+            myTheme };
 
         // put the themes in a menu
         JMenu themeMenu = new MetalThemeMenu("Theme", themes);
@@ -121,19 +144,25 @@
         JMenuItem quit = new JMenuItem("Quit");
 
         newWin.addActionListener(new ActionListener() {
-                               public void actionPerformed(ActionEvent e) {
-                                   newDocument();
-                               }});
+
+            public void actionPerformed(ActionEvent e) {
+                newDocument();
+            }
+        });
 
         open.addActionListener(new ActionListener() {
-                               public void actionPerformed(ActionEvent e) {
-                                   openDocument();
-                               }});
+
+            public void actionPerformed(ActionEvent e) {
+                openDocument();
+            }
+        });
 
         quit.addActionListener(new ActionListener() {
-                               public void actionPerformed(ActionEvent e) {
-                                   quit();
-                               }});
+
+            public void actionPerformed(ActionEvent e) {
+                quit();
+            }
+        });
 
         file.add(newWin);
         file.add(open);
@@ -156,9 +185,11 @@
         paste.setEnabled(false);
 
         prefs.addActionListener(new ActionListener() {
-                               public void actionPerformed(ActionEvent e) {
-                                   openPrefsWindow();
-                               }});
+
+            public void actionPerformed(ActionEvent e) {
+                openPrefsWindow();
+            }
+        });
 
         edit.add(undo);
         edit.addSeparator();
@@ -178,16 +209,18 @@
         outBox.setEnabled(false);
 
         inBox.addActionListener(new ActionListener() {
-                               public void actionPerformed(ActionEvent e) {
-                                   openInBox();
-                               }});
+
+            public void actionPerformed(ActionEvent e) {
+                openInBox();
+            }
+        });
 
         views.add(inBox);
         views.add(outBox);
         return views;
     }
 
-     protected JMenu buildSpeedMenu() {
+    protected JMenu buildSpeedMenu() {
         JMenu speed = new JMenu("Drag");
 
         JRadioButtonMenuItem live = new JRadioButtonMenuItem("Live");
@@ -203,28 +236,37 @@
 
         live.setSelected(true);
 
-        slow.addActionListener(new ActionListener(){
-                               public void actionPerformed(ActionEvent e){
-                                // for right now I'm saying if you set the mode
-                                 // to something other than a specified mode
-                                 // it will revert to the old way
-                                 // This is mostly for comparison's sake
-                               desktop.setDragMode(-1);}});
+        slow.addActionListener(new ActionListener() {
+
+            public void actionPerformed(ActionEvent e) {
+                // for right now I'm saying if you set the mode
+                // to something other than a specified mode
+                // it will revert to the old way
+                // This is mostly for comparison's sake
+                desktop.setDragMode(-1);
+            }
+        });
 
-        live.addActionListener(new ActionListener(){
-                         public void actionPerformed(ActionEvent e){
-                         desktop.setDragMode(JDesktopPane.LIVE_DRAG_MODE);}});
+        live.addActionListener(new ActionListener() {
+
+            public void actionPerformed(ActionEvent e) {
+                desktop.setDragMode(JDesktopPane.LIVE_DRAG_MODE);
+            }
+        });
 
-        outline.addActionListener(new ActionListener(){
-                         public void actionPerformed(ActionEvent e){
-                         desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);}});
+        outline.addActionListener(new ActionListener() {
+
+            public void actionPerformed(ActionEvent e) {
+                desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
+            }
+        });
 
 
         speed.add(live);
         speed.add(outline);
         speed.add(slow);
         return speed;
-     }
+    }
 
     protected JMenu buildHelpMenu() {
         JMenu help = new JMenu("Help");
@@ -232,15 +274,18 @@
         JMenuItem openHelp = new JMenuItem("Open Help Window");
 
         about.addActionListener(new ActionListener() {
+
             public void actionPerformed(ActionEvent e) {
                 showAboutBox();
             }
         });
 
         openHelp.addActionListener(new ActionListener() {
-                               public void actionPerformed(ActionEvent e) {
-                                   openHelpWindow();
-                               }});
+
+            public void actionPerformed(ActionEvent e) {
+                openHelpWindow();
+            }
+        });
 
         help.add(about);
         help.add(openHelp);
@@ -263,7 +308,8 @@
         try {
             doc.setVisible(true);
             doc.setSelected(true);
-        } catch (java.beans.PropertyVetoException e2) {}
+        } catch (java.beans.PropertyVetoException e2) {
+        }
     }
 
     public void openDocument() {
@@ -277,7 +323,8 @@
         try {
             help.setVisible(true);
             help.setSelected(true);
-        } catch (java.beans.PropertyVetoException e2) {}
+        } catch (java.beans.PropertyVetoException e2) {
+        }
     }
 
     public void showAboutBox() {
@@ -286,7 +333,7 @@
 
     public void openPrefsWindow() {
         MetalworksPrefs dialog = new MetalworksPrefs(this);
-        dialog.show();
+        dialog.setVisible(true);
 
     }
 
@@ -296,6 +343,7 @@
         try {
             doc.setVisible(true);
             doc.setSelected(true);
-        } catch (java.beans.PropertyVetoException e2) {}
+        } catch (java.beans.PropertyVetoException e2) {
+        }
     }
 }
--- a/jdk/src/share/demo/jfc/Metalworks/MetalworksHelp.java	Thu Mar 24 18:13:12 2011 +0100
+++ b/jdk/src/share/demo/jfc/Metalworks/MetalworksHelp.java	Thu Mar 24 18:15:51 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,8 +29,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
 import javax.swing.*;
 import java.awt.*;
@@ -40,26 +38,31 @@
 import javax.swing.text.*;
 import javax.swing.event.*;
 
-/*
+
+/**
  * @author Steve Wilson
+ * @author Alexander Kouznetsov
  */
+@SuppressWarnings("serial")
 public class MetalworksHelp extends JInternalFrame {
 
     public MetalworksHelp() {
         super("Help", true, true, true, true);
 
-        setFrameIcon( (Icon)UIManager.get("Tree.openIcon")); // PENDING(steve) need more general palce to get this icon
-        setBounds( 200, 25, 400, 400);
+        setFrameIcon((Icon) UIManager.get("Tree.openIcon")); // PENDING(steve) need more general place to get this icon
+        setBounds(200, 25, 400, 400);
         HtmlPane html = new HtmlPane();
         setContentPane(html);
     }
-
 }
 
 
+@SuppressWarnings("serial")
 class HtmlPane extends JScrollPane implements HyperlinkListener {
+
     JEditorPane html;
 
+    @SuppressWarnings("LeakingThisInConstructor")
     public HtmlPane() {
         try {
             URL url = getClass().getResource("/resources/HelpFiles/toc.html");
@@ -67,7 +70,7 @@
             html.setEditable(false);
             html.addHyperlinkListener(this);
             html.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES,
-                                   Boolean.TRUE);
+                    Boolean.TRUE);
             JViewport vp = getViewport();
             vp.add(html);
         } catch (MalformedURLException e) {
@@ -106,6 +109,7 @@
         SwingUtilities.invokeLater(new PageLoader(u, c));
     }
 
+
     /**
      * temporary class that loads synchronously (although
      * later than the request so that a cursor change
@@ -142,9 +146,7 @@
                 }
             }
         }
-
         URL url;
         Cursor cursor;
     }
-
 }
--- a/jdk/src/share/demo/jfc/Metalworks/MetalworksInBox.java	Thu Mar 24 18:13:12 2011 +0100
+++ b/jdk/src/share/demo/jfc/Metalworks/MetalworksInBox.java	Thu Mar 24 18:15:51 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,22 +29,20 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
-import java.awt.*;
-import java.awt.event.*;
-import java.util.*;
-import javax.swing.*;
-import javax.swing.border.*;
-import javax.swing.tree.*;
+import javax.swing.JInternalFrame;
+import javax.swing.JScrollPane;
+import javax.swing.JTree;
+import javax.swing.tree.DefaultMutableTreeNode;
 
 
 /**
-  * This is a subclass of JInternalFrame which displays a tree.
-  *
-  * @author Steve Wilson
-  */
+ * This is a subclass of JInternalFrame which displays a tree.
+ *
+ * @author Steve Wilson
+ * @author Alexander Kouznetsov
+ */
+@SuppressWarnings("serial")
 public class MetalworksInBox extends JInternalFrame {
 
     public MetalworksInBox() {
@@ -57,49 +55,47 @@
 
         DefaultMutableTreeNode top = new DefaultMutableTreeNode("Mail Boxes");
 
-        top.add( unread = new DefaultMutableTreeNode("Unread Mail") );
-        top.add( personal = new DefaultMutableTreeNode("Personal") );
-        top.add( business = new DefaultMutableTreeNode("Business") );
-        top.add( spam = new DefaultMutableTreeNode("Spam") );
+        top.add(unread = new DefaultMutableTreeNode("Unread Mail"));
+        top.add(personal = new DefaultMutableTreeNode("Personal"));
+        top.add(business = new DefaultMutableTreeNode("Business"));
+        top.add(spam = new DefaultMutableTreeNode("Spam"));
 
-        unread.add( new DefaultMutableTreeNode("Buy Stuff Now") );
-        unread.add( new DefaultMutableTreeNode("Read Me Now") );
-        unread.add( new DefaultMutableTreeNode("Hot Offer") );
-        unread.add( new DefaultMutableTreeNode("Re: Re: Thank You") );
-        unread.add( new DefaultMutableTreeNode("Fwd: Good Joke") );
+        unread.add(new DefaultMutableTreeNode("Buy Stuff Now"));
+        unread.add(new DefaultMutableTreeNode("Read Me Now"));
+        unread.add(new DefaultMutableTreeNode("Hot Offer"));
+        unread.add(new DefaultMutableTreeNode("Re: Re: Thank You"));
+        unread.add(new DefaultMutableTreeNode("Fwd: Good Joke"));
 
-        personal.add( new DefaultMutableTreeNode("Hi") );
-        personal.add( new DefaultMutableTreeNode("Good to hear from you") );
-        personal.add( new DefaultMutableTreeNode("Re: Thank You") );
+        personal.add(new DefaultMutableTreeNode("Hi"));
+        personal.add(new DefaultMutableTreeNode("Good to hear from you"));
+        personal.add(new DefaultMutableTreeNode("Re: Thank You"));
 
-        business.add( new DefaultMutableTreeNode("Thanks for your order") );
-        business.add( new DefaultMutableTreeNode("Price Quote") );
-        business.add( new DefaultMutableTreeNode("Here is the invoice") );
-        business.add( new DefaultMutableTreeNode("Project Metal: delivered on time") );
-        business.add( new DefaultMutableTreeNode("Your salary raise approved") );
+        business.add(new DefaultMutableTreeNode("Thanks for your order"));
+        business.add(new DefaultMutableTreeNode("Price Quote"));
+        business.add(new DefaultMutableTreeNode("Here is the invoice"));
+        business.add(new DefaultMutableTreeNode(
+                "Project Metal: delivered on time"));
+        business.add(new DefaultMutableTreeNode("Your salary raise approved"));
 
-        spam.add( new DefaultMutableTreeNode("Buy Now") );
-        spam.add( new DefaultMutableTreeNode("Make $$$ Now") );
-        spam.add( new DefaultMutableTreeNode("HOT HOT HOT") );
-        spam.add( new DefaultMutableTreeNode("Buy Now") );
-        spam.add( new DefaultMutableTreeNode("Don't Miss This") );
-        spam.add( new DefaultMutableTreeNode("Opportunity in Precious Metals") );
-        spam.add( new DefaultMutableTreeNode("Buy Now") );
-        spam.add( new DefaultMutableTreeNode("Last Chance") );
-        spam.add( new DefaultMutableTreeNode("Buy Now") );
-        spam.add( new DefaultMutableTreeNode("Make $$$ Now") );
-        spam.add( new DefaultMutableTreeNode("To Hot To Handle") );
-        spam.add( new DefaultMutableTreeNode("I'm waiting for your call") );
+        spam.add(new DefaultMutableTreeNode("Buy Now"));
+        spam.add(new DefaultMutableTreeNode("Make $$$ Now"));
+        spam.add(new DefaultMutableTreeNode("HOT HOT HOT"));
+        spam.add(new DefaultMutableTreeNode("Buy Now"));
+        spam.add(new DefaultMutableTreeNode("Don't Miss This"));
+        spam.add(new DefaultMutableTreeNode("Opportunity in Precious Metals"));
+        spam.add(new DefaultMutableTreeNode("Buy Now"));
+        spam.add(new DefaultMutableTreeNode("Last Chance"));
+        spam.add(new DefaultMutableTreeNode("Buy Now"));
+        spam.add(new DefaultMutableTreeNode("Make $$$ Now"));
+        spam.add(new DefaultMutableTreeNode("To Hot To Handle"));
+        spam.add(new DefaultMutableTreeNode("I'm waiting for your call"));
 
         JTree tree = new JTree(top);
         JScrollPane treeScroller = new JScrollPane(tree);
         treeScroller.setBackground(tree.getBackground());
         setContentPane(treeScroller);
-        setSize( 325, 200);
-        setLocation( 75, 75);
+        setSize(325, 200);
+        setLocation(75, 75);
 
     }
-
-
-
 }
--- a/jdk/src/share/demo/jfc/Metalworks/MetalworksPrefs.java	Thu Mar 24 18:13:12 2011 +0100
+++ b/jdk/src/share/demo/jfc/Metalworks/MetalworksPrefs.java	Thu Mar 24 18:15:51 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,50 +29,70 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
-import java.awt.*;
-import java.awt.event.*;
-import java.beans.*;
-import javax.swing.*;
-import javax.swing.border.*;
-import javax.swing.plaf.metal.*;
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.GridLayout;
+import java.awt.Insets;
+import java.awt.LayoutManager;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import javax.swing.ButtonGroup;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
+import javax.swing.JDialog;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JTabbedPane;
+import javax.swing.UIManager;
+import javax.swing.border.TitledBorder;
 
 
 /**
-  * This is dialog which allows users to choose preferences
-  *
-  * @author Steve Wilson
-  */
-public class MetalworksPrefs extends JDialog {
+ * This is dialog which allows users to choose preferences
+ *
+ * @author Steve Wilson
+ * @author Alexander Kouznetsov
+ */
+@SuppressWarnings("serial")
+public final class MetalworksPrefs extends JDialog {
 
     public MetalworksPrefs(JFrame f) {
         super(f, "Preferences", true);
         JPanel container = new JPanel();
-        container.setLayout( new BorderLayout() );
+        container.setLayout(new BorderLayout());
 
         JTabbedPane tabs = new JTabbedPane();
         JPanel filters = buildFilterPanel();
         JPanel conn = buildConnectingPanel();
-        tabs.addTab( "Filters", null, filters );
-        tabs.addTab( "Connecting", null, conn );
+        tabs.addTab("Filters", null, filters);
+        tabs.addTab("Connecting", null, conn);
 
 
         JPanel buttonPanel = new JPanel();
-        buttonPanel.setLayout ( new FlowLayout(FlowLayout.RIGHT) );
+        buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
         JButton cancel = new JButton("Cancel");
         cancel.addActionListener(new ActionListener() {
-                               public void actionPerformed(ActionEvent e) {
-                                   CancelPressed();
-                               }});
-        buttonPanel.add( cancel );
+
+            public void actionPerformed(ActionEvent e) {
+                CancelPressed();
+            }
+        });
+        buttonPanel.add(cancel);
         JButton ok = new JButton("OK");
         ok.addActionListener(new ActionListener() {
-                               public void actionPerformed(ActionEvent e) {
-                                   OKPressed();
-                               }});
-        buttonPanel.add( ok );
+
+            public void actionPerformed(ActionEvent e) {
+                OKPressed();
+            }
+        });
+        buttonPanel.add(ok);
         getRootPane().setDefaultButton(ok);
 
         container.add(tabs, BorderLayout.CENTER);
@@ -85,12 +105,12 @@
 
     public JPanel buildFilterPanel() {
         JPanel filters = new JPanel();
-        filters.setLayout( new GridLayout(1, 0) );
+        filters.setLayout(new GridLayout(1, 0));
 
         JPanel spamPanel = new JPanel();
 
         spamPanel.setLayout(new ColumnLayout());
-        spamPanel.setBorder( new TitledBorder("Spam") );
+        spamPanel.setBorder(new TitledBorder("Spam"));
         ButtonGroup spamGroup = new ButtonGroup();
         JRadioButton file = new JRadioButton("File in Spam Folder");
         JRadioButton delete = new JRadioButton("Auto Delete");
@@ -106,7 +126,7 @@
 
         JPanel autoRespond = new JPanel();
         autoRespond.setLayout(new ColumnLayout());
-        autoRespond.setBorder( new TitledBorder("Auto Response") );
+        autoRespond.setBorder(new TitledBorder("Auto Response"));
 
         ButtonGroup respondGroup = new ButtonGroup();
         JRadioButton none = new JRadioButton("None");
@@ -129,10 +149,10 @@
 
     public JPanel buildConnectingPanel() {
         JPanel connectPanel = new JPanel();
-        connectPanel.setLayout( new ColumnLayout() );
+        connectPanel.setLayout(new ColumnLayout());
 
         JPanel protoPanel = new JPanel();
-        JLabel protoLabel = new JLabel ("Protocol");
+        JLabel protoLabel = new JLabel("Protocol");
         JComboBox protocol = new JComboBox();
         protocol.addItem("SMTP");
         protocol.addItem("IMAP");
@@ -141,7 +161,7 @@
         protoPanel.add(protocol);
 
         JPanel attachmentPanel = new JPanel();
-        JLabel attachmentLabel = new JLabel ("Attachments");
+        JLabel attachmentLabel = new JLabel("Attachments");
         JComboBox attach = new JComboBox();
         attach.addItem("Download Always");
         attach.addItem("Ask size > 1 Meg");
@@ -152,7 +172,7 @@
 
         JCheckBox autoConn = new JCheckBox("Auto Connect");
         JCheckBox compress = new JCheckBox("Use Compression");
-        autoConn.setSelected( true );
+        autoConn.setSelected(true);
 
         connectPanel.add(protoPanel);
         connectPanel.add(attachmentPanel);
@@ -161,18 +181,16 @@
         return connectPanel;
     }
 
-
-
     protected void centerDialog() {
         Dimension screenSize = this.getToolkit().getScreenSize();
         Dimension size = this.getSize();
-        screenSize.height = screenSize.height/2;
-        screenSize.width = screenSize.width/2;
-        size.height = size.height/2;
-        size.width = size.width/2;
+        screenSize.height = screenSize.height / 2;
+        screenSize.width = screenSize.width / 2;
+        size.height = size.height / 2;
+        size.width = size.width / 2;
         int y = screenSize.height - size.height;
         int x = screenSize.width - size.width;
-        this.setLocation(x,y);
+        this.setLocation(x, y);
     }
 
     public void CancelPressed() {
@@ -182,52 +200,54 @@
     public void OKPressed() {
         this.setVisible(false);
     }
+}
 
-}
 
 class ColumnLayout implements LayoutManager {
 
-  int xInset = 5;
-  int yInset = 5;
-  int yGap = 2;
+    int xInset = 5;
+    int yInset = 5;
+    int yGap = 2;
 
-  public void addLayoutComponent(String s, Component c) {}
+    public void addLayoutComponent(String s, Component c) {
+    }
 
-  public void layoutContainer(Container c) {
-      Insets insets = c.getInsets();
-      int height = yInset + insets.top;
+    public void layoutContainer(Container c) {
+        Insets insets = c.getInsets();
+        int height = yInset + insets.top;
 
-      Component[] children = c.getComponents();
-      Dimension compSize = null;
-      for (int i = 0; i < children.length; i++) {
-          compSize = children[i].getPreferredSize();
-          children[i].setSize(compSize.width, compSize.height);
-          children[i].setLocation( xInset + insets.left, height);
-          height += compSize.height + yGap;
-      }
+        Component[] children = c.getComponents();
+        Dimension compSize = null;
+        for (Component child : children) {
+            compSize = child.getPreferredSize();
+            child.setSize(compSize.width, compSize.height);
+            child.setLocation(xInset + insets.left, height);
+            height += compSize.height + yGap;
+        }
 
-  }
+    }
 
-  public Dimension minimumLayoutSize(Container c) {
-      Insets insets = c.getInsets();
-      int height = yInset + insets.top;
-      int width = 0 + insets.left + insets.right;
+    public Dimension minimumLayoutSize(Container c) {
+        Insets insets = c.getInsets();
+        int height = yInset + insets.top;
+        int width = 0 + insets.left + insets.right;
 
-      Component[] children = c.getComponents();
-      Dimension compSize = null;
-      for (int i = 0; i < children.length; i++) {
-          compSize = children[i].getPreferredSize();
-          height += compSize.height + yGap;
-          width = Math.max(width, compSize.width + insets.left + insets.right + xInset*2);
-      }
-      height += insets.bottom;
-      return new Dimension( width, height);
-  }
+        Component[] children = c.getComponents();
+        Dimension compSize = null;
+        for (Component child : children) {
+            compSize = child.getPreferredSize();
+            height += compSize.height + yGap;
+            width = Math.max(width, compSize.width + insets.left + insets.right + xInset
+                    * 2);
+        }
+        height += insets.bottom;
+        return new Dimension(width, height);
+    }
 
-  public Dimension preferredLayoutSize(Container c) {
-      return minimumLayoutSize(c);
-  }
+    public Dimension preferredLayoutSize(Container c) {
+        return minimumLayoutSize(c);
+    }
 
-  public void removeLayoutComponent(Component c) {}
-
+    public void removeLayoutComponent(Component c) {
+    }
 }
--- a/jdk/src/share/demo/jfc/Metalworks/PropertiesMetalTheme.java	Thu Mar 24 18:13:12 2011 +0100
+++ b/jdk/src/share/demo/jfc/Metalworks/PropertiesMetalTheme.java	Thu Mar 24 18:15:51 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,17 +29,15 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
-
 
-import javax.swing.plaf.*;
-import javax.swing.plaf.metal.*;
-import javax.swing.*;
-import javax.swing.border.*;
-import java.awt.*;
-import java.io.*;
-import java.util.*;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+import java.util.StringTokenizer;
+
+import javax.swing.plaf.ColorUIResource;
+import javax.swing.plaf.metal.DefaultMetalTheme;
+
 
 /**
  * This class allows you to load a theme from a file.
@@ -57,36 +55,33 @@
  * but it could easily be extended to load fonts -  or even icons.
  *
  * @author Steve Wilson
+ * @author Alexander Kouznetsov
  */
 public class PropertiesMetalTheme extends DefaultMetalTheme {
 
     private String name = "Custom Theme";
-
     private ColorUIResource primary1;
     private ColorUIResource primary2;
     private ColorUIResource primary3;
-
     private ColorUIResource secondary1;
     private ColorUIResource secondary2;
     private ColorUIResource secondary3;
-
     private ColorUIResource black;
     private ColorUIResource white;
 
-
     /**
-      * pass an inputstream pointing to a properties file.
-      * Colors will be initialized to be the same as the DefaultMetalTheme,
-      * and then any colors provided in the properties file will override that.
-      */
-    public PropertiesMetalTheme( InputStream stream ) {
+     * pass an inputstream pointing to a properties file.
+     * Colors will be initialized to be the same as the DefaultMetalTheme,
+     * and then any colors provided in the properties file will override that.
+     */
+    public PropertiesMetalTheme(InputStream stream) {
         initColors();
         loadProperties(stream);
     }
 
     /**
-      * Initialize all colors to be the same as the DefaultMetalTheme.
-      */
+     * Initialize all colors to be the same as the DefaultMetalTheme.
+     */
     private void initColors() {
         primary1 = super.getPrimary1();
         primary2 = super.getPrimary2();
@@ -101,9 +96,9 @@
     }
 
     /**
-      * Load the theme name and colors from the properties file
-      * Items not defined in the properties file are ignored
-      */
+     * Load the theme name and colors from the properties file
+     * Items not defined in the properties file are ignored
+     */
     private void loadProperties(InputStream stream) {
         Properties prop = new Properties();
         try {
@@ -120,7 +115,7 @@
         Object colorString = null;
 
         colorString = prop.get("primary1");
-        if (colorString != null){
+        if (colorString != null) {
             primary1 = parseColor(colorString.toString());
         }
 
@@ -161,22 +156,54 @@
 
     }
 
-    public String getName() { return name; }
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    protected ColorUIResource getPrimary1() {
+        return primary1;
+    }
 
-    protected ColorUIResource getPrimary1() { return primary1; }
-    protected ColorUIResource getPrimary2() { return primary2; }
-    protected ColorUIResource getPrimary3() { return primary3; }
+    @Override
+    protected ColorUIResource getPrimary2() {
+        return primary2;
+    }
+
+    @Override
+    protected ColorUIResource getPrimary3() {
+        return primary3;
+    }
 
-    protected ColorUIResource getSecondary1() { return secondary1; }
-    protected ColorUIResource getSecondary2() { return secondary2; }
-    protected ColorUIResource getSecondary3() { return secondary3; }
+    @Override
+    protected ColorUIResource getSecondary1() {
+        return secondary1;
+    }
+
+    @Override
+    protected ColorUIResource getSecondary2() {
+        return secondary2;
+    }
 
-    protected ColorUIResource getBlack() { return black; }
-    protected ColorUIResource getWhite() { return white; }
+    @Override
+    protected ColorUIResource getSecondary3() {
+        return secondary3;
+    }
+
+    @Override
+    protected ColorUIResource getBlack() {
+        return black;
+    }
+
+    @Override
+    protected ColorUIResource getWhite() {
+        return white;
+    }
 
     /**
-      * parse a comma delimited list of 3 strings into a Color
-      */
+     * parse a comma delimited list of 3 strings into a Color
+     */
     private ColorUIResource parseColor(String s) {
         int red = 0;
         int green = 0;
--- a/jdk/src/share/demo/jfc/Metalworks/UISwitchListener.java	Thu Mar 24 18:13:12 2011 +0100
+++ b/jdk/src/share/demo/jfc/Metalworks/UISwitchListener.java	Thu Mar 24 18:15:51 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,22 +29,21 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- */
 
-import java.awt.*;
-import java.beans.*;
-import java.awt.event.*;
-import javax.swing.*;
-import javax.swing.event.*;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import javax.swing.JComponent;
+import javax.swing.SwingUtilities;
 
 
 /**
-  * This class listens for UISwitches, and updates a given component.
-  *
-  * @author Steve Wilson
-  */
+ * This class listens for UISwitches, and updates a given component.
+ *
+ * @author Steve Wilson
+ * @author Alexander Kouznetsov
+ */
 public class UISwitchListener implements PropertyChangeListener {
+
     JComponent componentToSwitch;
 
     public UISwitchListener(JComponent c) {
--- a/jdk/src/share/demo/jfc/Metalworks/resources/HelpFiles/credits.html	Thu Mar 24 18:13:12 2011 +0100
+++ b/jdk/src/share/demo/jfc/Metalworks/resources/HelpFiles/credits.html	Thu Mar 24 18:15:51 2011 +0100
@@ -5,9 +5,9 @@
 </HEAD>
 <BODY>
 
-<H1>Java L&F Credits</H1>
+<H1>Java L&amp;F Credits</H1>
 
-<P>The Java L&F Engineering team:</P>
+<P>The Java L&amp;F Engineering team:</P>
 
 <UL>
   <LI>Mike Albers
@@ -22,12 +22,12 @@
   <LI>Harry Vertelney
 </UL>
 
-<P>The Java L&F Designer:</P>
+<P>The Java L&amp;F Designer:</P>
 
 <UL>
   <LI>Chris Ryan
 </UL>
 
-<P><A HREF="toc.html"><IMG SRC="back.gif" WIDTH="42" HEIGHT="22" ALIGN="BOTTOM" NATURALSIZEFLAG="3" BORDER="0">Back</A>
+<P><A HREF="toc.html"><IMG alt="Back" SRC="back.gif" WIDTH="42" HEIGHT="22" ALIGN="BOTTOM" BORDER="0">Back</A>
 </BODY>
 </HTML>
--- a/jdk/src/share/demo/jfc/Metalworks/resources/HelpFiles/metal.html	Thu Mar 24 18:13:12 2011 +0100
+++ b/jdk/src/share/demo/jfc/Metalworks/resources/HelpFiles/metal.html	Thu Mar 24 18:15:51 2011 +0100
@@ -7,11 +7,11 @@
 <BODY>
 
 <H1>
-About the Java L&F</H1>
-The Java Look and Feel is a cross-platform look & feel being provided by Javasoft.
-Here is some information about the Java L&F you might find useful.
+About the Java L&amp;F</H1>
+The Java Look and Feel is a cross-platform look &amp; feel being provided by Javasoft.
+Here is some information about the Java L&amp;F you might find useful.
 
-<P>The Java L&F implements all of the basic Swing functionality,
+<P>The Java L&amp;F implements all of the basic Swing functionality,
 but also extends it in several areas including:
 <UL>
 <LI>
@@ -27,27 +27,27 @@
 Trees</LI>
 </UL>
 
-</P>
+<P/>
 <H1>
 Themes</H1>
-<P>One of the first things we learned while implementing the Java L&F
+<P>One of the first things we learned while implementing the Java L&amp;F
 was than many developers feel very strongly about how colors are used in
 their software. To help accommodate this we created a Theme mechanism
 which allows a developer to easily specify the default colors, fonts and
-icons used by the L&F.</P>
+icons used by the L&amp;F.</P>
 
 <P>The theme mechanism is designed to allow developers to create
 their own themes. For an example of this, see the themes
-which are included with Metalworks. Note, like all of the L&F packages, 
+which are included with Metalworks. Note, like all of the L&amp;F packages,
 the metal package is not yet frozen and the theme mechanism may change as 
 we get developer feedback on how to improve it.</P>
 
 <H1>
 Sliders</H1>
-<P>There are several areas where the Java L&F introduces some optional
+<P>There are several areas where the Java L&amp;F introduces some optional
 "value-added" features above the base line capabilities of swing.&nbsp;
 One is the option of Filled Sliders. These are ideal for things like
-volume controls. To access the Java L&F "value-added" features you
+volume controls. To access the Java L&amp;F "value-added" features you
 pass in a token to the component's putClientProperty method.&nbsp;Here
 is an example:</P>
 
@@ -60,12 +60,12 @@
 <P>Note that if a UI such as Windows or Motif encounters a property such as
 JSlider.fill which is does not understand that property will be ignored.&nbsp;
 Thus you don't have to worry about problems which could arise if you switch
-to a different L&F.</P>
+to a different L&amp;F.</P>
 
 <H1>
 ToolBars</H1>
 <P>Many popular applications support "roll-over" effects on buttons in toolbars. 
-The Java L&F provides an easy way to do this. Here is a code snippit:</P>
+The Java L&amp;F provides an easy way to do this. Here is a code snippit:</P>
 
 <PRE>
 JToolBar toolbar = new JToolBar();<BR>
@@ -82,7 +82,7 @@
 
 <H1>
 Trees</H1>
-<P>Java L&F allows you to control the line style used in the JTree component. Here are some code snippits:</P>
+<P>Java L&amp;F allows you to control the line style used in the JTree component. Here are some code snippits:</P>
 
 <PRE>
 JTree myTree = new JTree();
@@ -101,6 +101,6 @@
                          "Horizontal"); 
 </PRE>
 
-<P><A HREF="toc.html"><IMG SRC="back.gif" BORDER=0 NATURALSIZEFLAG="3" HEIGHT=22 WIDTH=42 ALIGN=BOTTOM>Back</A>
+<P><A HREF="toc.html"><IMG alt="Back"  SRC="back.gif" BORDER=0 HEIGHT=22 WIDTH=42 ALIGN=BOTTOM>Back</A>
 </BODY>
 </HTML>
--- a/jdk/src/share/demo/jfc/Metalworks/resources/HelpFiles/metalworks.html	Thu Mar 24 18:13:12 2011 +0100
+++ b/jdk/src/share/demo/jfc/Metalworks/resources/HelpFiles/metalworks.html	Thu Mar 24 18:15:51 2011 +0100
@@ -8,7 +8,7 @@
 
 <H1>
 About Metalworks</H1>
-Metalworks is a simple Swing-based simulated email application.  It shows off several features of Swing including: JInternalFrame, JTabbedPane, JFileChooser, JEditorPane and JRadioButtonMenuItem.  It is optimized to work with the Java Look & Feel and shows use of several Java L&F specific features including themes.
+Metalworks is a simple Swing-based simulated email application.  It shows off several features of Swing including: JInternalFrame, JTabbedPane, JFileChooser, JEditorPane and JRadioButtonMenuItem.  It is optimized to work with the Java Look &amp; Feel and shows use of several Java L&amp;F specific features including themes.
 <H1>
 Metalworks Features</H1>
 The functionality of the Metalworks demo is minimal, and many controls are non-functional.  They are only intended to show how to construct the UI for such interfaces.  Things that do work in the Metalworks demo include:
@@ -28,6 +28,6 @@
 
 &nbsp;
 
-<P><A HREF="toc.html"><IMG SRC="back.gif" BORDER=0 NATURALSIZEFLAG="3" HEIGHT=22 WIDTH=42 ALIGN=BOTTOM>Back</A>
+<P><A HREF="toc.html"><IMG alt="Back"  SRC="back.gif" BORDER=0 HEIGHT=22 WIDTH=42 ALIGN=BOTTOM>Back</A>
 </BODY>
 </HTML>
--- a/jdk/src/share/demo/jfc/Metalworks/resources/HelpFiles/swing.html	Thu Mar 24 18:13:12 2011 +0100
+++ b/jdk/src/share/demo/jfc/Metalworks/resources/HelpFiles/swing.html	Thu Mar 24 18:15:51 2011 +0100
@@ -5,7 +5,7 @@
 </HEAD>
 <BODY>
 
-<H1><IMG SRC="duke.gif" WIDTH="98" HEIGHT="98" ALIGN="MIDDLE" NATURALSIZEFLAG="3">About Swing</H1>
+    <H1><IMG alt="About Swing"  SRC="duke.gif" WIDTH="98" HEIGHT="98" ALIGN="MIDDLE">About Swing</H1>
 
 <P>&nbsp;</P>
 
@@ -17,6 +17,6 @@
 without restarting it and without the developer having to subclass the entire
 component set.</P>
 
-<P><A HREF="toc.html"><IMG SRC="back.gif" WIDTH="42" HEIGHT="22" ALIGN="BOTTOM" NATURALSIZEFLAG="3" BORDER="0">Back</A>
+<P><A HREF="toc.html"><IMG alt="Back"  SRC="back.gif" WIDTH="42" HEIGHT="22" ALIGN="BOTTOM" BORDER="0">Back</A>
 </BODY>
 </HTML>
--- a/jdk/src/share/demo/jfc/Metalworks/resources/HelpFiles/toc.html	Thu Mar 24 18:13:12 2011 +0100
+++ b/jdk/src/share/demo/jfc/Metalworks/resources/HelpFiles/toc.html	Thu Mar 24 18:15:51 2011 +0100
@@ -5,7 +5,7 @@
 </HEAD>
 <BODY>
 
-<H1><IMG SRC="javalogo.gif" WIDTH="52" HEIGHT="88" ALIGN="MIDDLE" NATURALSIZEFLAG="3">Metalworks Help</H1>
+    <H1><IMG alt="Help" SRC="javalogo.gif" WIDTH="52" HEIGHT="88" ALIGN="MIDDLE">Metalworks Help</H1>
 
 <P>Welcome to the Metalworks Help files. These are actually HTML files which
 you are viewing with the Swing JEditorPane component. Pretty cool, eh? Were
@@ -18,7 +18,7 @@
 
 <UL>
   <LI><A HREF="metalworks.html">About Metalworks</A>
-  <LI><A HREF="metal.html">About Java L&F</A>
+  <LI><A HREF="metal.html">About Java L&amp;F</A>
   <LI><A HREF="swing.html">About Swing</A>
   <LI><A HREF="credits.html">Credits</A>
 </UL>