< prev index next >

src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java

Print this page




 354         return new OSXPlatformFont(name, style);
 355     }
 356 
 357     @Override
 358     protected int getScreenHeight() {
 359         return GraphicsEnvironment.getLocalGraphicsEnvironment()
 360                 .getDefaultScreenDevice().getDefaultConfiguration().getBounds().height;
 361     }
 362 
 363     @Override
 364     protected int getScreenWidth() {
 365         return GraphicsEnvironment.getLocalGraphicsEnvironment()
 366                 .getDefaultScreenDevice().getDefaultConfiguration().getBounds().width;
 367     }
 368 
 369     @Override
 370     protected void initializeDesktopProperties() {
 371         super.initializeDesktopProperties();
 372         Map <Object, Object> fontHints = new HashMap<>();
 373         fontHints.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
 374         fontHints.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
 375         desktopProperties.put(SunToolkit.DESKTOPFONTHINTS, fontHints);
 376         desktopProperties.put("awt.mouse.numButtons", BUTTONS);
 377 
 378         // These DnD properties must be set, otherwise Swing ends up spewing NPEs
 379         // all over the place. The values came straight off of MToolkit.
 380         desktopProperties.put("DnD.Autoscroll.initialDelay", new Integer(50));
 381         desktopProperties.put("DnD.Autoscroll.interval", new Integer(50));
 382         desktopProperties.put("DnD.Autoscroll.cursorHysteresis", new Integer(5));
 383 
 384         desktopProperties.put("DnD.isDragImageSupported", new Boolean(true));
 385 
 386         // Register DnD cursors
 387         desktopProperties.put("DnD.Cursor.CopyDrop", new NamedCursor("DnD.Cursor.CopyDrop"));
 388         desktopProperties.put("DnD.Cursor.MoveDrop", new NamedCursor("DnD.Cursor.MoveDrop"));
 389         desktopProperties.put("DnD.Cursor.LinkDrop", new NamedCursor("DnD.Cursor.LinkDrop"));
 390         desktopProperties.put("DnD.Cursor.CopyNoDrop", new NamedCursor("DnD.Cursor.CopyNoDrop"));
 391         desktopProperties.put("DnD.Cursor.MoveNoDrop", new NamedCursor("DnD.Cursor.MoveNoDrop"));
 392         desktopProperties.put("DnD.Cursor.LinkNoDrop", new NamedCursor("DnD.Cursor.LinkNoDrop"));
 393     }
 394 




 354         return new OSXPlatformFont(name, style);
 355     }
 356 
 357     @Override
 358     protected int getScreenHeight() {
 359         return GraphicsEnvironment.getLocalGraphicsEnvironment()
 360                 .getDefaultScreenDevice().getDefaultConfiguration().getBounds().height;
 361     }
 362 
 363     @Override
 364     protected int getScreenWidth() {
 365         return GraphicsEnvironment.getLocalGraphicsEnvironment()
 366                 .getDefaultScreenDevice().getDefaultConfiguration().getBounds().width;
 367     }
 368 
 369     @Override
 370     protected void initializeDesktopProperties() {
 371         super.initializeDesktopProperties();
 372         Map <Object, Object> fontHints = new HashMap<>();
 373         fontHints.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
 374         fontHints.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB);
 375         desktopProperties.put(SunToolkit.DESKTOPFONTHINTS, fontHints);
 376         desktopProperties.put("awt.mouse.numButtons", BUTTONS);
 377 
 378         // These DnD properties must be set, otherwise Swing ends up spewing NPEs
 379         // all over the place. The values came straight off of MToolkit.
 380         desktopProperties.put("DnD.Autoscroll.initialDelay", new Integer(50));
 381         desktopProperties.put("DnD.Autoscroll.interval", new Integer(50));
 382         desktopProperties.put("DnD.Autoscroll.cursorHysteresis", new Integer(5));
 383 
 384         desktopProperties.put("DnD.isDragImageSupported", new Boolean(true));
 385 
 386         // Register DnD cursors
 387         desktopProperties.put("DnD.Cursor.CopyDrop", new NamedCursor("DnD.Cursor.CopyDrop"));
 388         desktopProperties.put("DnD.Cursor.MoveDrop", new NamedCursor("DnD.Cursor.MoveDrop"));
 389         desktopProperties.put("DnD.Cursor.LinkDrop", new NamedCursor("DnD.Cursor.LinkDrop"));
 390         desktopProperties.put("DnD.Cursor.CopyNoDrop", new NamedCursor("DnD.Cursor.CopyNoDrop"));
 391         desktopProperties.put("DnD.Cursor.MoveNoDrop", new NamedCursor("DnD.Cursor.MoveNoDrop"));
 392         desktopProperties.put("DnD.Cursor.LinkNoDrop", new NamedCursor("DnD.Cursor.LinkNoDrop"));
 393     }
 394 


< prev index next >