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_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB);
374 desktopProperties.put(SunToolkit.DESKTOPFONTHINTS, fontHints);
375 desktopProperties.put("awt.mouse.numButtons", BUTTONS);
376
377 // These DnD properties must be set, otherwise Swing ends up spewing NPEs
378 // all over the place. The values came straight off of MToolkit.
379 desktopProperties.put("DnD.Autoscroll.initialDelay", new Integer(50));
380 desktopProperties.put("DnD.Autoscroll.interval", new Integer(50));
381 desktopProperties.put("DnD.Autoscroll.cursorHysteresis", new Integer(5));
382
383 desktopProperties.put("DnD.isDragImageSupported", new Boolean(true));
384
385 // Register DnD cursors
386 desktopProperties.put("DnD.Cursor.CopyDrop", new NamedCursor("DnD.Cursor.CopyDrop"));
387 desktopProperties.put("DnD.Cursor.MoveDrop", new NamedCursor("DnD.Cursor.MoveDrop"));
388 desktopProperties.put("DnD.Cursor.LinkDrop", new NamedCursor("DnD.Cursor.LinkDrop"));
389 desktopProperties.put("DnD.Cursor.CopyNoDrop", new NamedCursor("DnD.Cursor.CopyNoDrop"));
390 desktopProperties.put("DnD.Cursor.MoveNoDrop", new NamedCursor("DnD.Cursor.MoveNoDrop"));
391 desktopProperties.put("DnD.Cursor.LinkNoDrop", new NamedCursor("DnD.Cursor.LinkNoDrop"));
392 }
393
394 @Override
395 protected boolean syncNativeQueue(long timeout) {
396 return nativeSyncQueue(timeout);
397 }
398
399 @Override
400 public native void beep();
401
402 @Override
403 public int getScreenResolution() throws HeadlessException {
|
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_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB);
374 desktopProperties.put(SunToolkit.DESKTOPFONTHINTS, fontHints);
375 desktopProperties.put("awt.mouse.numButtons", BUTTONS);
376
377 // These DnD properties must be set, otherwise Swing ends up spewing NPEs
378 // all over the place. The values came straight off of MToolkit.
379 desktopProperties.put("DnD.Autoscroll.initialDelay", new Integer(50));
380 desktopProperties.put("DnD.Autoscroll.interval", new Integer(50));
381 desktopProperties.put("DnD.Autoscroll.cursorHysteresis", new Integer(5));
382
383 desktopProperties.put("DnD.isDragImageSupported", Boolean.TRUE);
384
385 // Register DnD cursors
386 desktopProperties.put("DnD.Cursor.CopyDrop", new NamedCursor("DnD.Cursor.CopyDrop"));
387 desktopProperties.put("DnD.Cursor.MoveDrop", new NamedCursor("DnD.Cursor.MoveDrop"));
388 desktopProperties.put("DnD.Cursor.LinkDrop", new NamedCursor("DnD.Cursor.LinkDrop"));
389 desktopProperties.put("DnD.Cursor.CopyNoDrop", new NamedCursor("DnD.Cursor.CopyNoDrop"));
390 desktopProperties.put("DnD.Cursor.MoveNoDrop", new NamedCursor("DnD.Cursor.MoveNoDrop"));
391 desktopProperties.put("DnD.Cursor.LinkNoDrop", new NamedCursor("DnD.Cursor.LinkNoDrop"));
392 }
393
394 @Override
395 protected boolean syncNativeQueue(long timeout) {
396 return nativeSyncQueue(timeout);
397 }
398
399 @Override
400 public native void beep();
401
402 @Override
403 public int getScreenResolution() throws HeadlessException {
|