< prev index next >

src/java.desktop/windows/classes/sun/awt/windows/WDesktopProperties.java

Print this page




 224                 return true;
 225             }
 226             try {
 227                 return winEventName.equals(((WinPlaySound)o).winEventName);
 228             } catch (Exception e) {
 229                 return false;
 230             }
 231         }
 232 
 233         public int hashCode() {
 234             return winEventName.hashCode();
 235         }
 236     }
 237 
 238     /*
 239      * Called by WToolkit when Windows settings change-- we (re)load properties and
 240      * set new values.
 241      */
 242     @SuppressWarnings("unchecked")
 243     synchronized Map<String, Object> getProperties() {
 244         ThemeReader.flush();
 245 
 246         // load the changed properties into a new hashmap
 247         map = new HashMap<String, Object>();
 248         getWindowsParameters();
 249         map.put(SunToolkit.DESKTOPFONTHINTS, SunToolkit.getDesktopFontHints());
 250         map.put(PROP_NAMES, getKeyNames());
 251         // DnD uses one value for x and y drag diff, but Windows provides
 252         // separate ones.  For now, just use the x value - rnk
 253         map.put("DnD.Autoscroll.cursorHysteresis", map.get("win.drag.x"));
 254 











 255         return (Map<String, Object>) map.clone();
 256     }
 257 
 258     /*
 259      * This returns the value for the desktop property "awt.font.desktophints"
 260      * It builds this using the Windows desktop properties to return
 261      * them as platform independent hints.
 262      * This requires that the Windows properties have already been gathered
 263      * and placed in "map"
 264      */
 265     synchronized RenderingHints getDesktopAAHints() {
 266 
 267         /* Equate "DEFAULT" to "OFF", which it is in our implementation.
 268          * Doing this prevents unnecessary pipeline revalidation where
 269          * the value OFF is detected as a distinct value by SunGraphics2D
 270          */
 271         Object fontSmoothingHint = VALUE_TEXT_ANTIALIAS_DEFAULT;
 272         Integer fontSmoothingContrast = null;
 273 
 274         Boolean smoothingOn = (Boolean)map.get("win.text.fontSmoothingOn");




 224                 return true;
 225             }
 226             try {
 227                 return winEventName.equals(((WinPlaySound)o).winEventName);
 228             } catch (Exception e) {
 229                 return false;
 230             }
 231         }
 232 
 233         public int hashCode() {
 234             return winEventName.hashCode();
 235         }
 236     }
 237 
 238     /*
 239      * Called by WToolkit when Windows settings change-- we (re)load properties and
 240      * set new values.
 241      */
 242     @SuppressWarnings("unchecked")
 243     synchronized Map<String, Object> getProperties() {
 244         Map<String, Object> prev = map==null?null:new HashMap<>(map);
 245         
 246         // load the changed properties into a new hashmap
 247         map = new HashMap<String, Object>();
 248         getWindowsParameters();
 249         map.put(SunToolkit.DESKTOPFONTHINTS, SunToolkit.getDesktopFontHints());
 250         map.put(PROP_NAMES, getKeyNames());
 251         // DnD uses one value for x and y drag diff, but Windows provides
 252         // separate ones.  For now, just use the x value - rnk
 253         map.put("DnD.Autoscroll.cursorHysteresis", map.get("win.drag.x"));
 254 
 255         // if ThemeReader.flush() always called on windowSettingChange, 
 256         // for some reason many windowSettingChange event would be generated on
 257         // window resize, and it would decrease rendering performance while 
 258         // resizing a window. so only flush the ThemeReader if there are changed
 259         // properties. 
 260         if(prev == null || 
 261                 !prev.keySet().equals(map.keySet()) ||
 262                 !Arrays.deepEquals(prev.values().toArray(), map.values().toArray())) {
 263             ThemeReader.flush();
 264         }
 265         
 266         return (Map<String, Object>) map.clone();
 267     }
 268 
 269     /*
 270      * This returns the value for the desktop property "awt.font.desktophints"
 271      * It builds this using the Windows desktop properties to return
 272      * them as platform independent hints.
 273      * This requires that the Windows properties have already been gathered
 274      * and placed in "map"
 275      */
 276     synchronized RenderingHints getDesktopAAHints() {
 277 
 278         /* Equate "DEFAULT" to "OFF", which it is in our implementation.
 279          * Doing this prevents unnecessary pipeline revalidation where
 280          * the value OFF is detected as a distinct value by SunGraphics2D
 281          */
 282         Object fontSmoothingHint = VALUE_TEXT_ANTIALIAS_DEFAULT;
 283         Integer fontSmoothingContrast = null;
 284 
 285         Boolean smoothingOn = (Boolean)map.get("win.text.fontSmoothingOn");


< prev index next >