Changeset 790 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2008-08-16T00:12:09+02:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/mappaint
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyleHandler.java
r735 r790 87 87 for (int count=0; count<atts.getLength(); count++) { 88 88 if (atts.getQName(count).equals("src")) { 89 String imageFile = MapPaintStyles.get StyleDir()+"icons/"+atts.getValue(count);89 String imageFile = MapPaintStyles.getImageDir()+atts.getValue(count); 90 90 File f = new File(imageFile); 91 91 if (f.exists()) { … … 94 94 } else { 95 95 try { 96 URL path = getClass().getResource( "/styles/standard/icons/"+atts.getValue(count));96 URL path = getClass().getResource(MapPaintStyles.getImageDir()+atts.getValue(count)); 97 97 if (path == null) { 98 98 /* icon not found, using default */ 99 99 System.out.println("Mappaint: Icon " + atts.getValue(count) + " not found, using default icon"); 100 path = getClass().getResource( "/styles/standard/icons/misc/no_icon.png");100 path = getClass().getResource(MapPaintStyles.getImageDir()+"misc/no_icon.png"); 101 101 curIcon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(path)); 102 102 } else { … … 105 105 } 106 106 catch (Exception e){ 107 URL path = getClass().getResource( "/styles/standard/icons/amenity.png");107 URL path = getClass().getResource(MapPaintStyles.getImageDir()+"incomming/amenity.png"); 108 108 curIcon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(path)); 109 109 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
r736 r790 17 17 18 18 public static String styleDir; 19 public static String imageDir; 19 20 private static HashMap<String, ElemStyle> styles = new HashMap<String, ElemStyle>(); 20 21 … … 22 23 return styleDir; 23 24 } 25 public static String getImageDir(){ 26 return imageDir; 27 } 24 28 25 29 public static void readFromPreferences() { 26 30 27 31 String styleName = Main.pref.get("mappaint.style", "standard"); 28 styleDir = Main.pref.get PreferencesDir()+"plugins/mappaint/"+styleName+"/"; //some day we will support different icon directories over options32 styleDir = Main.pref.get("mappaint.styledir", Main.pref.getPreferencesDir()+"plugins/mappaint/"+styleName+"/"); 29 33 String elemStylesFile = getStyleDir()+"elemstyles.xml"; 34 imageDir = styleDir+"icons/"; 30 35 31 36 // System.out.println("mappaint: Using style: " + styleName); … … 57 62 if (elemStylesPath != null) 58 63 { 64 imageDir = "/images/styles/standard/"; 59 65 try 60 66 {
Note:
See TracChangeset
for help on using the changeset viewer.