harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r441863 [2/5] - in /incubator/harmony/enhanced/classlib/trunk/modules/awt/src: main/java/common/java/awt/ test/api/java/common/java/awt/
Date Sat, 09 Sep 2006 21:56:50 GMT
Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Component.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Component.java?view=diff&rev=441863&r1=441862&r2=441863
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Component.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Component.java Sat Sep  9 14:56:46 2006
@@ -20,9 +20,34 @@
 package java.awt;
 
 import java.awt.dnd.DropTarget;
-import java.awt.event.*;
-import java.awt.im.*;
-import java.awt.image.*;
+import java.awt.event.ComponentEvent;
+import java.awt.event.ComponentListener;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import java.awt.event.HierarchyBoundsListener;
+import java.awt.event.HierarchyEvent;
+import java.awt.event.HierarchyListener;
+import java.awt.event.InputMethodEvent;
+import java.awt.event.InputMethodListener;
+import java.awt.event.InvocationEvent;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.event.MouseMotionListener;
+import java.awt.event.MouseWheelEvent;
+import java.awt.event.MouseWheelListener;
+import java.awt.event.PaintEvent;
+import java.awt.event.WindowEvent;
+import java.awt.im.InputContext;
+import java.awt.im.InputMethodRequests;
+import java.awt.image.BufferStrategy;
+import java.awt.image.BufferedImage;
+import java.awt.image.ColorModel;
+import java.awt.image.ImageObserver;
+import java.awt.image.ImageProducer;
+import java.awt.image.VolatileImage;
+import java.awt.image.WritableRaster;
 import java.awt.peer.ComponentPeer;
 import java.beans.PropertyChangeListener;
 import java.beans.PropertyChangeSupport;
@@ -34,9 +59,23 @@
 import java.lang.reflect.Method;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import java.util.*;
-
-import javax.accessibility.*;
+import java.util.ArrayList;
+import java.util.EventListener;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+
+import javax.accessibility.Accessible;
+import javax.accessibility.AccessibleComponent;
+import javax.accessibility.AccessibleContext;
+import javax.accessibility.AccessibleRole;
+import javax.accessibility.AccessibleState;
+import javax.accessibility.AccessibleStateSet;
 
 import org.apache.harmony.awt.ClipRegion;
 import org.apache.harmony.awt.FieldsAccessor;
@@ -61,13 +100,12 @@
 
     public static final float RIGHT_ALIGNMENT = 1.0f;
 
-    private static final Class componentClass = Component.class;
-    private static final Hashtable childClassesFlags = new Hashtable();
+    private static final Class<Component> componentClass = Component.class;
+    private static final Hashtable<Class<?>, Boolean> childClassesFlags = new Hashtable<Class<?>, Boolean>();
 
     private static final ComponentPeer peer = new ComponentPeer(){
     };
 
-    private static final int imageUpdateRate;
     private static final boolean incrementalImageUpdate;
 
     final transient Toolkit toolkit = Toolkit.getDefaultToolkit();
@@ -144,6 +182,7 @@
             Component.this.addFocusListener(l);
         }
 
+        @Override
         public void addPropertyChangeListener(PropertyChangeListener listener) {
             toolkit.lockAWT();
             try {
@@ -300,6 +339,7 @@
             Component.this.removeFocusListener(l);
         }
 
+        @Override
         public void removePropertyChangeListener(PropertyChangeListener listener) {
             toolkit.lockAWT();
             try {
@@ -408,6 +448,7 @@
             }
         }
 
+        @Override
         public Accessible getAccessibleParent() {
             toolkit.lockAWT();
             try {
@@ -423,6 +464,7 @@
             }
         }
 
+        @Override
         public Accessible getAccessibleChild(int i) {
             toolkit.lockAWT();
             try {
@@ -432,6 +474,7 @@
             }
         }
 
+        @Override
         public int getAccessibleChildrenCount() {
             toolkit.lockAWT();
             try {
@@ -441,14 +484,17 @@
             }
         }
 
+        @Override
         public AccessibleComponent getAccessibleComponent() {
             return this;
         }
 
+        @Override
         public String getAccessibleDescription() {
             return super.getAccessibleDescription(); // why override?
         }
 
+        @Override
         public int getAccessibleIndexInParent() {
             toolkit.lockAWT();
             try {
@@ -472,6 +518,7 @@
             }
         }
 
+        @Override
         public AccessibleRole getAccessibleRole() {
             toolkit.lockAWT();
             try {
@@ -481,6 +528,7 @@
             }
         }
 
+        @Override
         public AccessibleStateSet getAccessibleStateSet() {
             toolkit.lockAWT();
             try {
@@ -509,6 +557,7 @@
             }
         }
 
+        @Override
         public Locale getLocale() throws IllegalComponentStateException {
             toolkit.lockAWT();
             try {
@@ -528,31 +577,50 @@
         protected boolean validatedContents;
 
         protected BltBufferStrategy(int numBuffers, BufferCapabilities caps) {
-            if (true) throw new RuntimeException("Method is not implemented");
+            if (true) {
+                throw new RuntimeException("Method is not implemented");
+            }
         }
+        @Override
         public boolean contentsLost() {
-            if (true) throw new RuntimeException("Method is not implemented");
+            if (true) {
+                throw new RuntimeException("Method is not implemented");
+            }
             return false;
         }
+        @Override
         public boolean contentsRestored() {
-            if (true) throw new RuntimeException("Method is not implemented");
+            if (true) {
+                throw new RuntimeException("Method is not implemented");
+            }
             return false;
         }
         protected void createBackBuffers(int numBuffers) {
-            if (true) throw new RuntimeException("Method is not implemented");
+            if (true) {
+                throw new RuntimeException("Method is not implemented");
+            }
         }
+        @Override
         public BufferCapabilities getCapabilities() {
             return (BufferCapabilities)caps.clone();
         }
+        @Override
         public Graphics getDrawGraphics() {
-            if (true) throw new RuntimeException("Method is not implemented");
+            if (true) {
+                throw new RuntimeException("Method is not implemented");
+            }
             return null;
         }
         protected void revalidate() {
-            if (true) throw new RuntimeException("Method is not implemented");
+            if (true) {
+                throw new RuntimeException("Method is not implemented");
+            }
         }
+        @Override
         public void show() {
-            if (true) throw new RuntimeException("Method is not implemented");
+            if (true) {
+                throw new RuntimeException("Method is not implemented");
+            }
         }
     }
 
@@ -573,12 +641,18 @@
             this.numBuffers = numBuffers;
             this.caps = (BufferCapabilities)caps.clone();
         }
+        @Override
         public boolean contentsLost() {
-            if (true) throw new RuntimeException("Method is not implemented");
+            if (true) {
+                throw new RuntimeException("Method is not implemented");
+            }
             return false;
         }
+        @Override
         public boolean contentsRestored() {
-            if (true) throw new RuntimeException("Method is not implemented");
+            if (true) {
+                throw new RuntimeException("Method is not implemented");
+            }
             return false;
         }
         protected void createBuffers(int numBuffers, BufferCapabilities caps)
@@ -596,30 +670,47 @@
                         "Component should be displayable");
             }
             // TODO: throw new AWTException("Capabilities are not supported");
-            if (true) throw new RuntimeException("Method is not implemented");
+            if (true) {
+                throw new RuntimeException("Method is not implemented");
+            }
         }
         protected  void destroyBuffers() {
-            if (true) throw new RuntimeException("Method is not implemented");
+            if (true) {
+                throw new RuntimeException("Method is not implemented");
+            }
         }
         protected void flip(BufferCapabilities.FlipContents flipAction) {
-            if (true) throw new RuntimeException("Method is not implemented");
+            if (true) {
+                throw new RuntimeException("Method is not implemented");
+            }
         }
         protected Image getBackBuffer() {
-            if (true) throw new RuntimeException("Method is not implemented");
+            if (true) {
+                throw new RuntimeException("Method is not implemented");
+            }
             return null;
         }
+        @Override
         public BufferCapabilities getCapabilities() {
             return (BufferCapabilities)caps.clone();
         }
+        @Override
         public Graphics getDrawGraphics() {
-            if (true) throw new RuntimeException("Method is not implemented");
+            if (true) {
+                throw new RuntimeException("Method is not implemented");
+            }
             return null;
         }
         protected void revalidate() {
-            if (true) throw new RuntimeException("Method is not implemented");
+            if (true) {
+                throw new RuntimeException("Method is not implemented");
+            }
         }
+        @Override
         public void show() {
-            if (true) throw new RuntimeException("Method is not implemented");
+            if (true) {
+                throw new RuntimeException("Method is not implemented");
+            }
         }
     }
 
@@ -753,7 +844,7 @@
     private boolean focusTraversalKeysEnabled = true;
     /**  Possible keys are: FORWARD_TRAVERSAL_KEYS, 
      * BACKWARD_TRAVERSAL_KEYS, UP_CYCLE_TRAVERSAL_KEYS */
-    private HashMap/*<int, Set<AWTKeyStroke>>*/ traversalKeys = new HashMap();
+    private Map<Integer, Set<? extends AWTKeyStroke>> traversalKeys = new HashMap<Integer, Set<? extends AWTKeyStroke>>();
     int[] traversalIDs;
 
     private Locale locale;
@@ -761,14 +852,14 @@
 
     private PropertyChangeSupport propertyChangeSupport;
 
-    private ArrayList popups;
+    private ArrayList<PopupMenu> popups;
 
     private boolean coalescer;
