Changeset 4820 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2012-01-19T12:49:55+01:00 (12 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/mappaint
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/AreaElemStyle.java
r4272 r4820 16 16 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.IconReference; 17 17 import org.openstreetmap.josm.tools.CheckParameterUtil; 18 import org.openstreetmap.josm.tools.ImageProvider.SanitizeMode; 18 19 import org.openstreetmap.josm.tools.Utils; 19 20 … … 45 46 IconReference iconRef = c.get("fill-image", null, IconReference.class); 46 47 if (iconRef != null) { 47 ImageIcon icon = MapPaintStyles.getIcon(iconRef, -1, -1, false);48 ImageIcon icon = MapPaintStyles.getIcon(iconRef, -1, -1, SanitizeMode.MAKE_BUFFEREDIMAGE); 48 49 if (icon != null) { 49 if (!(icon.getImage() instanceof BufferedImage)) {50 icon = MapPaintStyles.getIcon(iconRef, -1, -1, true);51 }52 50 if (!(icon.getImage() instanceof BufferedImage)) 53 51 throw new RuntimeException(); -
trunk/src/org/openstreetmap/josm/gui/mappaint/LinePatternElemStyle.java
r4272 r4820 28 28 if (iconRef == null) 29 29 return null; 30 ImageIcon icon = MapPaintStyles.getIcon(iconRef, -1, -1 , false);30 ImageIcon icon = MapPaintStyles.getIcon(iconRef, -1, -1); 31 31 if (icon == null) 32 32 return null; -
trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
r4721 r4820 27 27 import org.openstreetmap.josm.io.MirroredInputStream; 28 28 import org.openstreetmap.josm.tools.ImageProvider; 29 import org.openstreetmap.josm.tools.ImageProvider.SanitizeMode; 29 30 30 31 /** … … 87 88 } 88 89 89 public static ImageIcon getIcon(IconReference ref, int width, int height, boolean sanitize) { 90 public static ImageIcon getIcon(IconReference ref, int width, int height) { 91 return getIcon(ref, width, height, SanitizeMode.OFF); 92 } 93 94 public static ImageIcon getIcon(IconReference ref, int width, int height, SanitizeMode sanitize) { 90 95 final String namespace = ref.source.getPrefName(); 91 96 ImageIcon i = new ImageProvider(ref.iconName) … … 105 110 } 106 111 112 public static ImageIcon getNoIcon_Icon(StyleSource source) { 113 return getNoIcon_Icon(source, SanitizeMode.OFF); 114 } 115 107 116 /** 108 117 * No icon with the given name was found, show a dummy icon instead … … 113 122 * can be null if the defaults are turned off by user 114 123 */ 115 public static ImageIcon getNoIcon_Icon(StyleSource source, booleansanitize) {124 public static ImageIcon getNoIcon_Icon(StyleSource source, SanitizeMode sanitize) { 116 125 return new ImageProvider("misc/no_icon.png") 117 126 .setDirs(getIconSourceDirs(source)) -
trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java
r4415 r4820 150 150 int height = heightF == null ? -1 : Math.round(heightF); 151 151 152 ImageIcon icon = MapPaintStyles.getIcon(iconRef, width, height , false);152 ImageIcon icon = MapPaintStyles.getIcon(iconRef, width, height); 153 153 if (icon == null) 154 return new Pair<ImageIcon, Integer>(MapPaintStyles.getNoIcon_Icon(iconRef.source , false), 255);154 return new Pair<ImageIcon, Integer>(MapPaintStyles.getNoIcon_Icon(iconRef.source), 255); 155 155 int iconAlpha = Math.min(255, Math.max(0, Integer.valueOf(Main.pref.getInteger("mappaint.icon-image-alpha", 255)))); 156 156 Integer pAlpha = Utils.color_float2int(c.get("icon-opacity", null, float.class)); -
trunk/src/org/openstreetmap/josm/gui/mappaint/StyleSource.java
r4272 r4820 74 74 if (imageIcon == null) { 75 75 if (icon != null) { 76 imageIcon = MapPaintStyles.getIcon(new IconReference(icon, this), -1, -1 , false);76 imageIcon = MapPaintStyles.getIcon(new IconReference(icon, this), -1, -1); 77 77 } 78 78 if (imageIcon == null) {
Note:
See TracChangeset
for help on using the changeset viewer.