harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r465981 [3/3] - in /incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java: common/org/apache/harmony/awt/im/ common/org/apache/harmony/awt/nativebridge/ common/org/apache/harmony/awt/state/ common/org/apache/harmony/awt/text/ ...
Date Fri, 20 Oct 2006 04:23:24 GMT
Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinEvent.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinEvent.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinEvent.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinEvent.java
Thu Oct 19 21:23:21 2006
@@ -29,10 +29,8 @@
 import java.awt.event.InputEvent;
 import java.awt.event.KeyEvent;
 import java.awt.event.MouseEvent;
-import java.awt.event.MouseWheelEvent;
 import java.awt.event.PaintEvent;
 import java.awt.event.WindowEvent;
-
 import org.apache.harmony.awt.gl.MultiRectArea;
 import org.apache.harmony.awt.nativebridge.Int8Pointer;
 import org.apache.harmony.awt.nativebridge.NativeBridge;
@@ -62,11 +60,13 @@
 
     private final WinWindowFactory factory;
 
+    @Override
     public boolean getTrigger() {
         return ((eventId == MouseEvent.MOUSE_RELEASED)
                 && (mouseButton == MouseEvent.BUTTON3));
     }
 
+    @Override
     public MultiRectArea getClipRects() {
         if (clipRgn == null) {
             Insets insets = factory.getInsets(windowId);
@@ -100,6 +100,7 @@
         return clipRgn;
     }
 
+    @Override
     public Rectangle getClipBounds() {
         if (clipRect == null) {
             getClipRects();
@@ -107,6 +108,7 @@
         return clipRect;
     }
 
+    @Override
     public Rectangle getWindowRect() {
         if (windowRect == null) {
             windowRect = factory.getWindowBounds(windowId);
@@ -114,10 +116,12 @@
         return windowRect;
     }
 
+    @Override
     public Insets getInsets() {
         return factory.getInsets(windowId);
     }
 
+    @Override
     public char getLastChar() {
         return lastChar;
     }
@@ -188,6 +192,7 @@
         }
     }
     
+    @Override
     public String toString() {
         return "hwnd=0x" + Long.toHexString(windowId) + ", msg=0x" + Integer.toHexString(msg);
     }
@@ -422,9 +427,8 @@
         if (winVKey == VK_SHIFT) {
             if (((((int) lParam) >> 16) & 0xff) == win32.MapVirtualKeyW(VK_SHIFT,
0)) {
                 return KeyEvent.KEY_LOCATION_LEFT;
-            } else {
-                return KeyEvent.KEY_LOCATION_RIGHT;
             }
+            return KeyEvent.KEY_LOCATION_RIGHT;
         }
         if (((winVKey >= VK_NUMPAD0) && (winVKey <= VK_NUMPAD9))
                 || (winVKey == VK_NUMLOCK) || (winVKey == VK_DECIMAL)
@@ -460,7 +464,7 @@
             factory.lastHwndUnderPointer = 0;
         } else {
             setMouseEventIDAndButton();
-            if (eventId == MouseWheelEvent.MOUSE_WHEEL) {
+            if (eventId == MouseEvent.MOUSE_WHEEL) {
                 wheelRotation = computeMouseWheelRotation();
                 screenPos = computeMouseWheelScreenPosition();
             } else {
@@ -568,7 +572,7 @@
                     MouseEvent.MOUSE_DRAGGED : MouseEvent.MOUSE_MOVED;
             break;
         case WM_MOUSEWHEEL:
-            eventId = MouseWheelEvent.MOUSE_WHEEL;
+            eventId = MouseEvent.MOUSE_WHEEL;
             break;
         }
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinEventQueue.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinEventQueue.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinEventQueue.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinEventQueue.java
Thu Oct 19 21:23:21 2006
@@ -47,9 +47,9 @@
     static final ObjectAccessor objAccessor = AccessorFactory.getObjectAccessor();
 
     /**
-     * Invisible auxlitary window for service messages
+     * Invisible auxiliary window for service messages
      */
-    private long javaWindow;
+    private final long javaWindow;
     /**
      * Theme handles currently open
      */
@@ -79,7 +79,7 @@
      * Keycodes and characters stored 
      * until WM_KEYUP or WM_SYSKEYUP message is received 
      */
-    private final HashMap keyCodeToChar = new HashMap();
+    private final HashMap<Integer, Character> keyCodeToChar = new HashMap<Integer,
Character>();
 
     final WinWindowFactory factory;
 
@@ -92,10 +92,10 @@
     public static final int WM_PERFORM_TASK = WindowsDefs.WM_USER + 1;
     public static final int WM_PERFORM_LATER = WindowsDefs.WM_USER + 2;
 
-    private LinkedList preprocessors = new LinkedList();
+    private final LinkedList<Preprocessor> preprocessors = new LinkedList<Preprocessor>();
 
     /**
-     * Initialize message pump, create auxlitary window for service messages 
+     * Initialize message pump, create auxiliary window for service messages 
      * @param systemProperties
      */
     public WinEventQueue(WinSystemProperties systemProperties) {
@@ -116,6 +116,7 @@
      * may occur while waiting
      * @return false when WM_QUIT received
      */
+    @Override
     public boolean waitEvent() {
         win32.GetMessageW(lastMsg, 0, 0, 0);
 
@@ -123,9 +124,10 @@
     }
 
     /**
-     * Post the service message to the auxlitary window to ensure
+     * Post the service message to the auxiliary window to ensure
      * the method waitEvent() will leave the waiting state
      */
+    @Override
     public void awake() {
         if (win32.GetCurrentThreadId() != dispatchThreadID) {
             win32.PostThreadMessageW(dispatchThreadID, WinEvent.WM_AWAKE, 0, 0);
@@ -217,7 +219,7 @@
 
     private boolean handleEvent(long hwnd, int msg, long wParam, long lParam) {
         if (msg == WindowsDefs.WM_KEYUP || msg == WindowsDefs.WM_SYSKEYUP) {
-            Character ch = (Character)keyCodeToChar.remove(new Integer((int)wParam));
+            Character ch = keyCodeToChar.remove(new Integer((int)wParam));
             if (ch != null) {
                 lastChar = ch.charValue();
             } else {
@@ -266,8 +268,8 @@
             objAccessor.releaseGlobalReference(lParam);
             return true;
         }
-        for (Iterator i = preprocessors.iterator(); i.hasNext(); ) {
-            if (((Preprocessor) i.next()).preprocess(hwnd, msg, wParam, lParam, result))
{
+        for (Iterator<Preprocessor> i = preprocessors.iterator(); i.hasNext(); ) {
+            if (i.next().preprocess(hwnd, msg, wParam, lParam, result)) {
                 return true;
             }
         }
@@ -421,6 +423,7 @@
         return true;
     }
 
+    @Override
     public long getJavaWindow() {
         return javaWindow;
     }
@@ -438,7 +441,7 @@
      * The Windows theme handles currently open, and their names
      */
     public class ThemeMap {
-        private final HashMap themes = new HashMap();
+        private final HashMap<String, Long> themes = new HashMap<String, Long>();
         private boolean enabled;
 
         ThemeMap() {
@@ -446,12 +449,12 @@
         }
 
         public long get(String name) {
-            Long obj = (Long)themes.get(name);
+            Long obj = themes.get(name);
             if (obj != null) {
                 return obj.longValue();
             }
             long hTheme = open(name);
-            themes.put(new Long(hTheme), name);
+            themes.put(name, new Long(hTheme));
             return hTheme;
         }
 
@@ -469,14 +472,14 @@
         void refresh() {
             enabled = (win32.IsThemeActive() != 0);
 
-            for (Iterator it = themes.entrySet().iterator(); it.hasNext();) {
-                Map.Entry e = (Map.Entry)it.next();
-                long hTheme = ((Long)e.getValue()).longValue();
+            for (Iterator<Map.Entry<String, Long>> it = themes.entrySet().iterator();
it.hasNext();) {
+                Map.Entry<String, Long> e = it.next();
+                long hTheme = e.getValue().longValue();
                 if (hTheme != 0) {
                     win32.CloseThemeData(hTheme);
                 }
                 if (enabled) {
-                    hTheme = open((String)e.getKey());
+                    hTheme = open(e.getKey());
                 } else {
                     hTheme = 0;
                 }
@@ -485,6 +488,7 @@
         }
     }
 
+    @Override
     public void dispatchEvent() {
         if (lastMsg.get_hwnd() == 0) {
             processThreadMessage(lastMsg);
@@ -494,12 +498,14 @@
         win32.DispatchMessageW(lastMsg);
     }
 
+    @Override
     public void performTask(Task task) {
         long ref = objAccessor.getGlobalReference(task);
         win32.SendMessageW(javaWindow, WM_PERFORM_TASK, 0, ref);
         objAccessor.releaseGlobalReference(ref);
     }
 
+    @Override
     public void performLater(Task task) {
         long ref = objAccessor.getGlobalReference(task);
         win32.PostMessageW(javaWindow, WM_PERFORM_LATER, 0, ref);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinIM.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinIM.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinIM.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinIM.java
Thu Oct 19 21:23:21 2006
@@ -45,9 +45,9 @@
     
     private static final NativeBridge nb = NativeBridge.getInstance();
     private static final Win32 win32 = Win32.getInstance();
-    private static WinWindowFactory wwf = (WinWindowFactory) ContextStorage.getWindowFactory();
-    private static HashMap hkl2Locale = new HashMap();;
-    private static HashMap locale2HKL = new HashMap();
+    private static final WinWindowFactory wwf = (WinWindowFactory) ContextStorage.getWindowFactory();
+    private static final HashMap<Long, Locale> hkl2Locale = new HashMap<Long, Locale>();;
+    private static final HashMap<Locale, Long> locale2HKL = new HashMap<Locale,
Long>();
     private Locale curLocale; // last locale set by user
     private long hIMC; // private native input context handle
     private long defaultIMC;
@@ -55,6 +55,7 @@
     
     WinIM() {
         WinEventQueue.Task task = new WinEventQueue.Task() {
+            @Override
             public void perform() {
                 hIMC = win32.ImmCreateContext();
             }
@@ -62,6 +63,7 @@
         wwf.eventQueue.performTask(task);
     }
 
+    @Override
     public Locale[] getAvailableLocales() throws AWTException {
         int nBuff = win32.GetKeyboardLayoutList(0, null);
         PointerPointer buffPtr = nb.createPointerPointer(nBuff, false);
@@ -71,15 +73,17 @@
             hkl2Locale(hkl);
         }
         
-        return (Locale[]) locale2HKL.keySet().toArray(new Locale[0]);
+        return locale2HKL.keySet().toArray(new Locale[0]);
     }
     
+    @Override
     public boolean setLocale(final Locale locale) {
         if (getLocale().equals(locale)) {
             curLocale = locale;
             return true;
         }
         WinEventQueue.Task task = new WinEventQueue.Task () {
+            @Override
             public void perform() {
                 long hkl = locale2HKL(locale);
                 int flags = 0;
@@ -95,9 +99,11 @@
         return result;
     }
     
+    @Override
     public Locale getLocale() {
        
         WinEventQueue.Task task = new WinEventQueue.Task () {
+            @Override
             public void perform() {
                 returnValue =  new Long(win32.GetKeyboardLayout(0));                
             }
@@ -125,7 +131,7 @@
     private static Locale hkl2Locale(long hkl) {
         Long key = new Long(hkl);
         if (hkl2Locale.containsKey(key)) {
-            return (Locale) hkl2Locale.get(key);
+            return hkl2Locale.get(key);
         }
         short langid = (short) hkl;
         short sortid = WindowsDefs.SORT_DEFAULT;        
@@ -149,7 +155,7 @@
         // lcid from locale name
         // maybe have to call getAvailableLocales()
         // before to update map(?)
-        Long hkl = (Long) locale2HKL.get(locale);
+        Long hkl = locale2HKL.get(locale);
         if (hkl != null) {
             return hkl.longValue();
         }
@@ -160,15 +166,18 @@
      * Must create new instance of this IM for
      * every instance of input context
      */
+    @Override
     public InputMethod createInputMethod() throws Exception {
         return new WinIM();
     }
     
+    @Override
     public void activate() {
         // reassociate focused window with
         // default native input context
         // if IME was previously disabled
         WinEventQueue.Task task = new WinEventQueue.Task() {
+            @Override
             public void perform() {
                 final long hwnd = win32.GetFocus();
                 if (hwnd == 0l) {
@@ -322,12 +331,15 @@
         return win32.ImmSetCompositionWindow(hIMC, form);
     }
     
+    @Override
     public void removeNotify() {
         disableIME();
     }
     
+    @Override
     public void dispose() {
         WinEventQueue.Task task = new WinEventQueue.Task() {
+            @Override
             public void perform() {
                 win32.ImmDestroyContext(hIMC);
             }
@@ -339,8 +351,10 @@
      * Disables native input method support for the
      * focused window
      */
+    @Override
     public void disableIME() {        
         WinEventQueue.Task task = new WinEventQueue.Task () {
+            @Override
             public void perform() {
                 final long hwnd = win32.GetFocus();
                 long curIMC = win32.ImmGetContext(hwnd); 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinRobot.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinRobot.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinRobot.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinRobot.java
Thu Oct 19 21:23:21 2006
@@ -250,6 +250,7 @@
         return bmi;
     }
 
+    @Override
     protected void finalize() throws Throwable {
         super.finalize();
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinSystemProperties.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinSystemProperties.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinSystemProperties.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinSystemProperties.java
Thu Oct 19 21:23:21 2006
@@ -27,7 +27,6 @@
 import java.awt.im.InputMethodHighlight;
 import java.util.Map;
 import java.util.TreeSet;
-
 import org.apache.harmony.awt.ComponentInternals;
 import org.apache.harmony.awt.nativebridge.Int16Pointer;
 import org.apache.harmony.awt.nativebridge.NativeBridge;
@@ -49,7 +48,7 @@
     private static final int SPI_GETFONTSMOOTHINGCONTRAST = 0x200C;
     private static final int SPI_SETFONTSMOOTHINGCONTRAST = 0x200D;
 
-    private static int sysColorIndices[] = {    // SystemColor.* constants
+    private static final int sysColorIndices[] = {    // SystemColor.* constants
             WindowsDefs.COLOR_DESKTOP,          // 0 DESKTOP
             WindowsDefs.COLOR_ACTIVECAPTION,    // 1 ACTIVE_CAPTION
             WindowsDefs.COLOR_CAPTIONTEXT,      // 2 ACTIVE_CAPTION_TEXT
@@ -84,7 +83,7 @@
             WindowsDefs.COLOR_MENUBAR,
     };
     
-    private static String sysColorProps[] = { // color property names
+    private static final String sysColorProps[] = { // color property names
             "win.desktop.backgroundColor", // 0 DESKTOP
             "win.frame.activeCaptionColor", // 1 ACTIVE_CAPTION
             "win.frame.captionTextColor", // 2 ACTIVE_CAPTION_TEXT
@@ -120,7 +119,7 @@
     };
 
     
-    private static int sysFontIndices[] = {
+    private static final int sysFontIndices[] = {
 
         WindowsDefs.ANSI_FIXED_FONT, 
         WindowsDefs.ANSI_VAR_FONT,                                           
@@ -132,7 +131,7 @@
     
     };
     
-    private static String sysFontDesktopProps[] = { // color property names
+    private static final String sysFontDesktopProps[] = { // color property names
             "win.ansiFixed.font", // 0 ANSI_FIXED_FONT
             "win.ansiVar.font", // 1 ANSI_VAR_FONT
             "win.defaultGUI.font", // 2 DEFAULT_GUI_FONT
@@ -154,18 +153,20 @@
                                WindowsDefs.SND_NODEFAULT);
             // have to start another thread to wait until playing ends
             new Thread() {
+                @Override
                 public void run() {                    
                     win32.PlaySoundW(sndName, 0, flags);
                 }
             }.start();
         }
         
+        @Override
         public String toString() {
             return ("WinPlaySound(" + sndName + ")");
         }
     };
     
-    private int sysColorCache[] = null;
+    private int sysColorCache[];
 
     private Font defaultFont;
 
@@ -202,7 +203,7 @@
         }
     }
 
-    private void updateColorDesktopProperties(Map props) {
+    private void updateColorDesktopProperties(Map<String, Object> props) {
         for (int i = 0; i < sysColorIndices.length; i++) {
             String name = sysColorProps[i];
             Color val = new Color(sysColorCache[i]);
@@ -211,7 +212,7 @@
         }
     }
 
-    private void setDesktopProperty(String name, Object val, Map props) {
+    private void setDesktopProperty(String name, Object val, Map<String, Object> props)
{
         if (props != null) {
             props.put(name, val);
             return; // skip firing property change
@@ -246,7 +247,7 @@
         return new Font(name, bold | italic, size);
     }
     
-    private void initSysFonts(Map props) {
+    private void initSysFonts(Map<String, Object> props) {
         for (int i = 0; i < sysFontIndices.length; i++) {
             long hFont = win32.GetStockObject(sysFontIndices[i]);            
             Font font = getFont(hFont);
@@ -257,21 +258,23 @@
         }       
     }
     
-    private void setBoolProperty(String propName, int val, Map props) {
+    private void setBoolProperty(String propName, int val, Map<String, Object> props)
{
         setDesktopProperty(propName, (val != 0 ? Boolean.TRUE : Boolean.FALSE),
                            props);
     }
 
-    private void setIntProperty(String propName, int val, Map props) {
+    private void setIntProperty(String propName, int val, Map<String, Object> props)
{
         setDesktopProperty(propName, new Integer(val), props);
     }
     
-    private void setFontProperty(String propName, Font font, Map props) {
+    private void setFontProperty(String propName, Font font, Map<String, Object> props)
{
         setDesktopProperty(propName, font, props);
         setIntProperty(propName + ".height", font.getSize(), props);
     }
 
-    public void init(Map desktopProperties) {
+    @SuppressWarnings("unchecked")
+    public void init(Map<String, ?> deskProps) {
+        Map<String, Object> desktopProperties = (Map<String, Object>)deskProps;
         synchronized (cacheLock) {
             getDnDProps(desktopProperties);
             getShellProps(desktopProperties);
@@ -295,9 +298,9 @@
             getFontSmoothType(desktopProperties);
             getXPTheme(desktopProperties);
             initSoundProps(desktopProperties);
-            TreeSet keySet = new TreeSet(desktopProperties.keySet());
+            TreeSet<String> keySet = new TreeSet<String>(desktopProperties.keySet());
             keySet.add("awt.dynamicLayoutSupported");
-            String[] propNames = (String[]) keySet.toArray(new String[0]);            
+            String[] propNames = keySet.toArray(new String[0]);            
             desktopProperties.put("win.propNames", propNames);
             
         }
@@ -348,49 +351,49 @@
         
     }
     
-    private void getFullWindowDrags(Map props) {        
+    private void getFullWindowDrags(Map<String, Object> props) {        
         getBoolSPI("win.frame.fullWindowDragsOn", 
                    WindowsDefs.SPI_GETDRAGFULLWINDOWS, props);
         
     }
     
-    private void getGradientCaptions(Map props) {        
+    private void getGradientCaptions(Map<String, Object> props) {        
         getBoolSPI("win.frame.captionGradientsOn", 
                    WindowsDefs.SPI_GETGRADIENTCAPTIONS, props);        
     }
     
-    private void getHotTracking(Map props) {        
+    private void getHotTracking(Map<String, Object> props) {        
         getBoolSPI("win.item.hotTrackingOn", 
                    WindowsDefs.SPI_GETHOTTRACKING, props);        
     }
     
-    private void getKeyboardCues(Map props) {        
+    private void getKeyboardCues(Map<String, Object> props) {        
         getBoolSPI("win.menu.keyboardCuesOn", 
                    WindowsDefs.SPI_GETKEYBOARDCUES, props);        
     }
     
-    private void getFontSmooth(Map props) {        
+    private void getFontSmooth(Map<String, Object> props) {        
         getBoolSPI("win.text.fontSmoothingOn", 
                    WindowsDefs.SPI_GETFONTSMOOTHING, props);        
     }
     
-    private void getFontSmoothContrast(Map props) {
+    private void getFontSmoothContrast(Map<String, Object> props) {
         getIntSPI("win.text.fontSmoothingContrast",
                   SPI_GETFONTSMOOTHINGCONTRAST, props);
     }
     
-    private void getFontSmoothType(Map props) {
+    private void getFontSmoothType(Map<String, Object> props) {
         getIntSPI("win.text.fontSmoothingType", SPI_GETFONTSMOOTHINGTYPE, props);
     }
     
-    private void getDragSize(boolean cx, Map props) {
+    private void getDragSize(boolean cx, Map<String, Object> props) {
         int sm_idx = (cx ? WindowsDefs.SM_CXDRAG : WindowsDefs.SM_CYDRAG);
         String propName = "win.drag";
         propName += (cx ? ".width" : ".height");
         getSM(propName, sm_idx, props);
     }
 
-    private void getNonClientMetrics(Map props) {
+    private void getNonClientMetrics(Map<String, Object> props) {
         Win32.NONCLIENTMETRICSW ncm = win32.createNONCLIENTMETRICSW(false);
         ncm.set_cbSize(ncm.size());
         win32.SystemParametersInfoW(WindowsDefs.SPI_GETNONCLIENTMETRICS,
@@ -428,7 +431,7 @@
         setIntProperty("win.menu.height", ncm.get_iMenuHeight(), props);        
     }
     
-    private void getIconMetrics(Map props) {
+    private void getIconMetrics(Map<String, Object> props) {
         Win32.ICONMETRICSW im = win32.createICONMETRICSW(false);
         im.set_cbSize(im.size());
         win32.SystemParametersInfoW(WindowsDefs.SPI_GETICONMETRICS,
@@ -439,7 +442,7 @@
         setIntProperty("win.icon.vspacing", im.get_iVertSpacing(), props);
     }
     
-    private void getHighContrast(Map props) {
+    private void getHighContrast(Map<String, Object> props) {
         Win32.HIGHCONTRASTA hc = win32.createHIGHCONTRASTA(false);
         hc.set_cbSize(hc.size());
         win32.SystemParametersInfoW(WindowsDefs.SPI_GETHIGHCONTRAST,
@@ -449,7 +452,7 @@
                         props);
     }
     
-    private void getSM(String propName, int idx, Map props) {
+    private void getSM(String propName, int idx, Map<String, Object> props) {
         setIntProperty(propName, win32.GetSystemMetrics(idx), props);
     }
     
@@ -460,19 +463,19 @@
         return ptr;
     }
     
-    private void getBoolSPI(String propName, int idx, Map props) {
+    private void getBoolSPI(String propName, int idx, Map<String, Object> props) {
         setBoolProperty(propName, getIntSPI(idx).get(0), props);
     }
     
-    private void getIntSPI(String propName, int idx, Map props) {
+    private void getIntSPI(String propName, int idx, Map<String, Object> props) {
         setIntProperty(propName, getIntSPI(idx).get(0), props);
     }
     
-    void getXPTheme(Map props) {
+    void getXPTheme(Map<String, Object> props) {
         setBoolProperty("win.xpstyle.themeActive", win32.IsThemeActive(), props);
     }
     
-    private void getDnDProps(Map props) {
+    private void getDnDProps(Map<String, Object> props) {
         String propName = "DnD";
         setIntProperty(propName + ".gestureMotionThreshold",
                        WindowsDefs.DD_DEFDRAGMINDIST, props);
@@ -484,7 +487,7 @@
         
     }
     
-    private void getShellProps(Map props) {        
+    private void getShellProps(Map<String, Object> props) {        
         Win32.SHELLFLAGSTATE sfs = win32.createSHELLFLAGSTATE(false);
         int flags = (WindowsDefs.SSF_SHOWATTRIBCOL | 
                      WindowsDefs.SSF_SHOWALLOBJECTS);
@@ -496,7 +499,7 @@
                         (sfs.get_fShowAllObjects()), props);
     }
     
-    private void getMouseProps(Map props) {
+    private void getMouseProps(Map<String, Object> props) {
         String propName = "awt.";
         getSM(propName + "mouse.numButtons", WindowsDefs.SM_CMOUSEBUTTONS, props);
         setIntProperty(propName + "multiClickInterval", 
@@ -509,12 +512,12 @@
         
     }
     
-    private void setSoundProperty(String propName, String sndName, Map props) {
+    private void setSoundProperty(String propName, String sndName, Map<String, Object>
props) {
         String base = "win.sound.";
         setDesktopProperty(base + propName, new WinPlaySound(sndName), props);
     }
     
-    private void initSoundProps(Map props) {
+    private void initSoundProps(Map<String, Object> props) {
         setSoundProperty("asterisk", "SystemAsterisk", props);
         setSoundProperty("close", "Close", props);
         setSoundProperty("default", ".Default", props);
@@ -533,25 +536,27 @@
     
     }
 
-    public void mapInputMethodHighlight(InputMethodHighlight highlight, Map map) {
+    @SuppressWarnings("unchecked")
+    public void mapInputMethodHighlight(InputMethodHighlight highlight, Map<TextAttribute,
?> map) {
+        Map<TextAttribute, Object> _map = (Map<TextAttribute, Object>)map;
         TextAttribute key = TextAttribute.INPUT_METHOD_UNDERLINE;
         boolean selected = highlight.isSelected();
         switch(highlight.getState()) {
         case InputMethodHighlight.RAW_TEXT:
-            map.put(key, selected ? TextAttribute.UNDERLINE_LOW_GRAY :
+            _map.put(key, selected ? TextAttribute.UNDERLINE_LOW_GRAY :
                 TextAttribute.UNDERLINE_LOW_DOTTED);
             break;
         case InputMethodHighlight.CONVERTED_TEXT:
-            map.put(key, selected ? TextAttribute.UNDERLINE_LOW_ONE_PIXEL :
+            _map.put(key, selected ? TextAttribute.UNDERLINE_LOW_ONE_PIXEL :
                 TextAttribute.UNDERLINE_LOW_DOTTED);
             if (selected) {
                 // maybe get colors from system properties?
                 key = TextAttribute.BACKGROUND;
-                map.put(key, Color.white);
+                _map.put(key, Color.white);
                 key = TextAttribute.FOREGROUND;
-                map.put(key, new Color(0, 0, 128));
+                _map.put(key, new Color(0, 0, 128));
                 key = TextAttribute.SWAP_COLORS;
-                map.put(key, TextAttribute.SWAP_COLORS_ON);
+                _map.put(key, TextAttribute.SWAP_COLORS_ON);
             }
             break;
         }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinWTK.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinWTK.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinWTK.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinWTK.java
Thu Oct 19 21:23:21 2006
@@ -30,6 +30,7 @@
     /**
      * @see org.apache.harmony.awt.wtk.WTK#getGraphicsFactory()
      */
+    @Override
     public GraphicsFactory getGraphicsFactory() {
         return graphicsFactory;
     }
@@ -37,6 +38,7 @@
     /**
      * @see org.apache.harmony.awt.wtk.WTK#getNativeEventQueue()
      */
+    @Override
     public NativeEventQueue getNativeEventQueue() {
         return eventQueue;
     }
@@ -44,6 +46,7 @@
     /**
      * @see org.apache.harmony.awt.wtk.WTK#getWindowFactory()
      */
+    @Override
     public WindowFactory getWindowFactory() {
         return eventQueue.factory;
     }
@@ -51,6 +54,7 @@
     /**
      * @see org.apache.harmony.awt.wtk.WTK#getCursorFactory()
      */
+    @Override
     public CursorFactory getCursorFactory() {
         return cursorFactory;
     }
@@ -58,6 +62,7 @@
     /**
      * @see org.apache.harmony.awt.wtk.WTK#getNativeMouseInfo()
      */
+    @Override
     public NativeMouseInfo getNativeMouseInfo() {
         return mouseInfo;
     }
@@ -65,6 +70,7 @@
     /**
      * @see org.apache.harmony.awt.wtk.WTK#getSystemProperties()
      */
+    @Override
     public SystemProperties getSystemProperties() {
         return systemProperties;
     }
@@ -76,6 +82,7 @@
     /**
      * @see org.apache.harmony.awt.wtk.WTK#getNativeRobot(java.awt.GraphicsDevice)
      */
+    @Override
     public NativeRobot getNativeRobot(GraphicsDevice screen) {
         if (robot == null) {
             robot = new WinRobot();
@@ -83,6 +90,7 @@
         return robot;
     }
 
+    @Override
     public NativeIM getNativeIM() {
         if (im == null) {
             im = new WinIM();

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinWindow.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinWindow.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinWindow.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinWindow.java
Thu Oct 19 21:23:21 2006
@@ -106,6 +106,7 @@
 
     public void setVisible(final boolean visible) {
         WinEventQueue.Task task = new WinEventQueue.Task () {
+            @Override
             public void perform() {
                 int cmd;
                 if (visible) {
@@ -122,6 +123,7 @@
 
     public void setBounds(final int x, final int y, final int w, final int h, final int boundsMask)
{
         WinEventQueue.Task task = new WinEventQueue.Task () {
+            @Override
             public void perform() {
                 if (iconified || maximized) {
                     setNotNormalBounds(x, y, w, h, boundsMask);
@@ -200,6 +202,7 @@
 
     public void setEnabled(final boolean value) {
         WinEventQueue.Task task = new WinEventQueue.Task () {
+            @Override
             public void perform() {
                 win32.EnableWindow(hwnd, value ? 1 : 0);
             }
@@ -209,6 +212,7 @@
 
     public void dispose() {
         WinEventQueue.Task task = new WinEventQueue.Task () {
+            @Override
             public void perform() {
                 factory.remove(WinWindow.this);
                 win32.DestroyWindow(hwnd);
@@ -222,6 +226,7 @@
      */
     public void placeAfter(final NativeWindow w) {
         WinEventQueue.Task task = new WinEventQueue.Task () {
+            @Override
             public void perform() {
                 long hwndPrev = (w == null ? WindowsDefs.HWND_TOP : w.getId());
                 int flags = WindowsDefs.SWP_NOMOVE | WindowsDefs.SWP_NOSIZE;
@@ -233,6 +238,7 @@
 
     public void toFront() {
         WinEventQueue.Task task = new WinEventQueue.Task () {
+            @Override
             public void perform() {
                 int flags = WindowsDefs.SWP_NOMOVE | WindowsDefs.SWP_NOSIZE;
                 win32.SetWindowPos(hwnd, WindowsDefs.HWND_TOP, 0, 0, 0, 0, flags);
@@ -244,6 +250,7 @@
 
     public void toBack() {
         WinEventQueue.Task task = new WinEventQueue.Task () {
+            @Override
             public void perform() {
                 int flags = WindowsDefs.SWP_NOMOVE | WindowsDefs.SWP_NOSIZE;
                 win32.SetWindowPos(hwnd, WindowsDefs.HWND_BOTTOM, 0, 0, 0, 0, flags);
@@ -254,6 +261,7 @@
 
     public boolean setFocus(final boolean focus) {
         WinEventQueue.Task task = new WinEventQueue.Task () {
+            @Override
             public void perform() {
                 long res = win32.SetFocus(focus ? hwnd : 0);
                 returnValue = new Boolean(res != 0);
@@ -265,6 +273,7 @@
 
     public void setTitle(final String title) {
         WinEventQueue.Task task = new WinEventQueue.Task () {
+            @Override
             public void perform() {
                 win32.SetWindowTextW(hwnd, title);
             }
@@ -274,6 +283,7 @@
 
     public void setResizable(final boolean value) {
         WinEventQueue.Task task = new WinEventQueue.Task () {
+            @Override
             public void perform() {
                 modifyStyle(WindowsDefs.WS_SIZEBOX|WindowsDefs.WS_MAXIMIZEBOX, value);
             }
@@ -355,6 +365,7 @@
 
     public void setState(final int state) {
         WinEventQueue.Task task = new WinEventQueue.Task () {
+            @Override
             public void perform() {
                 if (state == Frame.NORMAL) {
                     win32.ShowWindow(hwnd, WindowsDefs.SW_SHOWNORMAL);
@@ -386,6 +397,7 @@
      */
     public void setIconImage(final Image image) {
         WinEventQueue.Task task = new WinEventQueue.Task () {
+            @Override
             public void perform() {
                 long hIcon = 0;
                 if (image != null) {
@@ -425,6 +437,7 @@
      */
     public void setAlwaysOnTop(final boolean value) {
         WinEventQueue.Task task = new WinEventQueue.Task () {
+            @Override
             public void perform() {
                 int hwndInsertAfter = (value ? WindowsDefs.HWND_TOPMOST : WindowsDefs.HWND_NOTOPMOST);
                 int flags = WindowsDefs.SWP_NOMOVE | WindowsDefs.SWP_NOSIZE |

Modified: incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinWindowFactory.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinWindowFactory.java?view=diff&rev=465981&r1=465980&r2=465981
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinWindowFactory.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/wtk/windows/WinWindowFactory.java
Thu Oct 19 21:23:21 2006
@@ -26,7 +26,7 @@
 import java.awt.Point;
 import java.awt.Rectangle;
 import java.util.HashMap;
-
+import java.util.Map;
 import org.apache.harmony.awt.nativebridge.NativeBridge;
 import org.apache.harmony.awt.nativebridge.windows.Win32;
 import org.apache.harmony.awt.nativebridge.windows.WindowsDefs;
@@ -40,7 +40,7 @@
     static final Win32 win32 = Win32.getInstance();
     static final NativeBridge bridge = NativeBridge.getInstance();
 
-    private final HashMap hwnd2winMap = new HashMap();
+    private final Map<Long, WinWindow> hwnd2winMap = new HashMap<Long, WinWindow>();
     private CreationParams creationParams = null;
 
     final WinEventQueue eventQueue;
@@ -57,6 +57,7 @@
 
     public NativeWindow createWindow(final CreationParams p) {
         WinEventQueue.Task task = new WinEventQueue.Task () {
+            @Override
             public void perform() {
                 String title = (p.name != null) ? p.name : "";
                 Rectangle rect = new Rectangle(p.x, p.y, p.w, p.h);
@@ -90,7 +91,7 @@
     }
 
     public NativeWindow getWindowById(long id) {
-        return (WinWindow)hwnd2winMap.get(new Long(id));
+        return hwnd2winMap.get(new Long(id));
     }
 
     /**
@@ -99,7 +100,7 @@
      * or null if given HWND doesn't belong to WTK
      */
     public WinWindow getWinWindowById(long id) {
-        return (WinWindow)hwnd2winMap.get(new Long(id));
+        return hwnd2winMap.get(new Long(id));
     }
 
     /**
@@ -361,7 +362,8 @@
      */
     public void setCaretPosition(final int x, final int y) {
         WinEventQueue.Task task = new WinEventQueue.Task () {
-           public void perform() {
+           @Override
+        public void perform() {
                 win32.SetCaretPos(x, y);
             }
         };



Mime
View raw message