Changeset 18099 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2021-08-01T19:40:15+02:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/ImageResource.java
r17827 r18099 15 15 import javax.swing.JPanel; 16 16 import javax.swing.UIManager; 17 18 import org.openstreetmap.josm.tools.ImageProvider.ImageSizes; 17 19 18 20 import com.kitfox.svg.SVGDiagram; … … 101 103 */ 102 104 public void attachImageIcon(AbstractAction a) { 103 Dimension iconDimension = ImageProvider.ImageSizes.SMALLICON.getImageDimension(); 104 ImageIcon icon = getImageIcon(iconDimension); 105 a.putValue(Action.SMALL_ICON, icon); 106 107 iconDimension = ImageProvider.ImageSizes.LARGEICON.getImageDimension(); 108 icon = getImageIcon(iconDimension); 109 a.putValue(Action.LARGE_ICON_KEY, icon); 105 a.putValue(Action.SMALL_ICON, getImageIcon(ImageSizes.SMALLICON.getImageDimension())); 106 a.putValue(Action.LARGE_ICON_KEY, getImageIcon(ImageSizes.LARGEICON.getImageDimension())); 110 107 } 111 108 … … 121 118 a.putValue("ImageResource", this); 122 119 } 120 } 121 122 /** 123 * Returns the {@code ImageResource} attached to the given action, if any. 124 * @param a action 125 * @return the {@code ImageResource} attached to the given action, or {@code null} 126 * @since 18099 127 */ 128 public static ImageResource getAttachedImageResource(Action a) { 129 return (ImageResource) a.getValue("ImageResource"); 123 130 } 124 131
Note:
See TracChangeset
for help on using the changeset viewer.