Ignore:
Timestamp:
2009-11-07T07:26:15+01:00 (15 years ago)
Author:
Gubaer
Message:

Made nodes, ways, and relations in DataSet private. Plugin updates to be checked in shortly.
Also added setter/getter for DataSet version.

Location:
trunk/src/org/openstreetmap/josm/io
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/OsmExporter.java

    r2181 r2396  
    6666            Writer writer = new OutputStreamWriter(out, "UTF-8");
    6767
    68             OsmWriter w = new OsmWriter(new PrintWriter(writer), false, layer.data.version);
     68            OsmWriter w = new OsmWriter(new PrintWriter(writer), false, layer.data.getVersion());
    6969            w.header();
    7070            w.writeDataSources(layer.data);
  • trunk/src/org/openstreetmap/josm/io/OsmReader.java

    r2382 r2396  
    184184                // save generator attribute for later use when creating DataSource objects
    185185                generator = atts.getValue("generator");
    186                 ds.version = v;
     186                ds.setVersion(v);
    187187
    188188            } else if (qName.equals("bounds")) {
     
    348348                    throwException(tr("Illegal value for attribute ''version'' on OSM primitive with ID {0}. Got {1}.", Long.toString(current.id), version));
    349349                }
    350                 if (ds.version.equals("0.6")){
     350                if (ds.getVersion().equals("0.6")){
    351351                    if (current.version <= 0 && current.id > 0) {
    352352                        throwException(tr("Illegal value for attribute ''version'' on OSM primitive with ID {0}. Got {1}.", Long.toString(current.id), version));
     
    355355                        current.version = 0;
    356356                    }
    357                 } else if (ds.version.equals("0.5")) {
     357                } else if (ds.getVersion().equals("0.5")) {
    358358                    if (current.version <= 0 && current.id > 0) {
    359359                        System.out.println(tr("WARNING: Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.id, current.version, 1, "0.5"));
     
    365365                } else {
    366366                    // should not happen. API version has been checked before
    367                     throwException(tr("Unknown or unsupported API version. Got {0}.", ds.version));
     367                    throwException(tr("Unknown or unsupported API version. Got {0}.", ds.getVersion()));
    368368                }
    369369            } else {
    370370                // version expected for OSM primitives with an id assigned by the server (id > 0), since API 0.6
    371371                //
    372                 if (current.id > 0 && ds.version != null && ds.version.equals("0.6")) {
     372                if (current.id > 0 && ds.getVersion() != null && ds.getVersion().equals("0.6")) {
    373373                    throwException(tr("Missing attribute ''version'' on OSM primitive with ID {0}.", Long.toString(current.id)));
    374                 } else if (current.id > 0 && ds.version != null && ds.version.equals("0.5")) {
     374                } else if (current.id > 0 && ds.getVersion() != null && ds.getVersion().equals("0.5")) {
    375375                    // default version in 0.5 files for existing primitives
    376376                    System.out.println(tr("WARNING: Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.id, current.version, 1, "0.5"));
    377377                    current.version= 1;
    378                 } else if (current.id <= 0 && ds.version != null && ds.version.equals("0.5")) {
     378                } else if (current.id <= 0 && ds.getVersion() != null && ds.getVersion().equals("0.5")) {
    379379                    // default version in 0.5 files for new primitives
    380380                    System.out.println(tr("WARNING: Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.id, current.version, 0, "0.5"));
Note: See TracChangeset for help on using the changeset viewer.