Changeset 7075 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2014-05-08T02:40:40+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r7033 r7075 8 8 import java.awt.Graphics; 9 9 import java.awt.Graphics2D; 10 import java.awt.GraphicsConfiguration;11 10 import java.awt.GraphicsEnvironment; 12 11 import java.awt.Image; … … 14 13 import java.awt.RenderingHints; 15 14 import java.awt.Toolkit; 16 import java.awt.Transparency;17 15 import java.awt.image.BufferedImage; 18 16 import java.io.ByteArrayInputStream; … … 793 791 img = overlay(img, ImageProvider.get("cursor/modifier/" + overlay), OverlayPosition.SOUTHEAST); 794 792 } 793 if (GraphicsEnvironment.isHeadless()) { 794 Main.warn("Cursors are not available in headless mode. Returning null for '"+name+"'"); 795 return null; 796 } 795 797 return Toolkit.getDefaultToolkit().createCustomCursor(img.getImage(), 796 798 "crosshair".equals(name) ? new Point(10, 10) : new Point(3, 2), "Cursor"); … … 808 810 */ 809 811 public static ImageIcon overlay(Icon ground, Icon overlay, OverlayPosition pos) { 810 GraphicsConfiguration conf = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice()811 .getDefaultConfiguration();812 812 int w = ground.getIconWidth(); 813 813 int h = ground.getIconHeight(); 814 814 int wo = overlay.getIconWidth(); 815 815 int ho = overlay.getIconHeight(); 816 BufferedImage img = conf.createCompatibleImage(w, h, Transparency.TRANSLUCENT);816 BufferedImage img = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB); 817 817 Graphics g = img.createGraphics(); 818 818 ground.paintIcon(null, g, 0, 0); -
trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java
r7037 r7075 99 99 @Override 100 100 public boolean canFullscreen() { 101 return GraphicsEnvironment.getLocalGraphicsEnvironment() 101 return !GraphicsEnvironment.isHeadless() && 102 GraphicsEnvironment.getLocalGraphicsEnvironment() 102 103 .getDefaultScreenDevice().isFullScreenSupported(); 103 104 } … … 328 329 } 329 330 330 // Method kept because strings have already been translated. To enable for Java 8 migration somewhere in 2016 331 // Method kept because strings have already been translated. To enable for Java 8 migration somewhere in 2016 331 332 protected void askUpdateJava(final String version, final String url) { 332 333 GuiHelper.runInEDTAndWait(new Runnable() {
Note: See TracChangeset
for help on using the changeset viewer.