-    private Hashtable eventsTable;
+    private Hashtable<Integer, LinkedList<AWTEvent>> eventsTable;
     /** Cashed reference used during EventQueue.postEvent() */
-    private LinkedList eventsList;
+    private LinkedList<AWTEvent> eventsList;
 
-    private int hierarchyChangingCounter = 0;
+    private int hierarchyChangingCounter;
     private boolean wasShowing;
     private boolean wasDisplayable;
 
@@ -781,7 +872,7 @@
     transient RedrawManager redrawManager;
     private boolean valid;
 
-    private HashMap updatedImages;
+    private HashMap<Image, ImageParameters> updatedImages;
 
     /** 
      * The lock object for private component's data
@@ -790,8 +881,8 @@
     private final transient Object componentLock = new Object();
 
     static {
-        PrivilegedAction action = new PrivilegedAction() {
-            public Object run() {
+        PrivilegedAction<String[]> action = new PrivilegedAction<String[]>() {
+            public String[] run() {
                 String properties [] = new String[2];
                 properties[0] = 
                     System.getProperty("awt.image.redrawrate", "100");
@@ -800,7 +891,7 @@
                 return properties;
             }};
 
-        String properties[] = (String[])AccessController.doPrivileged(action);
+        String properties[] = AccessController.doPrivileged(action);
 
         int rate;
 
@@ -809,7 +900,6 @@
         } catch (NumberFormatException e) {
             rate = 100;
         }
-        imageUpdateRate = rate;
         incrementalImageUpdate = properties[1].equals("true");
     }
 
@@ -821,8 +911,8 @@
             traversalIDs = this instanceof Container ?
                     KeyboardFocusManager.contTraversalIDs : 
                         KeyboardFocusManager.compTraversalIDs;
-            for (int i = 0; i < traversalIDs.length; i++) {
-                traversalKeys.put(new Integer(traversalIDs[i]), null);
+            for (int element : traversalIDs) {
+                traversalKeys.put(new Integer(element), null);
             }
 
             behaviour = createBehavior();
@@ -839,16 +929,16 @@
      *
      */
     private void deriveCoalescerFlag() {
-        Class thisClass = getClass();
+        Class<?> thisClass = getClass();
         boolean flag = true;
 
         synchronized(childClassesFlags) {
-            Boolean flagWrapper = (Boolean) childClassesFlags.get(thisClass);
+            Boolean flagWrapper = childClassesFlags.get(thisClass);
 
             if (flagWrapper == null) {
                 Method coalesceMethod = null;
 
-                for (Class c = thisClass; c != componentClass; c = c.getSuperclass()) {
+                for (Class<?> c = thisClass; c != componentClass; c = c.getSuperclass()) {
                     try {
                         coalesceMethod = c.getDeclaredMethod("coalesceEvents",
                                 new Class[] {Class.forName("java.awt.AWTEvent"), 
@@ -870,7 +960,7 @@
 
         coalescer = flag;
         if (flag) {
-            eventsTable = new Hashtable();
+            eventsTable = new Hashtable<Integer, LinkedList<AWTEvent>>();
         } else {
             eventsTable = null;
         }
@@ -915,6 +1005,7 @@
         return name;
     }
 
+    @Override
     public String toString() {
         /* The format is based on 1.5 release behavior 
          * which can be revealed by the following code:
@@ -938,7 +1029,7 @@
                 return;
             }
             if (popups == null) {
-                popups = new ArrayList();
+                popups = new ArrayList<PopupMenu>();
             }
             popup.setParent(this);
             popups.add(popup);
@@ -968,6 +1059,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public Dimension size() {
         toolkit.lockAWT();
         try {
@@ -1002,14 +1094,18 @@
     Component getHWSurface() {
         Component parent;
 
-        for (parent = this; (parent != null) && (parent.isLightweight()); parent = parent.getParent());
+        for (parent = this; (parent != null) && (parent.isLightweight()); parent = parent.getParent()) {
+            ;
+        }
 
         return parent;
     }
 
     Window getWindowAncestor() {
         Component par;
-        for ( par = this; par != null && !(par instanceof Window); par = par.getParent());
+        for ( par = this; par != null && !(par instanceof Window); par = par.getParent()) {
+            ;
+        }
 
         return (Window) par;
     }
@@ -1065,7 +1161,9 @@
 
     String getIndentStr(int indent) {
         char[] ind = new char[indent];
-        for (int i=0; i < indent; ind[i++] = ' ');
+        for (int i=0; i < indent; ind[i++] = ' ') {
+            ;
+        }
         return new String(ind);
     }
 
@@ -1127,6 +1225,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public void resize(int width, int height) {
         toolkit.lockAWT();
         try {
@@ -1140,6 +1239,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public void resize(Dimension size) {
         toolkit.lockAWT();
         try {
@@ -1161,6 +1261,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public void disable() {
         toolkit.lockAWT();
         try {
@@ -1174,6 +1275,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public void enable() {
         toolkit.lockAWT();
         try {
@@ -1187,6 +1289,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public void enable(boolean b) {
         toolkit.lockAWT();
         try {
@@ -1205,8 +1308,9 @@
     public Point getLocation(Point rv) {
         toolkit.lockAWT();
         try {
-            if (rv == null)
+            if (rv == null) {
                 rv = new Point();
+            }
             rv.setLocation(getX(), getY());
             return rv;
         } finally {
@@ -1235,7 +1339,9 @@
     public Dimension getSize(Dimension rv) {
         toolkit.lockAWT();
         try {
-            if (rv == null) rv = new Dimension();
+            if (rv == null) {
+                rv = new Dimension();
+            }
             rv.setSize(getWidth(), getHeight());
             return rv;
         } finally {
@@ -1255,6 +1361,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public Point location() {
         toolkit.lockAWT();
         try {
@@ -1321,6 +1428,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public boolean action(Event evt, Object what) {
         //to be overridden: do nothing,
         //just return false to propagate event up to the parent container
@@ -1369,6 +1477,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public Rectangle bounds() {
         toolkit.lockAWT();
         try {
@@ -1415,20 +1524,18 @@
 
     AWTEvent getRelativeEvent(int id) {
         Integer idWrapper = new Integer(id);
-        eventsList = (LinkedList) eventsTable.get(idWrapper);
+        eventsList = eventsTable.get(idWrapper);
 
         if (eventsList == null) {
-            eventsList = new LinkedList();
+            eventsList = new LinkedList<AWTEvent>();
             eventsTable.put(idWrapper, eventsList);
 
             return null;
-        } else {
-            if (eventsList.isEmpty()) {
-                return null;
-            } else {
-                return (AWTEvent) eventsList.getLast();
-            }
         }
+        if (eventsList.isEmpty()) {
+            return null;
+        }
+        return eventsList.getLast();
     }
 
     void addNewEvent(AWTEvent event) {
@@ -1440,7 +1547,7 @@
     }
 
     void removeNextEvent(int id) {
-        ((LinkedList) eventsTable.get(new Integer(id))).removeFirst();
+        eventsTable.get(new Integer(id)).removeFirst();
     }
 
     public Image createImage(ImageProducer producer) {
@@ -1455,11 +1562,14 @@
     public Image createImage(int width, int height) {
         toolkit.lockAWT();
         try {
-            if(!isDisplayable()) return null;
+            if(!isDisplayable()) {
+                return null;
+            }
 
             GraphicsConfiguration gc = getGraphicsConfiguration();
-            if (gc == null)
+            if (gc == null) {
                 return null;
+            }
             
             ColorModel cm = gc.getColorModel(Transparency.OPAQUE);
             WritableRaster wr = cm.createCompatibleWritableRaster(width, height);
@@ -1481,8 +1591,9 @@
             }
             
             GraphicsConfiguration gc = getGraphicsConfiguration();
-            if (gc == null)
+            if (gc == null) {
                 return null;
+            }
             
             VolatileImage image = gc.createCompatibleVolatileImage(width, height, caps);
 
@@ -1501,8 +1612,9 @@
             }
             
             GraphicsConfiguration gc = getGraphicsConfiguration();
-            if (gc == null)
+            if (gc == null) {
                 return null;
+            }
             
             VolatileImage image = gc.createCompatibleVolatileImage(width, height);
 
@@ -1528,6 +1640,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public void deliverEvent(Event evt) {
         postEvent(evt);
     }
@@ -1746,7 +1859,7 @@
         try {
             Integer kId = new Integer(id);
             KeyboardFocusManager.checkTraversalKeysID(traversalKeys, kId);
-            Set keys = null;
+            Set<?> keys = null;
             Object value = traversalKeys.get(kId);
             keys = value instanceof Set ? (Set) value :
                 parent != null ? parent.getFocusTraversalKeys(id) : null;
@@ -1892,6 +2005,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public ComponentPeer getPeer() {
         toolkit.lockAWT();
         try {
@@ -1942,6 +2056,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public boolean gotFocus(Event evt, Object what) {
 
         //to be overridden: do nothing,
@@ -1953,6 +2068,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public boolean handleEvent(Event evt) {
         switch (evt.id) {
         case Event.ACTION_EVENT:
@@ -1996,6 +2112,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public void hide() {
         toolkit.lockAWT();
         try {
@@ -2023,6 +2140,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public boolean inside(int x, int y) {
         toolkit.lockAWT();
         try {
@@ -2144,6 +2262,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public boolean isFocusTraversable() {
         toolkit.lockAWT();
         try {
@@ -2210,6 +2329,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public boolean keyDown(Event evt, int key) {
 
         //to be overridden: do nothing,
@@ -2221,6 +2341,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public boolean keyUp(Event evt, int key) {
         //to be overridden: do nothing,
         //just return false to propagate event up to the parent container
@@ -2230,6 +2351,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public void layout() {
         toolkit.lockAWT();
         try {
@@ -2242,6 +2364,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public Component locate(int x, int y) {
         toolkit.lockAWT();
         try {
@@ -2257,6 +2380,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public boolean lostFocus(Event evt, Object what) {
 
         //to be overridden: do nothing,
@@ -2268,6 +2392,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public boolean mouseDown(Event evt, int x, int y) {
 
         //to be overridden: do nothing,
@@ -2279,6 +2404,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public boolean mouseDrag(Event evt, int x, int y) {
 
         //to be overridden: do nothing,
@@ -2290,6 +2416,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public boolean mouseEnter(Event evt, int x, int y) {
         //to be overridden: do nothing,
         //just return false to propagate event up to the parent container
@@ -2300,6 +2427,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public boolean mouseExit(Event evt, int x, int y) {
         //to be overridden: do nothing,
         //just return false to propagate event up to the parent container
@@ -2310,6 +2438,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public boolean mouseMove(Event evt, int x, int y) {
         //to be overridden: do nothing,
         //just return false to propagate event up to the parent container
@@ -2320,6 +2449,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public boolean mouseUp(Event evt, int x, int y) {
         //to be overridden: do nothing,
         //just return false to propagate event up to the parent container
@@ -2329,6 +2459,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public void move(int x, int y) {
         toolkit.lockAWT();
         try {
@@ -2342,6 +2473,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public void nextFocus() {
         toolkit.lockAWT();
         try {
@@ -2371,6 +2503,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public boolean postEvent(Event evt) {
 
         boolean handled = handleEvent(evt);
@@ -2640,6 +2773,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public void reshape(int x, int y, int w, int h) {
         toolkit.lockAWT();
         try {
@@ -2871,28 +3005,25 @@
         }
     }
 
-    public void setFocusTraversalKeys(int id, Set keystrokes) {
-        Set oldTraversalKeys;
+    public void setFocusTraversalKeys(int id, Set<? extends AWTKeyStroke> keystrokes) {
+        Set<? extends AWTKeyStroke> oldTraversalKeys;
         String propName = "FocusTraversalKeys";
         toolkit.lockAWT();
         try {
             Integer kId = new Integer(id);
             KeyboardFocusManager.checkTraversalKeysID(traversalKeys, kId);
-            HashMap keys = new HashMap();
-            // fill the map with actual keystrokes
-            // which may be stored in ancestor's maps
-            for (int i=0; i < traversalIDs.length; i++) {
-                int kid = traversalIDs[i];
+            Map<Integer, Set<AWTKeyStroke>> keys = new HashMap<Integer, Set<AWTKeyStroke>>();
+            for (int kid : traversalIDs) {
                 Integer key = new Integer(kid);
                 keys.put(key, getFocusTraversalKeys(kid));
             }
             KeyboardFocusManager.checkKeyStrokes(traversalIDs, keys,
-                                                 kId, keystrokes);
-            oldTraversalKeys = (Set) traversalKeys.get(new Integer(id));
+                                                 kId, (Set<AWTKeyStroke>)keystrokes);
+            oldTraversalKeys = traversalKeys.get(new Integer(id));
             //put a copy of keystrokes object into map:
-            Set newKeys = keystrokes;
+            Set<? extends AWTKeyStroke> newKeys = keystrokes;
             if (keystrokes != null) {
-                newKeys = new HashSet(keystrokes);
+                newKeys = new HashSet<AWTKeyStroke>(keystrokes);
             }
             traversalKeys.put(kId, newKeys);
             String direction = "";
@@ -3072,6 +3203,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public void show() {
         toolkit.lockAWT();
         try {
@@ -3100,6 +3232,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public void show(boolean b) {
         if (b) {
             show();
@@ -3266,6 +3399,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public Dimension minimumSize() {
         toolkit.lockAWT();
         try {
@@ -3295,6 +3429,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public Dimension preferredSize() {
         toolkit.lockAWT();
         try {
@@ -3628,7 +3763,7 @@
         processInputMethodEventImpl(e, inputMethodListeners.getSystemIterator());
     }
 
-    private void processInputMethodEventImpl(InputMethodEvent e, Iterator i) {
+    private void processInputMethodEventImpl(InputMethodEvent e, Iterator<?> i) {
         while(i.hasNext()) {
             InputMethodListener listener = (InputMethodListener) i.next();
             switch (e.getID()) {
@@ -3646,11 +3781,11 @@
         processMouseWheelEventImpl(e, mouseWheelListeners.getSystemIterator());
     }
 
-    private void processMouseWheelEventImpl(MouseWheelEvent e, Iterator i) {
+    private void processMouseWheelEventImpl(MouseWheelEvent e, Iterator<?> i) {
         while(i.hasNext()) {
             MouseWheelListener listener = (MouseWheelListener) i.next();
             switch (e.getID()) {
-            case MouseWheelEvent.MOUSE_WHEEL:
+            case MouseEvent.MOUSE_WHEEL:
                 listener.mouseWheelMoved(e);
                 break;
             }
@@ -3702,7 +3837,7 @@
         }
     }
 
-    public EventListener[] getListeners(Class listenerType) {
+    public EventListener[] getListeners(Class<?> listenerType) {
         if (ComponentListener.class.isAssignableFrom(listenerType)) {
             return getComponentListeners();
         } else if (FocusListener.class.isAssignableFrom(listenerType)) {
@@ -3839,7 +3974,7 @@
         processComponentEventImpl(e, componentListeners.getUserIterator());
     }
 
-    private void processComponentEventImpl(ComponentEvent e, Iterator i) {
+    private void processComponentEventImpl(ComponentEvent e, Iterator<?> i) {
 
         while (i.hasNext()) {
             ComponentListener listener = (ComponentListener) i.next();
@@ -3883,7 +4018,7 @@
         processFocusEventImpl(e, focusListeners.getUserIterator());
     }
 
-    private void processFocusEventImpl(FocusEvent e, Iterator i) {
+    private void processFocusEventImpl(FocusEvent e, Iterator<?> i) {
         while (i.hasNext()) {
             FocusListener listener = (FocusListener) i.next();
 
@@ -3911,7 +4046,7 @@
     }
 
     protected void processHierarchyEvent(HierarchyEvent e) {
-        for (Iterator i = hierarchyListeners.getUserIterator(); i.hasNext();) {
+        for (Iterator<?> i = hierarchyListeners.getUserIterator(); i.hasNext();) {
             HierarchyListener listener = (HierarchyListener) i.next();
 
             switch (e.getID()) {
@@ -3936,7 +4071,7 @@
     }
 
     protected void processHierarchyBoundsEvent(HierarchyEvent e) {
-        for (Iterator i = hierarchyBoundsListeners.getUserIterator(); i.hasNext();) {
+        for (Iterator<?> i = hierarchyBoundsListeners.getUserIterator(); i.hasNext();) {
             HierarchyBoundsListener listener = (HierarchyBoundsListener) i.next();
 
             switch (e.getID()) {
@@ -3971,7 +4106,7 @@
         processKeyEventImpl(e, keyListeners.getUserIterator());
     }
 
-    private void processKeyEventImpl(KeyEvent e, Iterator i) {
+    private void processKeyEventImpl(KeyEvent e, Iterator<?> i) {
         while (i.hasNext()) {
             KeyListener listener = (KeyListener) i.next();
 
@@ -4030,7 +4165,7 @@
         processMouseEventImpl(e,  mouseListeners.getUserIterator());
     }
 
-    private void processMouseEventImpl(MouseEvent e, Iterator i) {
+    private void processMouseEventImpl(MouseEvent e, Iterator<?> i) {
         while(i.hasNext()) {
             MouseListener listener = (MouseListener) i.next();
 
@@ -4054,7 +4189,7 @@
         }
     }
 
-    private void processMouseMotionEventImpl(MouseEvent e, Iterator i) {
+    private void processMouseMotionEventImpl(MouseEvent e, Iterator<?> i) {
         while (i.hasNext()) {
             MouseMotionListener listener = (MouseMotionListener) i.next();
 
@@ -4117,7 +4252,7 @@
     }
 
     protected void processInputMethodEvent(InputMethodEvent e) {
-        for (Iterator i = inputMethodListeners.getUserIterator(); i.hasNext();) {
+        for (Iterator<?> i = inputMethodListeners.getUserIterator(); i.hasNext();) {
             InputMethodListener listener = (InputMethodListener) i.next();
 
             switch (e.getID()) {
@@ -4275,9 +4410,9 @@
         ImageParameters imageParams;
 
         if (updatedImages == null) {
-            updatedImages = new HashMap();
+            updatedImages = new HashMap<Image, ImageParameters>();
         }
-        imageParams = (ImageParameters) updatedImages.get(image);
+        imageParams = updatedImages.get(image);
         if (imageParams == null) {
             imageParams = new ImageParameters();
             updatedImages.put(image, imageParams);
@@ -4295,7 +4430,9 @@
             done = true;
           }
 
-          if(done) repaint();
+          if(done) {
+            repaint();
+        }
           return (infoflags & (ABORT | ALLBITS)) == 0;
         } finally {
             toolkit.unlockAWT();
@@ -4312,7 +4449,7 @@
 
     private class ImageParameters {
 
-        private LinkedList drawingParams = new LinkedList();
+        private LinkedList<DrawingParameters> drawingParams = new LinkedList<DrawingParameters>();
 
         Dimension size = new Dimension(Component.this.w, Component.this.h);
 
@@ -4320,7 +4457,7 @@
             drawingParams.add(new DrawingParameters(destLocation, destSize, source));
         }
 
-        Iterator drawingParametersIterator() {
+        Iterator<DrawingParameters> drawingParametersIterator() {
             return drawingParams.iterator();
         }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/ComponentOrientation.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/ComponentOrientation.java?view=diff&rev=441863&r1=441862&r2=441863
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/ComponentOrientation.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/ComponentOrientation.java Sat Sep  9 14:56:46 2006
@@ -31,7 +31,7 @@
 
     public static final ComponentOrientation UNKNOWN = new ComponentOrientation(true, true);
 
-    private static HashSet rlLangs = new HashSet(); //RIGHT_TO_LEFT languages
+    private static final Set<String> rlLangs = new HashSet<String>(); //RIGHT_TO_LEFT languages
 
     private final boolean horizontal;
 
@@ -47,8 +47,8 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public static ComponentOrientation getOrientation(ResourceBundle bdl) {
-        ComponentOrientation co = null;
         Object obj = null;
         try {
             obj = bdl.getObject("Orientation");

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Container.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Container.java?view=diff&rev=441863&r1=441862&r2=441863
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Container.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Container.java Sat Sep  9 14:56:46 2006
@@ -38,7 +38,7 @@
 public class Container extends Component {
     private static final long serialVersionUID = 4613797578919906343L;
 
-    private Vector children = new Vector();
+    private Vector<Component> children = new Vector<Component>();
 
     private final AWTListenerList containerListeners = new AWTListenerList(this);
 
@@ -48,7 +48,7 @@
     private Dimension minimumLayoutSize;
     private Dimension preferredLayoutSize;
 
-    Object layoutData = null;
+    Object layoutData;
 
     boolean focusCycleRoot;
 
@@ -89,6 +89,7 @@
         protected AccessibleAWTContainer() {
         }
 
+        @Override
         public void addPropertyChangeListener(PropertyChangeListener listener) {
             super.addPropertyChangeListener(listener);
             if (accessibleContainerHandler != null) {
@@ -98,6 +99,7 @@
             Container.this.addContainerListener(accessibleContainerHandler);
         }
 
+        @Override
         public Accessible getAccessibleAt(Point p) {
             toolkit.lockAWT();
             try {
@@ -126,6 +128,7 @@
             }
         }
 
+        @Override
         public Accessible getAccessibleChild(int index) {
             toolkit.lockAWT();
             try {
@@ -144,6 +147,7 @@
             }
         }
 
+        @Override
         public int getAccessibleChildrenCount() {
             toolkit.lockAWT();
             try {
@@ -249,7 +253,7 @@
     public void remove(int index) {
         toolkit.lockAWT();
         try {
-            Component comp = (Component) children.get(index);
+            Component comp = children.get(index);
 
             if (layout != null) {
                 layout.removeLayoutComponent(comp);
@@ -275,30 +279,33 @@
         }
     }
 
+    @Override
     public void list(PrintWriter out, int indent) {
         toolkit.lockAWT();
         try {
             super.list(out, indent);
             for (int i=0; i < children.size(); i++) {
-                ((Component) children.get(i)).list(out, 2 * indent);
+                children.get(i).list(out, 2 * indent);
             }
         } finally {
             toolkit.unlockAWT();
         }
     }
 
+    @Override
     public void list(PrintStream out, int indent) {
         toolkit.lockAWT();
         try {
             super.list(out, indent);
             for (int i=0; i < children.size(); i++) {
-                ((Component) children.get(i)).list(out, 2 * indent);
+                children.get(i).list(out, 2 * indent);
             }
         } finally {
             toolkit.unlockAWT();
         }
     }
 
+    @Override
     public void print(Graphics g) {
         toolkit.lockAWT();
         try {
@@ -319,6 +326,7 @@
         }
     }
 
+    @Override
     public void update(Graphics g) {
         toolkit.lockAWT();
         try {
@@ -348,7 +356,7 @@
     }
 
     private void removeFromContainer(int index) {
-        Component comp = (Component) children.get(index);
+        Component comp = children.get(index);
 
         comp.prepare4HierarchyChange();
 
@@ -415,18 +423,20 @@
         }
     }
 
+    @Override
     public void addNotify() {
         toolkit.lockAWT();
         try {
             super.addNotify();
             for (int i=0; i < children.size(); i++) {
-                ((Component) children.get(i)).addNotify();
+                children.get(i).addNotify();
             }
         } finally {
             toolkit.unlockAWT();
         }
     }
 
+    @Override
     public void addPropertyChangeListener(PropertyChangeListener listener) {
         toolkit.lockAWT();
         try {
@@ -436,6 +446,7 @@
         }
     }
 
+    @Override
     public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
         toolkit.lockAWT();
         try {
@@ -445,18 +456,20 @@
         }
     }
 
+    @Override
     public void applyComponentOrientation(ComponentOrientation o) {
         toolkit.lockAWT();
         try {
             super.applyComponentOrientation(o);
             for (int i = 0; i < children.size(); i++) {
-                ((Component)children.get(i)).applyComponentOrientation(o);
+                children.get(i).applyComponentOrientation(o);
             }
         } finally {
             toolkit.unlockAWT();
         }
     }
 
+    @Override
     public boolean areFocusTraversalKeysSet(int id) {
         toolkit.lockAWT();
         try {
@@ -469,6 +482,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public int countComponents() {
         toolkit.lockAWT();
         try {
@@ -481,6 +495,9 @@
     /**
      * @deprecated
      */
+    @SuppressWarnings("deprecation")
+    @Deprecated
+    @Override
     public void deliverEvent(Event evt) {
 
         Component comp = getComponentAt(evt.x, evt.y);
@@ -493,6 +510,7 @@
 
     }
 
+    @Override
     public void doLayout() {
         toolkit.lockAWT();
         try {
@@ -529,7 +547,7 @@
             //have to traverse children manually
 
             for (int i = 0; i <  children.size(); i++) {
-                c = (Component) children.get(i);
+                c = children.get(i);
                 if (!c.isVisible()) {
                     continue;
                 }
@@ -552,6 +570,7 @@
         }
     }
 
+    @Override
     public float getAlignmentX() {
         toolkit.lockAWT();
         try {
@@ -565,6 +584,7 @@
         }
     }
 
+    @Override
     public float getAlignmentY() {
         toolkit.lockAWT();
         try {
@@ -581,12 +601,13 @@
     public Component getComponent(int n) throws ArrayIndexOutOfBoundsException {
         toolkit.lockAWT();
         try {
-            return (Component) children.get(n);
+            return children.get(n);
         } finally {
             toolkit.unlockAWT();
         }
     }
 
+    @Override
     public Component getComponentAt(Point p) {
         toolkit.lockAWT();
         try {
@@ -596,6 +617,7 @@
         }
     }
 
+    @Override
     public Component getComponentAt(int x, int y) {
         toolkit.lockAWT();
         try {
@@ -617,13 +639,14 @@
     public Component[] getComponents() {
         toolkit.lockAWT();
         try {
-            return (Component[]) children.toArray(new Component[0]);
+            return children.toArray(new Component[0]);
         } finally {
             toolkit.unlockAWT();
         }
     }
 
-    public Set getFocusTraversalKeys(int id) {
+    @Override
+    public Set<?> getFocusTraversalKeys(int id) {
         toolkit.lockAWT();
         try {
             return super.getFocusTraversalKeys(id);
@@ -649,6 +672,7 @@
         }
     }
 
+    @Override
     public Insets getInsets() {
         toolkit.lockAWT();
         try {
@@ -682,6 +706,7 @@
                 h - insets.top - insets.bottom);
     }
 
+    @Override
     public Dimension getMinimumSize() {
         toolkit.lockAWT();
         try {
@@ -694,6 +719,9 @@
     /**
      * @deprecated
      */
+    @SuppressWarnings("deprecation")
+    @Deprecated
+    @Override
     public Dimension minimumSize() {
         toolkit.lockAWT();
         try {
@@ -703,6 +731,7 @@
         }
     }
 
+    @Override
     Dimension getDefaultMinimumSize() {
         if (layout == null) {
             return null;
@@ -713,6 +742,7 @@
         return minimumLayoutSize;
     }
 
+    @Override
     public Dimension getPreferredSize() {
         toolkit.lockAWT();
         try {
@@ -725,6 +755,9 @@
     /**
      * @deprecated
      */
+    @SuppressWarnings("deprecation")
+    @Deprecated
+    @Override
     public Dimension preferredSize() {
         toolkit.lockAWT();
         try {
@@ -734,6 +767,7 @@
         }
     }
 
+    @Override
     Dimension getDefaultPreferredSize() {
         if (layout == null) {
             return null;
@@ -744,25 +778,26 @@
         return preferredLayoutSize;
     }
 
+    @Override
     public Dimension getMaximumSize() {
         toolkit.lockAWT();
         try {
             if (!isMaximumSizeSet() && (layout != null) && (layout instanceof LayoutManager2)) {
                 return ((LayoutManager2) layout).maximumLayoutSize(this);
-            } else {
-                return super.getMaximumSize();
             }
+            return super.getMaximumSize();
         } finally {
             toolkit.unlockAWT();
         }
     }
 
+    @Override
     void resetDefaultSize() {
         minimumLayoutSize = null;
         preferredLayoutSize = null;
 
         for (int i=0; i < children.size(); i++) {
-            Component c = (Component)children.get(i);
+            Component c = children.get(i);
             c.resetDefaultSize();
         }
     }
@@ -771,6 +806,7 @@
     /**
      * @deprecated
      */
+    @Deprecated
     public Insets insets() {
         toolkit.lockAWT();
         try {
@@ -802,6 +838,7 @@
         }
     }
 
+    @Override
     public boolean isFocusCycleRoot(Container container) {
         toolkit.lockAWT();
         try {
@@ -835,6 +872,8 @@
     /**
      * @deprecated
      */
+    @Deprecated
+    @Override
     public void layout() {
         toolkit.lockAWT();
         try {
@@ -849,6 +888,8 @@
     /**
      * @deprecated
      */
+    @Deprecated
+    @Override
     public Component locate(int x, int y) {
         toolkit.lockAWT();
         try {
@@ -861,7 +902,7 @@
     Component locateImpl(int x, int y) {
 //        return topmost child containing point - search from index 0
         for (int i = 0; i <  children.size(); i++) {
-            Component c = (Component) children.get(i);
+            Component c = children.get(i);
             if ( c.contains(x-c.getX(), y-c.getY()) ) {
                 return c;
             }
@@ -872,13 +913,15 @@
         return null;
     }
 
+    @Override
     void setRedrawManager () {
         super.setRedrawManager();
         for (int i = 0; i < children.size(); i++) {
-            ((Component) children.get(i)).setRedrawManager();
+            children.get(i).setRedrawManager();
         }
     }
 
+    @Override
     public void paint(Graphics g) {
         toolkit.lockAWT();
         try {
@@ -890,7 +933,7 @@
 
     void propagateRepaint(long tm, int x, int y, int width, int height) {
         for (int i = 0; i < children.size(); i++) {
-            Component comp = (Component) children.get(i);
+            Component comp = children.get(i);
 
             if (comp.isLightweight()) {
                 comp.repaint(tm, x - comp.x, y - comp.y, width, height);
@@ -898,6 +941,7 @@
         }
     }
 
+    @Override
     protected String paramString() {
         /* The format is based on 1.5 release behavior 
          * which can be revealed by the following code:
@@ -938,7 +982,7 @@
         Shape clip = g.getClip();
 
         for (int i = children.size() - 1; i >= 0; i--) {
-            Component comp = (Component) children.get(i);
+            Component comp = children.get(i);
 
             if (comp.isLightweight() && comp.isVisible()) {
                 if (!clip.intersects(comp.getBounds())) {
@@ -959,13 +1003,14 @@
         return g;
     }
 
+    @Override
     public void removeNotify() {
         toolkit.lockAWT();
         try {
             isRemoved = true;
 //            moveFocusOnHide();
             for (int i=0; i < children.size(); i++) {
-                ((Component) children.get(i)).removeNotify();
+                children.get(i).removeNotify();
             }
             super.removeNotify();
         } finally {
@@ -987,6 +1032,7 @@
                 focusCycleRoot);
     }
 
+    @Override
     public void setFocusTraversalKeys(int id, Set keystrokes) {
         toolkit.lockAWT();
         try {
@@ -1008,6 +1054,7 @@
         firePropertyChange("focusTraversalPolicy", oldPolicy, policy);
     }
 
+    @Override
     public void setFont(Font f) {
         toolkit.lockAWT();
         try {
@@ -1017,21 +1064,23 @@
         }
     }
 
+    @Override
     void setFontImpl(Font f) {
         super.setFontImpl(f);
 
         for (int i = 0; i < children.size(); i++) {
-            ((Component)children.get(i)).propagateFont();
+            children.get(i).propagateFont();
         }
     }
 
+    @Override
     boolean propagateFont() {
         if (!super.propagateFont()) {
             return false;
         }
 
         for (int i = 0; i < children.size(); i++) {
-            ((Component) children.get(i)).propagateFont();
+            children.get(i).propagateFont();
         }
         return true;
     }
@@ -1040,14 +1089,14 @@
         toolkit.lockAWT();
         try {
             if (layout != null) {
-                for (Iterator i = children.iterator(); i.hasNext(); ){
-                    layout.removeLayoutComponent((Component) i.next());
+                for (Component component : children) {
+                    layout.removeLayoutComponent(component);
                 }
             }
 
             if (mgr != null) {
-                for (Iterator i = children.iterator(); i.hasNext(); ){
-                    mgr.addLayoutComponent(null, (Component) i.next());
+                for (Component component : children) {
+                    mgr.addLayoutComponent(null, component);
                 }
             }
 
@@ -1058,6 +1107,7 @@
         }
     }
 
+    @Override
     public void transferFocusBackward() {
         toolkit.lockAWT();
         try {
@@ -1087,6 +1137,7 @@
         }
     }
 
+    @Override
     public void invalidate() {
         toolkit.lockAWT();
         try {
@@ -1099,6 +1150,7 @@
         }
     }
 
+    @Override
     public void validate() {
         toolkit.lockAWT();
         try {
@@ -1119,7 +1171,7 @@
         toolkit.lockAWT();
         try {
             for (int i = 0; i < children.size(); i++) {
-                Component c = (Component) children.get(i);
+                Component c = children.get(i);
                 if (!c.isValid()) {
                     c.validate();
                 }
@@ -1129,14 +1181,16 @@
         }
     }
 
+    @Override
     void mapToDisplay(boolean b) {
         super.mapToDisplay(b);
         //map to display from bottom to top, to get right initial Z-order
         for (int i = children.size() - 1; i >= 0 ; i--) {
-            ((Component) children.get(i)).mapToDisplay(b);
+            children.get(i).mapToDisplay(b);
         }
     }
 
+    @Override
     void moveFocusOnHide() {
         Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
         if (focusOwner != null && isAncestorOf(focusOwner)) {
@@ -1145,30 +1199,34 @@
         super.moveFocus();
     }
 
+    @Override
     void prepareChildren4HierarchyChange() {
         for (int i = 0; i < children.size(); i++) {
-            ((Component) children.get(i)).prepare4HierarchyChange();
+            children.get(i).prepare4HierarchyChange();
         }
     }
 
+    @Override
     void finishChildrenHierarchyChange(Component changed, Container changedParent,
             int ancestorFlags)
     {
         for (int i = 0; i < children.size(); i++) {
-            ((Component) children.get(i)).finishHierarchyChange(changed, changedParent,
+            children.get(i).finishHierarchyChange(changed, changedParent,
                     ancestorFlags);
         }
     }
 
+    @Override
     void postHierarchyBoundsEvents(Component changed, int id) {
         super.postHierarchyBoundsEvents(changed, id);
 
         spreadHierarchyBoundsEvents(changed, id);
     }
 
+    @Override
     void spreadHierarchyBoundsEvents(Component changed, int id) {
         for (int i = 0; i < children.size(); i++) {
-            ((Component) children.get(i)).postHierarchyBoundsEvents(changed, id);
+            children.get(i).postHierarchyBoundsEvents(changed, id);
         }
     }
 
@@ -1199,19 +1257,20 @@
 //        }
     }
 
-    public EventListener[] getListeners(Class listenerType) {
+    @Override
+    public EventListener[] getListeners(Class<?> listenerType) {
 //        toolkit.lockAWT();
 //        try {
             if (ContainerListener.class.isAssignableFrom(listenerType)) {
                 return getContainerListeners();
-            } else {
-                return super.getListeners(listenerType);
             }
+            return super.getListeners(listenerType);
 //        } finally {
 //            toolkit.unlockAWT();
 //        }
     }
 
+    @Override
     protected void processEvent(AWTEvent e) {
 //        toolkit.lockAWT();
 //        try {
@@ -1228,7 +1287,7 @@
     protected void processContainerEvent(ContainerEvent e) {
 //        toolkit.lockAWT();
 //        try {
-            for (Iterator i = containerListeners.getUserIterator(); i.hasNext();) {
+            for (Iterator<?> i = containerListeners.getUserIterator(); i.hasNext();) {
                 ContainerListener listener = (ContainerListener) i.next();
 
                 switch (e.getID()) {
@@ -1269,9 +1328,9 @@
                     return false;
                 }
 
-                Vector children = container.children;
+                Vector<Component> children = container.children;
                 for (int i = 0; i <  children.size(); i++) {
-                    c = (Component) children.get(i);
+                    c = children.get(i);
                     if (!c.isVisible()) {
                         continue;
                     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/ContainerOrderFocusTraversalPolicy.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/ContainerOrderFocusTraversalPolicy.java?view=diff&rev=441863&r1=441862&r2=441863
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/ContainerOrderFocusTraversalPolicy.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/ContainerOrderFocusTraversalPolicy.java Sat Sep  9 14:56:46 2006
@@ -42,6 +42,7 @@
         }
     }
 
+    @Override
     public Component getComponentAfter(Container aContainer, Component aComponent) {
         toolkit.lockAWT();
         try {
@@ -76,6 +77,7 @@
         }
     }
 
+    @Override
     public Component getComponentBefore(Container aContainer, Component aComponent) {
         toolkit.lockAWT();
         try {
@@ -137,7 +139,7 @@
         }
         Component curComp = comp;
         while ((curComp != null)) {
-            Container parent = (Container) curComp.getRealParent();
+            Container parent = curComp.getRealParent();
             if ((parent != null) && parent.isFocusTraversalPolicyProvider()) {
                 return parent;
             }
@@ -146,6 +148,7 @@
         return null;
     }
 
+    @Override
     public Component getDefaultComponent(Container container) {
         toolkit.lockAWT();
         try {
@@ -155,6 +158,7 @@
         }
     }
 
+    @Override
     public Component getFirstComponent(Container container) {
         toolkit.lockAWT();
         try {
@@ -278,7 +282,7 @@
         if (root == null || comp == null) {
             return null;
         }
-        Container parent = (Container) comp.getRealParent();
+        Container parent = comp.getRealParent();
         if (parent == null) {
             parent = (Container) comp;
         }
@@ -380,7 +384,7 @@
     private Component getCompAfterContainer(Container container) {
         Container parent = container;
         while (parent != null) {
-            parent = (Container) container.getRealParent();
+            parent = container.getRealParent();
             Component nextComp = getComp(parent, container, true);
             if (nextComp != null) {
                 return nextComp;
@@ -425,6 +429,7 @@
         return ((idx >= 0) && (idx < container.getComponentCount()));
     }
 
+    @Override
     public Component getLastComponent(Container container) {
         toolkit.lockAWT();
         try {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Cursor.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Cursor.java?view=diff&rev=441863&r1=441862&r2=441863
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Cursor.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Cursor.java Sat Sep  9 14:56:46 2006
@@ -65,7 +65,7 @@
     /**
      * A mapping from names to system custom cursors
      */
-    static Map/*<String, Cursor>*/ systemCustomCursors;
+    static Map<String, Cursor> systemCustomCursors;
     static Properties cursorProps;
 
     static final String[] predefinedNames = {
@@ -112,6 +112,7 @@
         image = img;
     }
 
+    @Override
     protected void finalize() throws Throwable {
         if (nativeCursor != null) {
             nativeCursor.destroyCursor();
@@ -122,6 +123,7 @@
         return name;
     }
 
+    @Override
     public String toString() {
         return getClass().getName() + "[" + name + "]";
     }
@@ -154,9 +156,9 @@
     throws AWTException {
         loadCursorProps();
         if (systemCustomCursors == null) {
-            systemCustomCursors = new HashMap();
+            systemCustomCursors = new HashMap<String, Cursor>();
         }
-        Cursor cursor = (Cursor) systemCustomCursors.get(name);
+        Cursor cursor = systemCustomCursors.get(name);
         if (cursor != null) {
             return cursor;
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/DefaultFocusTraversalPolicy.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/DefaultFocusTraversalPolicy.java?view=diff&rev=441863&r1=441862&r2=441863
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/DefaultFocusTraversalPolicy.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/DefaultFocusTraversalPolicy.java Sat Sep  9 14:56:46 2006
@@ -27,6 +27,7 @@
     public DefaultFocusTraversalPolicy() {
     }
 
+    @Override
     protected boolean accept(Component comp) {
         toolkit.lockAWT();
         try {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/DefaultKeyboardFocusManager.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/DefaultKeyboardFocusManager.java?view=diff&rev=441863&r1=441862&r2=441863
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/DefaultKeyboardFocusManager.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/DefaultKeyboardFocusManager.java Sat Sep  9 14:56:46 2006
@@ -24,6 +24,7 @@
 import java.awt.event.InputEvent;
 import java.awt.event.KeyEvent;
 import java.awt.event.WindowEvent;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Set;
@@ -45,19 +46,19 @@
     public DefaultKeyboardFocusManager() {
         toolkit.lockAWT();
         try {
-            Set forSet = new HashSet();
+            Set<AWTKeyStroke> forSet = new HashSet<AWTKeyStroke>();
             forSet.add(AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB, 0));
             forSet.add(AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB,
                                                     InputEvent.CTRL_DOWN_MASK));
             setDefaultFocusTraversalKeys(FORWARD_TRAVERSAL_KEYS, forSet);
-            Set backSet= new HashSet();
+            Set<AWTKeyStroke> backSet= new HashSet<AWTKeyStroke>();
             backSet.add(AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB,
                                                      InputEvent.SHIFT_DOWN_MASK));
             backSet.add(AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB,
                                                      InputEvent.SHIFT_DOWN_MASK |
                                                      InputEvent.CTRL_DOWN_MASK));
             setDefaultFocusTraversalKeys(BACKWARD_TRAVERSAL_KEYS, backSet);
-            Set emptySet = java.util.Collections.EMPTY_SET;
+            Set<AWTKeyStroke> emptySet = Collections.emptySet();
             setDefaultFocusTraversalKeys(UP_CYCLE_TRAVERSAL_KEYS, emptySet);
             setDefaultFocusTraversalKeys(DOWN_CYCLE_TRAVERSAL_KEYS, emptySet);
         } finally {
@@ -65,6 +66,7 @@
         }
     }
 
+    @Override
     protected void dequeueKeyEvents(long a0, Component a1) {
         toolkit.lockAWT();
         try {
@@ -75,6 +77,7 @@
         }
     }
 
+    @Override
     protected void discardKeyEvents(Component a0) {
         toolkit.lockAWT();
         try {
@@ -85,6 +88,7 @@
         }
     }
 
+    @Override
     public boolean dispatchEvent(AWTEvent e) {
         if (e instanceof KeyEvent) {
             KeyEvent ke = (KeyEvent) e;
@@ -102,7 +106,7 @@
     private boolean preProcessKeyEvent(KeyEvent ke) {
         // first pass event to every key event dispatcher:
         if (keyEventDispatchers != null) {
-            Iterator it = keyEventDispatchers.getUserIterator();
+            Iterator<?> it = keyEventDispatchers.getUserIterator();
             while (it.hasNext()) {
                 KeyEventDispatcher ked = (KeyEventDispatcher)it.next();
                 if (ked.dispatchKeyEvent(ke)) {
@@ -357,6 +361,7 @@
 
     }
 
+    @Override
     public boolean dispatchKeyEvent(KeyEvent e) {
         boolean doRedispatch = false;
         toolkit.lockAWT();
@@ -376,6 +381,7 @@
         return true; // no further dispatching
     }
 
+    @Override
     public void downFocusCycle(Container aContainer) {
         toolkit.lockAWT();
         try {
@@ -387,6 +393,7 @@
         }
     }
 
+    @Override
     protected void enqueueKeyEvents(long a0, Component a1) {
         toolkit.lockAWT();
         try {
@@ -397,6 +404,7 @@
         }
     }
 
+    @Override
     public void focusNextComponent(Component aComponent) {
         toolkit.lockAWT();
         try {
@@ -408,6 +416,7 @@
         }
     }
 
+    @Override
     public void focusPreviousComponent(Component aComponent) {
         toolkit.lockAWT();
         try {
@@ -419,10 +428,11 @@
         }
     }
 
+    @Override
     public boolean postProcessKeyEvent(KeyEvent ke) {
         // pass event to every key event postprocessor:
         if (keyEventPostProcessors != null) {
-            Iterator it = keyEventPostProcessors.getUserIterator();
+            Iterator<?> it = keyEventPostProcessors.getUserIterator();
             while (it.hasNext()) {
                 KeyEventPostProcessor kep = (KeyEventPostProcessor) it.next();
                 if (kep.postProcessKeyEvent(ke)) {
@@ -452,6 +462,7 @@
         }
     }
 
+    @Override
     public void processKeyEvent(Component focusedComponent, KeyEvent e) {
         toolkit.lockAWT();
         try {
@@ -461,10 +472,10 @@
             Container container = ((focusedComponent instanceof Container) ?
                                    (Container)focusedComponent :
                                    null);
-            Set back = focusedComponent.getFocusTraversalKeys(BACKWARD_TRAVERSAL_KEYS);
-            Set forward = focusedComponent.getFocusTraversalKeys(FORWARD_TRAVERSAL_KEYS);
-            Set up = focusedComponent.getFocusTraversalKeys(UP_CYCLE_TRAVERSAL_KEYS);
-            Set down = (((container != null) && container.isFocusCycleRoot()) ?
+            Set<?> back = focusedComponent.getFocusTraversalKeys(BACKWARD_TRAVERSAL_KEYS);
+            Set<?> forward = focusedComponent.getFocusTraversalKeys(FORWARD_TRAVERSAL_KEYS);
+            Set<?> up = focusedComponent.getFocusTraversalKeys(UP_CYCLE_TRAVERSAL_KEYS);
+            Set<?> down = (((container != null) && container.isFocusCycleRoot()) ?
                         container.getFocusTraversalKeys(DOWN_CYCLE_TRAVERSAL_KEYS) :
                         null);
 
@@ -498,7 +509,7 @@
      * (i. e. not of type KEY_TYPED) from sets contains a keystroke
      * with same code (or char) & modifiers as e
      */
-    private void consume(KeyEvent e, Set[] sets) {
+    private void consume(KeyEvent e, Set<?>[] sets) {
         int keyCode = e.getKeyCode();
         int mod = (e.getModifiersEx() | e.getModifiers());
         boolean codeDefined = (keyCode != KeyEvent.VK_UNDEFINED);
@@ -512,13 +523,10 @@
             }
             return;
         }
-        for (int i = 0; i < sets.length; i++) {
-            Set s = sets[i];
+        for (Set<?> s : sets) {
             if (s != null) {
-                AWTKeyStroke[] keys =
-                    (AWTKeyStroke[])s.toArray(new AWTKeyStroke[0]);
-                for (int j = 0; j < keys.length; j++) {
-                    AWTKeyStroke key = keys[j];
+                AWTKeyStroke[] keys = s.toArray(new AWTKeyStroke[0]);
+                for (AWTKeyStroke key : keys) {
                     if ( (key.getKeyCode() == keyCode) &&
                          (key.getModifiers() == mod) ) {
                         e.consume();
@@ -537,6 +545,7 @@
         consumeKeyTyped = false;
     }
 
+    @Override
     public void upFocusCycle(Component aComponent) {
         toolkit.lockAWT();
         try {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/DefaultMouseDragGestureRecognizer.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/DefaultMouseDragGestureRecognizer.java?view=diff&rev=441863&r1=441862&r2=441863
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/DefaultMouseDragGestureRecognizer.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/DefaultMouseDragGestureRecognizer.java Sat Sep  9 14:56:46 2006
@@ -38,10 +38,12 @@
         events = new ArrayList();
     }
 
+    @Override
     public void mousePressed(MouseEvent e) {
         events.add(e);
     }
 
+    @Override
     public void mouseDragged(MouseEvent e) {
         if (active) {
             return;
@@ -57,6 +59,7 @@
         }
     }
     
+    @Override
     public void mouseReleased(MouseEvent e) {
         active = false;
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Dialog.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Dialog.java?view=diff&rev=441863&r1=441862&r2=441863
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Dialog.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Dialog.java Sat Sep  9 14:56:46 2006
@@ -42,6 +42,7 @@
             restoreActive = active;
             super.runModalLoop();
         }
+        @Override
         public void endModalLoop() {
             if (restoreActive != null) {
                 restoreActive.toFront();
@@ -54,6 +55,7 @@
     protected class AccessibleAWTDialog extends AccessibleAWTWindow {
         private static final long serialVersionUID = 4837230331833941201L;
 
+        @Override
         public AccessibleStateSet getAccessibleStateSet() {
             toolkit.lockAWT();
             try {
@@ -67,6 +69,7 @@
             }
         }
 
+        @Override
         public AccessibleRole getAccessibleRole() {
             toolkit.lockAWT();
             try {
@@ -167,6 +170,7 @@
         }
     }
 
+    @Override
     protected String paramString() {
         toolkit.lockAWT();
         try {
@@ -176,6 +180,7 @@
         }
     }
 
+    @Override
     public void dispose() {
         toolkit.lockAWT();
         try {
@@ -188,6 +193,7 @@
         }
     }
 
+    @Override
     public void addNotify() {
         toolkit.lockAWT();
         try {
@@ -197,6 +203,7 @@
         }
     }
 
+    @Override
     public AccessibleContext getAccessibleContext() {
         toolkit.lockAWT();
         try {
@@ -206,6 +213,7 @@
         }
     }
 
+    @Override
     public void hide() {
         toolkit.lockAWT();
         try {
@@ -224,6 +232,7 @@
         }
     }
     
+    @Override
     public void show() {
         showImpl();
     }
@@ -254,6 +263,7 @@
         }
     }
 
+    @Override
     public String getTitle() {
         toolkit.lockAWT();
         try {
@@ -272,6 +282,7 @@
         }
     }
 
+    @Override
     public boolean isResizable() {
         toolkit.lockAWT();
         try {
@@ -281,6 +292,7 @@
         }
     }
 
+    @Override
     public boolean isUndecorated() {
         toolkit.lockAWT();
         try {
@@ -297,8 +309,9 @@
                 return;
             }
 
-            if(isVisible())
+            if(isVisible()) {
                 throw new IllegalComponentStateException("Cannot change the modality while the dialog is visible");
+            }
 
             modalContext = modal ? new DialogModalContext() : null;
         } finally {
@@ -306,6 +319,7 @@
         }
     }
 
+    @Override
     public void setResizable(boolean resizable) {
         toolkit.lockAWT();
         try {
@@ -316,10 +330,12 @@
     }
 
 
+    @Override
     public void setTitle(String title) {
         super.setTitle(title);
     }
 
+    @Override
     public void setUndecorated(boolean undecorated) {
         toolkit.lockAWT();
         try {
@@ -330,7 +346,7 @@
     }
 
     private void showModal() {
-        Collection otherWindows;
+        Collection<Window> otherWindows;
         Window active;
         toolkit.lockAWT();
         try {
@@ -345,9 +361,9 @@
         enableOtherWindows(otherWindows);
     }
 
-    private Collection disableOtherWindows() {
-        Iterator i = toolkit.windows.iterator();
-        LinkedList result = new LinkedList();
+    private Collection<Window> disableOtherWindows() {
+        Iterator<?> i = toolkit.windows.iterator();
+        LinkedList<Window> result = new LinkedList<Window>();
         while(i.hasNext()) {
             Object obj = i.next();
             if(obj instanceof Window) {
@@ -362,23 +378,26 @@
         return result;
     }
 
-    private void enableOtherWindows(Collection disabledWindows) {
-        Iterator i = disabledWindows.iterator();
+    private void enableOtherWindows(Collection<Window> disabledWindows) {
+        Iterator<Window> i = disabledWindows.iterator();
         while (i.hasNext()) {
-            Window w = (Window)i.next();
+            Window w = i.next();
             w.setEnabled(true);
         }
     }
 
+    @Override
     AccessibleContext createAccessibleContext() {
         return new AccessibleAWTDialog();
     }
 
+    @Override
     String autoName() {
         int number = toolkit.autoNumber.nextDialog++;
         return "dialog" + Integer.toString(number);
     }
 
+    @Override
     Color getDefaultBackground() {
         return SystemColor.control;
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Dimension.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Dimension.java?view=diff&rev=441863&r1=441862&r2=441863
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Dimension.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Dimension.java Sat Sep  9 14:56:46 2006
@@ -44,6 +44,7 @@
         setSize(width, height);
     }
 
+    @Override
     public int hashCode() {
         HashCode hash = new HashCode();
         hash.append(width);
@@ -51,6 +52,7 @@
         return hash.hashCode();
     }
 
+    @Override
     public boolean equals(Object obj) {
         if (obj == this) {
             return true;
@@ -62,6 +64,7 @@
         return false;
     }
 
+    @Override
     public String toString() {
         // The output format based on 1.5 release behaviour. It could be obtained in the following way
         // System.out.println(new Dimension().toString())
@@ -77,6 +80,7 @@
         setSize(d.width, d.height);
     }
 
+    @Override
     public void setSize(double width, double height) {
         setSize((int)Math.round(width), (int)Math.round(height));
     }
@@ -85,10 +89,12 @@
         return new Dimension(width, height);
     }
 
+    @Override
     public double getHeight() {
         return height;
     }
 
+    @Override
     public double getWidth() {
         return width;
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Dispatcher.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Dispatcher.java?view=diff&rev=441863&r1=441862&r2=441863
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Dispatcher.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Dispatcher.java Sat Sep  9 14:56:46 2006
@@ -21,6 +21,7 @@
 
 import java.awt.event.ComponentEvent;
 import java.awt.event.FocusEvent;
+import java.awt.event.InputEvent;
 import java.awt.event.KeyEvent;
 import java.awt.event.MouseEvent;
 import java.awt.event.PaintEvent;
@@ -251,7 +252,7 @@
                 if (focusProxyOwner == null) {
                     return false;
                 }
-                src = KeyboardFocusManager.getCurrentKeyboardFocusManager().actualFocusOwner;
+                src = KeyboardFocusManager.actualFocusOwner;
             }
 
             EventQueue eventQueue = toolkit.getSystemEventQueueImpl();
@@ -426,11 +427,11 @@
                     syntheticGrabOwner = lastSyntheticGrabOwner;
                     syntheticGrabDepth = 0;
                     int mask = event.getInputModifiers();
-                    syntheticGrabDepth += (mask & MouseEvent.BUTTON1_DOWN_MASK) != 0 ? 1
+                    syntheticGrabDepth += (mask & InputEvent.BUTTON1_DOWN_MASK) != 0 ? 1
                             : 0;
-                    syntheticGrabDepth += (mask & MouseEvent.BUTTON2_DOWN_MASK) != 0 ? 1
+                    syntheticGrabDepth += (mask & InputEvent.BUTTON2_DOWN_MASK) != 0 ? 1
                             : 0;
-                    syntheticGrabDepth += (mask & MouseEvent.BUTTON3_DOWN_MASK) != 0 ? 1
+                    syntheticGrabDepth += (mask & InputEvent.BUTTON3_DOWN_MASK) != 0 ? 1
                             : 0;
                 }
             }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/DisplayMode.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/DisplayMode.java?view=diff&rev=441863&r1=441862&r2=441863
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/DisplayMode.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/DisplayMode.java Sat Sep  9 14:56:46 2006
@@ -58,21 +58,27 @@
     *
     ***************************************************************************/
 
+    @Override
     public boolean equals(Object dm) {
-        if (dm instanceof DisplayMode)
+        if (dm instanceof DisplayMode) {
             return equals((DisplayMode)dm);
+        }
         return false;
     }
 
     public boolean equals(DisplayMode dm) {
-        if (dm.bitDepth != bitDepth)
+        if (dm.bitDepth != bitDepth) {
             return false;
-        if (dm.refreshRate != refreshRate)
+        }
+        if (dm.refreshRate != refreshRate) {
             return false;
-        if (dm.width != width)
+        }
+        if (dm.width != width) {
             return false;
-        if (dm.height != height)
+        }
+        if (dm.height != height) {
             return false;
+        }
         return true;
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/EmbeddedWindow.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/EmbeddedWindow.java?view=diff&rev=441863&r1=441862&r2=441863
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/EmbeddedWindow.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/EmbeddedWindow.java Sat Sep  9 14:56:46 2006
@@ -42,6 +42,7 @@
         h = bounds.height;
     }
 
+    @Override
     ComponentBehavior createBehavior() {
         return new EmbeddedBehavior();
     }
@@ -56,6 +57,7 @@
             super(EmbeddedWindow.this);
         }
 
+        @Override
         protected NativeWindow createNativeWindow() {
             return toolkit.createEmbeddedNativeWindow(EmbeddedWindow.this);
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Event.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Event.java?view=diff&rev=441863&r1=441862&r2=441863
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Event.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Event.java Sat Sep  9 14:56:46 2006
@@ -190,6 +190,7 @@
         this.arg = arg;
     }
 
+    @Override
     public String toString() {
         /* The format is based on 1.5 release behavior 
          * which can be revealed by the following code:

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/EventDispatchThread.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/EventDispatchThread.java?view=diff&rev=441863&r1=441862&r2=441863
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/EventDispatchThread.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/EventDispatchThread.java Sat Sep  9 14:56:46 2006
@@ -39,6 +39,7 @@
     /**
      * Initialise and run the main event loop
      */
+    @Override
     public void run() {
         nativeQueue = toolkit.getNativeEventQueue();
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/EventQueueCore.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/EventQueueCore.java?view=diff&rev=441863&r1=441862&r2=441863
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/EventQueueCore.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/EventQueueCore.java Sat Sep  9 14:56:46 2006
@@ -24,7 +24,6 @@
 import java.awt.event.InputMethodEvent;
 import java.awt.event.InvocationEvent;
 import java.awt.event.MouseEvent;
-import java.util.Iterator;
 import java.util.LinkedList;
 
 /**
@@ -32,8 +31,8 @@
  */
 final class EventQueueCore {
     
-    private final LinkedList queueStack = new LinkedList();
-    private final LinkedList events = new LinkedList();
+    private final LinkedList<EventQueue> queueStack = new LinkedList<EventQueue>();
+    private final LinkedList<AWTEvent> events = new LinkedList<AWTEvent>();
     
     private Toolkit toolkit;
     private EventQueue activeQueue;
@@ -102,19 +101,17 @@
         while (events.isEmpty()) {
             wait();
         }
-        AWTEvent event = (AWTEvent)events.removeFirst();
+        AWTEvent event = events.removeFirst();
         // TODO: add event coalescing
         return event;
     }    
     
     synchronized AWTEvent peekEvent() {
-        return events.isEmpty() ? null : (AWTEvent)events.getFirst();
+        return events.isEmpty() ? null : events.getFirst();
     }
     
     synchronized AWTEvent peekEvent(int id) {
-        for (Iterator it = events.iterator(); it.hasNext(); ) {
-            AWTEvent event = (AWTEvent) it.next();
-
+        for (AWTEvent event : events) {
             if (event.getID() == id) {
                 return event;
             }
@@ -198,11 +195,11 @@
     }
     
     synchronized void pop() {
-        EventQueue removed = (EventQueue)queueStack.removeLast();
+        EventQueue removed = queueStack.removeLast();
         if (removed != activeQueue) {
             throw new IllegalStateException("Event queue stack is broken");
         }
-        activeQueue = (EventQueue)queueStack.getLast();
+        activeQueue = queueStack.getLast();
         removed.setCore(null);
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/EventQueueThread.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/EventQueueThread.java?view=diff&rev=441863&r1=441862&r2=441863
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/EventQueueThread.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/EventQueueThread.java Sat Sep  9 14:56:46 2006
@@ -40,6 +40,7 @@
         setDaemon(false);
     }
 
+    @Override
     public void run() {
         while (!core.isEmpty(1000)) {
             try {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/FileDialog.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/FileDialog.java?view=diff&rev=441863&r1=441862&r2=441863
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/FileDialog.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/FileDialog.java Sat Sep  9 14:56:46 2006
@@ -100,6 +100,7 @@
         }
     }
 
+    @Override
     protected String paramString() {
         /* The format is based on 1.5 release behavior 
          * which can be revealed by the following code:
@@ -116,6 +117,7 @@
         }
     }
 
+    @Override
     public void addNotify() {
         toolkit.lockAWT();
         try {
@@ -193,20 +195,24 @@
     }
 
 
+    @Override
     void showImpl() {
         if (toolkit.theme.showFileDialog(this)) {
             super.showImpl();
         }
     }
 
+    @Override
     void hideImpl() {
         if (toolkit.theme.hideFileDialog(this)) {        
             super.hideImpl();
         }
     }
     
+    @Override
     ComponentBehavior createBehavior() {
         return new HWBehavior(this) {
+            @Override
             public void removeNotify() {
                 super.removeNotify();
                 hideImpl();                
@@ -214,6 +220,7 @@
         };
     }
     
+    @Override
     String autoName() {
         return "filedlg" + toolkit.autoNumber.nextFileDialog++;
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/FlowLayout.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/FlowLayout.java?view=diff&rev=441863&r1=441862&r2=441863
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/FlowLayout.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/FlowLayout.java Sat Sep  9 14:56:46 2006
@@ -75,6 +75,7 @@
         }
     }
 
+    @Override
     public String toString() {
         /* The format is based on 1.5 release behavior 
          * which can be revealed by the following code:
@@ -156,16 +157,14 @@
         Rectangle clientRect = target.getClient();
         Insets insets = target.getInsets();
         boolean l2r = target.getComponentOrientation().isLeftToRight();
-        ArrayList rowComponents = new ArrayList();
+        ArrayList<Component> rowComponents = new ArrayList<Component>();
         int initW = 2 * hGap;
         int w = initW;
         int y = insets.top + vGap;
         int maxH = 0;
         boolean first = true;
 
-        for (Iterator i = getComponentsZOrder(target).iterator(); i.hasNext(); ) {
-            Component component = (Component)i.next();
-
+        for (Component component : getComponentsZOrder(target)) {
             if ((component == null) || !component.isVisible()) {
                 continue;
             }
@@ -251,7 +250,7 @@
         }
     }
 
-    private void layoutRow(ArrayList rowComponents, int freeW, int x, int y,
+    private void layoutRow(ArrayList<Component> rowComponents, int freeW, int x, int y,
                            int maxH, boolean l2r) {
         x += hGap;
         switch (alignment) {
@@ -274,7 +273,7 @@
 
         int lastInd = rowComponents.size() - 1;
         for (int i = 0; i <= lastInd ; i++) {
-            Component c = (Component)rowComponents.get(l2r ? i : lastInd - i);
+            Component c = rowComponents.get(l2r ? i : lastInd - i);
             Dimension d = c.getPreferredSize();
             c.setBounds(x, y + (maxH - d.height) / 2, d.width, d.height);
             x += d.width + hGap;
@@ -298,9 +297,7 @@
         int w = hGap;
         int maxH = 0;
 
-        for (int i = 0; i < components.length; i++) {
-            Component component = components[i];
-
+        for (Component component : components) {
             if (component.isVisible()) {
                 Dimension cd = preferred ?
                         component.getPreferredSize() :
@@ -313,17 +310,15 @@
         return new Dimension(w, maxH + 2 * vGap);
     }
 
-    private ArrayList getComponentsZOrder(Container target) {
+    private ArrayList<Component> getComponentsZOrder(Container target) {
         int capacity = target.getComponentCount();
-        ArrayList zComponents = new ArrayList(capacity);
+        ArrayList<Component> zComponents = new ArrayList<Component>(capacity);
 
         for (int i = 0; i < capacity; i++) {
             zComponents.add(null);
         }
 
-        for (int i = 0; i < components.length; i++) {
-            Component component = components[i];
-
+        for (Component component : components) {
             if (component.getParent() == target) {
                 zComponents.set(target.getComponentZOrder(component), component);
             }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/FocusDispatcher.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/FocusDispatcher.java?view=diff&rev=441863&r1=441862&r2=441863
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/FocusDispatcher.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/FocusDispatcher.java Sat Sep  9 14:56:46 2006
@@ -44,7 +44,7 @@
     }
 
     boolean dispatch(Component src, NativeEvent event) {
-        int id = (int) event.getEventId();
+        int id = event.getEventId();
         long opositeId = event.getOtherWindowId();
         long srcId = event.getWindowId();
         boolean focusGained = (id == FocusEvent.FOCUS_GAINED);
@@ -127,12 +127,12 @@
                                   Component other) {
         KeyboardFocusManager kfm =
             KeyboardFocusManager.getCurrentKeyboardFocusManager();
-        Component focusOwner = kfm.actualFocusOwner;
+        Component focusOwner = KeyboardFocusManager.actualFocusOwner;
 
         // change wnd/oppositeWnd to Java focused window
         // if focusProxy is losing focus:
 
-        Window focusedWindow = kfm.actualFocusedWindow;
+        Window focusedWindow = KeyboardFocusManager.actualFocusedWindow;
 
         if (!focusGained && isFocusProxy &&
             (focusedWindow != null)) {



Mime
View raw message