Changeset 101 in josm for src/org/openstreetmap/josm/tools/ImageProvider.java
- Timestamp:
- 2006-05-03T22:21:02+02:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/tools/ImageProvider.java
r93 r101 1 1 package org.openstreetmap.josm.tools; 2 2 3 import java.awt.Cursor; 3 4 import java.awt.Graphics; 4 5 import java.awt.GraphicsConfiguration; 5 6 import java.awt.GraphicsEnvironment; 6 7 import java.awt.Image; 8 import java.awt.Point; 7 9 import java.awt.Toolkit; 8 10 import java.awt.Transparency; … … 63 65 } 64 66 67 public static Cursor getCursor(String name, String overlay) { 68 ImageIcon img = overlay(get("cursor/"+name), "cursor/modifier/"+overlay, OverlayPosition.SOUTHEAST); 69 Cursor c = Toolkit.getDefaultToolkit().createCustomCursor(img.getImage(), 70 name.equals("crosshair") ? new Point(10,10) : new Point(3,2), "Cursor"); 71 return c; 72 } 73 65 74 /** 66 75 * @return an icon that represent the overlay of the two given icons. The 67 76 * second icon is layed on the first relative to the given position. 68 77 */ 69 public static I con overlay(Icon ground, String overlayImage, OverlayPosition pos) {78 public static ImageIcon overlay(Icon ground, String overlayImage, OverlayPosition pos) { 70 79 GraphicsConfiguration conf = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration(); 71 80 int w = ground.getIconWidth(); 72 81 int h = ground.getIconHeight(); 73 ImageIcon overlay = ImageProvider.get( "overlay",overlayImage);82 ImageIcon overlay = ImageProvider.get(overlayImage); 74 83 int wo = overlay.getIconWidth(); 75 84 int ho = overlay.getIconHeight();
Note:
See TracChangeset
for help on using the changeset viewer.