Changeset 215 in josm for src


Ignore:
Timestamp:
2007-04-06T15:44:54+02:00 (17 years ago)
Author:
imi
Message:
  • fixed NPE in marker layer when marker type was not found
  • added one zoom to->data when first opening some data (since auto scale feature has been removed)
  • fixed NPE in preferences when there is a .jar without a manifest in plugin directory
Location:
src/org/openstreetmap/josm
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/org/openstreetmap/josm/gui/MapView.java

    r214 r215  
    1616
    1717import org.openstreetmap.josm.Main;
     18import org.openstreetmap.josm.actions.AutoScaleAction;
    1819import org.openstreetmap.josm.data.Bounds;
    1920import org.openstreetmap.josm.data.SelectionChangedListener;
     
    7374                addComponentListener(new ComponentAdapter(){
    7475                        @Override public void componentResized(ComponentEvent e) {
    75                                 recalculateCenterScale(null);
     76                                new AutoScaleAction("data").actionPerformed(null);
    7677                                removeComponentListener(this);
    7778                        }
  • src/org/openstreetmap/josm/gui/layer/markerlayer/Marker.java

    r210 r215  
    7575
    7676                                // Try a relative file:// url, if the link is not in an URL-compatible form
    77                                 if (relativePath != null && !URI.isWellFormedAddress(link))
     77                                if (relativePath != null && link != null && !URI.isWellFormedAddress(link))
    7878                                        link = new File(relativePath, link).toURI().toString();
    7979
  • src/org/openstreetmap/josm/gui/preferences/PluginPreference.java

    r181 r215  
    2121
    2222import org.openstreetmap.josm.Main;
     23import org.openstreetmap.josm.plugins.PluginException;
    2324import org.openstreetmap.josm.plugins.PluginInformation;
    2425import org.openstreetmap.josm.tools.GBC;
     
    3637                if (pluginFiles != null) {
    3738                        Arrays.sort(pluginFiles);
    38                         for (File f : pluginFiles)
    39                                 if (f.isFile() && f.getName().endsWith(".jar"))
    40                                         availablePlugins.add(new PluginInformation(f));
     39                        for (File f : pluginFiles) {
     40                                if (f.isFile() && f.getName().endsWith(".jar")) {
     41                                        try {
     42                            availablePlugins.add(new PluginInformation(f));
     43                    } catch (PluginException x) {
     44                    }
     45                                }
     46                        }
    4147                }
    4248
  • src/org/openstreetmap/josm/io/RawGpsReader.java

    r210 r215  
    9898                                currentTagValues.clear();
    9999                        } else if (qName.equals("wpt")) {
    100                                 markerData.add(Marker.createMarker(currentLatLon, currentTagValues, relativeMarkerPath));
     100                                Marker m = Marker.createMarker(currentLatLon, currentTagValues, relativeMarkerPath);
     101                                if (m != null)
     102                                        markerData.add(m);
    101103                                currentTagValues.clear();
    102104                        } else if (qName.equals("trkseg") || qName.equals("trk") || qName.equals("gpx")) {
  • src/org/openstreetmap/josm/plugins/PluginInformation.java

    r207 r215  
    5454                        JarInputStream jar = new JarInputStream(new FileInputStream(file));
    5555                        Manifest manifest = jar.getManifest();
     56                        if (manifest == null)
     57                                throw new IOException(file+" contains no manifest.");
    5658                        Attributes attr = manifest.getMainAttributes();
    5759                        className = attr.getValue("Plugin-Class");
  • src/org/openstreetmap/josm/tools/XmlObjectParser.java

    r212 r215  
    115115                                }
    116116                        } catch (Exception e) {
    117                                 e.printStackTrace(); // !"§%$!"§ SAXException does not dump inner exceptions.
     117                                e.printStackTrace(); // SAXException does not dump inner exceptions.
    118118                                throw new SAXException(e);
    119119                        }
Note: See TracChangeset for help on using the changeset viewer.