Changeset 2711 in osm for applications/editors/josm/plugins/mappaint/src
- Timestamp:
- 2007-05-01T23:13:45+02:00 (18 years ago)
- Location:
- applications/editors/josm/plugins/mappaint/src/mappaint
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mappaint/src/mappaint/ElemStyleHandler.java
r2708 r2711 98 98 { 99 99 if(atts.getQName(count).equals("src")) { 100 String imageFile = MapPaintPlugin.get IconsDir()+atts.getValue(count);100 String imageFile = MapPaintPlugin.getStyleDir()+"icons/"+atts.getValue(count); 101 101 File f = new File(imageFile); 102 102 if (f.exists()){ -
applications/editors/josm/plugins/mappaint/src/mappaint/MapPaintPlugin.java
r2708 r2711 17 17 public static ElemStyles elemStyles = new ElemStyles(); 18 18 19 public static String iconsDir;19 public static String styleDir; 20 20 21 public static String get IconsDir(){22 return iconsDir;21 public static String getStyleDir(){ 22 return styleDir; 23 23 } 24 24 25 25 public MapPaintPlugin() { 26 iconsDir = getPluginDir()+"icons/"; //some day we will support diferent icon directories over options27 String elemStylesFile = get PluginDir()+"elemstyles.xml";26 styleDir = getPluginDir()+"standard/"; //some day we will support diferent icon directories over options 27 String elemStylesFile = getStyleDir()+"elemstyles.xml"; 28 28 File f = new File(elemStylesFile); 29 29 if (f.exists()) … … 43 43 throw new RuntimeException(e); 44 44 } 45 } 46 else{ //just for backwards compatibility 47 elemStylesFile = getPluginDir()+"elemstyles.xml"; 48 f = new File(elemStylesFile); 49 if (f.exists()) 50 { 51 try 52 { 53 XMLReader xmlReader = XMLReaderFactory.createXMLReader(); 54 ElemStyleHandler handler = new ElemStyleHandler(); 55 xmlReader.setContentHandler(handler); 56 xmlReader.setErrorHandler(handler); 57 handler.setElemStyles(elemStyles); 58 // temporary only! 59 xmlReader.parse(new InputSource(new FileReader(f))); 60 } 61 catch (Exception e) 62 { 63 throw new RuntimeException(e); 64 } 65 } 45 66 } 46 67 }
Note:
See TracChangeset
for help on using the changeset viewer.