Changeset 2711 in osm for applications/editors


Ignore:
Timestamp:
2007-05-01T23:13:45+02:00 (17 years ago)
Author:
damians
Message:

fixed minor bugs

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  
    9898                {
    9999                    if(atts.getQName(count).equals("src")) {
    100                                                                                                 String imageFile = MapPaintPlugin.getIconsDir()+atts.getValue(count);
     100                                                                                                String imageFile = MapPaintPlugin.getStyleDir()+"icons/"+atts.getValue(count);
    101101                                                                                                File f = new File(imageFile);
    102102                                                                                                if (f.exists()){
  • applications/editors/josm/plugins/mappaint/src/mappaint/MapPaintPlugin.java

    r2708 r2711  
    1717        public static ElemStyles elemStyles = new ElemStyles();
    1818       
    19         public static String iconsDir;
     19        public static String styleDir;
    2020
    21         public static String getIconsDir(){
    22                 return iconsDir;
     21        public static String getStyleDir(){
     22                return styleDir;
    2323        }
    2424
    2525        public MapPaintPlugin() {
    26                 iconsDir = getPluginDir()+"icons/"; //some day we will support diferent icon directories over options
    27                 String elemStylesFile = getPluginDir()+"elemstyles.xml";
     26                styleDir = getPluginDir()+"standard/"; //some day we will support diferent icon directories over options
     27                String elemStylesFile = getStyleDir()+"elemstyles.xml";
    2828                File f = new File(elemStylesFile);
    2929                if (f.exists())
     
    4343                                throw new RuntimeException(e);
    4444                        }
     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                        }
    4566                }
    4667        }
Note: See TracChangeset for help on using the changeset viewer.