Changeset 1196 in josm for trunk/src


Ignore:
Timestamp:
2008-12-31T12:35:50+01:00 (11 years ago)
Author:
stoecker
Message:

partly fix #1720. Patch by Russ Nelson

Location:
trunk/src/org/openstreetmap/josm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java

    r1169 r1196  
    7575        String fn = file.getName();
    7676        if (ExtensionFileFilter.filters[ExtensionFileFilter.OSM].acceptName(fn)) {
    77             DataSet dataSet = OsmReader.parseDataSet(new FileInputStream(file), null, Main.pleaseWaitDlg);
     77            OsmReader osm = OsmReader.parseDataSetOsm(new FileInputStream(file), null, Main.pleaseWaitDlg);
     78            DataSet dataSet = osm.getDs();
    7879            OsmDataLayer layer = new OsmDataLayer(dataSet, file.getName(), file);
    7980            Main.main.addLayer(layer);
    8081            layer.fireDataChange();
     82            if (osm.getParseNotes().length() != 0) {
     83                /* display at most five lines */
     84                String notes = osm.getParseNotes();
     85                int j = 0;
     86                for (int i = 0; i < 5; i++) {
     87                    j = notes.indexOf('\n', j + 1);
     88                }
     89                JOptionPane.showMessageDialog(Main.parent, notes.substring(0, j));
     90            }
    8191        }
    8292        else
  • trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java

    r1169 r1196  
    114114            if (wayOccurenceCounter.isEmpty()) {
    115115                JOptionPane.showMessageDialog(Main.parent,
    116                         trn("The selected node is no inner part of any way.",
    117                                 "The selected nodes are no inner part of any way.", selectedNodes.size()));
     116                trn("The selected node is not in the middle of any way.",
     117                "The selected nodes are not in the middle of any way.",
     118                selectedNodes.size()));
    118119                return;
    119120            }
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java

    r1195 r1196  
    345345            }
    346346        }
    347         Boolean isMultipolygon = "multipolygon".equals(r.keys.get("type"));
    348         if (!drawMultipolygon || !isMultipolygon)
    349         {
    350             if(r.selected && !isMultipolygon)
     347        if (!drawMultipolygon || !"multipolygon".equals(r.keys.get("type")))
     348        {
     349            if(r.selected)
    351350            {
    352351                for (RelationMember m : r.members)
  • trunk/src/org/openstreetmap/josm/io/OsmReader.java

    r1195 r1196  
    6060      */
    6161     private DataSet ds = new DataSet();
     62     public DataSet getDs() { return ds; }
     63
     64     /**
     65      * Record warnings.  If there were any data inconsistencies, append
     66      * a newline-terminated string.
     67      */
     68     private String parseNotes = new String();
     69     public String getParseNotes() {
     70         return parseNotes;
     71     }
    6272
    6373     /**
     
    333343                    Node n = findNode(id);
    334344                    if (n == null) {
     345                         parseNotes += tr("Skipping a way because it includes a node that doesn't exist: {0}\n", id);
    335346                         failed = true;
    336347                         break;
     
    435446      */
    436447     public static DataSet parseDataSet(InputStream source, DataSet ref, PleaseWaitDialog pleaseWaitDlg) throws SAXException, IOException {
     448          return parseDataSetOsm(source, ref, pleaseWaitDlg).ds;
     449     }
     450
     451     public static OsmReader parseDataSetOsm(InputStream source, DataSet ref, PleaseWaitDialog pleaseWaitDlg) throws SAXException, IOException {
    437452          OsmReader osm = new OsmReader();
    438453          osm.references = ref == null ? new DataSet() : ref;
     
    468483                    o.id = 0;
    469484
    470           return osm.ds;
     485          return osm;
    471486     }
    472487}
Note: See TracChangeset for help on using the changeset viewer.