Changeset 7731 in josm
- Timestamp:
- 2014-11-18T23:34:19+01:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r7706 r7731 95 95 */ 96 96 public static enum OverlayPosition { 97 NORTHWEST, NORTHEAST, SOUTHWEST, SOUTHEAST 97 /** North west */ 98 NORTHWEST, 99 /** North east */ 100 NORTHEAST, 101 /** South west */ 102 SOUTHWEST, 103 /** South east */ 104 SOUTHEAST 98 105 } 99 106 … … 113 120 */ 114 121 public static enum ImageSizes { 115 /* SMALL_ICON value of on Action */122 /** SMALL_ICON value of on Action */ 116 123 SMALLICON, 117 /* LARGE_ICON_KEY value of on Action */124 /** LARGE_ICON_KEY value of on Action */ 118 125 LARGEICON, 119 /* MAP icon */126 /** MAP icon */ 120 127 MAP, 121 /* MAP icon maximum size */128 /** MAP icon maximum size */ 122 129 MAPMAX, 123 /* MENU icon size */130 /** MENU icon size */ 124 131 MENU, 125 132 } … … 169 176 */ 170 177 public interface ImageCallback { 178 /** 179 * Called when image loading has finished. 180 * @param result the loaded image icon 181 */ 171 182 void finished(ImageIcon result); 172 183 } … … 177 188 */ 178 189 public interface ImageResourceCallback { 190 /** 191 * Called when image loading has finished. 192 * @param result the loaded image resource 193 */ 179 194 void finished(ImageResource result); 180 195 } … … 247 262 /** 248 263 * Convert enumerated size values to real numbers 249 * @return dimension of image 264 * @param size the size enumeration 265 * @return dimension of image in pixels 250 266 * @since 7687 251 267 */ … … 496 512 497 513 /** 514 * Load an image with a given file name. 515 * 498 516 * @param name The icon name (base name with or without '.png' or '.svg' extension) 499 517 * @return the requested image or null if the request failed … … 933 951 } 934 952 953 /** 954 * Load a cursor with a given file name, optionally decorated with an overlay image. 955 * 956 * @param name the cursor image filename in "cursor" directory 957 * @param overlay optional overlay image 958 * @return cursor with a given file name, optionally decorated with an overlay image 959 */ 935 960 public static Cursor getCursor(String name, String overlay) { 936 961 ImageIcon img = get("cursor", name); … … 1111 1136 } 1112 1137 1138 /** 1139 * Constructs an image from the given SVG data. 1140 * @param svg the SVG data 1141 * @param dim the desired image dimension 1142 * @return an image from the given SVG data at the desired dimension. 1143 */ 1113 1144 public static BufferedImage createImageFromSvg(SVGDiagram svg, Dimension dim) { 1114 1145 float realWidth = svg.getWidth(); -
trunk/src/org/openstreetmap/josm/tools/ImageResource.java
r7696 r7731 8 8 import java.util.Map; 9 9 10 import javax.swing.AbstractAction; 10 11 import javax.swing.Action; 11 import javax.swing.AbstractAction;12 12 import javax.swing.ImageIcon; 13 13 … … 29 29 private Map<Dimension, Image> imgCache = new HashMap<>(); 30 30 private SVGDiagram svg; 31 /** 32 * Use this dimension to request original file dimension. 33 */ 31 34 public static final Dimension DEFAULT_DIMENSION = new Dimension(-1, -1); 32 35 36 /** 37 * Constructs a new {@code ImageResource} from an image. 38 * @param img the image 39 */ 33 40 public ImageResource(Image img) { 34 41 CheckParameterUtil.ensureParameterNotNull(img); … … 36 43 } 37 44 45 /** 46 * Constructs a new {@code ImageResource} from SVG data. 47 * @param svg SVG data 48 */ 38 49 public ImageResource(SVGDiagram svg) { 39 50 CheckParameterUtil.ensureParameterNotNull(svg); … … 41 52 } 42 53 54 /** 55 * Returns the image icon at default dimension. 56 * @return the image icon at default dimension 57 */ 43 58 public ImageIcon getImageIcon() { 44 59 return getImageIcon(DEFAULT_DIMENSION); … … 47 62 /** 48 63 * Set both icons of an Action 49 * @param a ctionThe action for the icons64 * @param a The action for the icons 50 65 * @since 7693 51 66 */ … … 56 71 a.putValue(Action.LARGE_ICON_KEY, icon); 57 72 } 58 73 59 74 /** 60 75 * Get an ImageIcon object for the image of this resource
Note:
See TracChangeset
for help on using the changeset viewer.