Changeset 5395 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2012-08-05T12:37:29+02:00 (12 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java
r5108 r5395 34 34 public File storageFile; 35 35 public boolean fromServer; 36 37 public String creator; 36 38 37 39 public final Collection<GpxTrack> tracks = new LinkedList<GpxTrack>(); -
trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java
r5371 r5395 446 446 int maxLineLength; 447 447 boolean lines; 448 if ( this.isLocalFile) {448 if (!this.data.fromServer) { 449 449 maxLineLength = Main.pref.getInteger("draw.rawgps.max-line-length.local", spec, -1); 450 450 lines = Main.pref.getBoolean("draw.rawgps.lines.local", spec, true); -
trunk/src/org/openstreetmap/josm/io/GpxReader.java
r4819 r5395 5 5 6 6 import static org.openstreetmap.josm.tools.I18n.tr; 7 import static org.openstreetmap.josm.tools.Utils.equal; 7 8 8 9 import java.io.IOException; … … 37 38 // TODO: implement GPX 1.0 parsing 38 39 40 private String version; 39 41 /** 40 42 * The resulting gpx data 41 43 */ 42 44 public GpxData data; 43 private enum State { init, metadata, wpt, rte, trk, ext, author, link, trkseg, copyright}45 private enum State { init, gpx, metadata, wpt, rte, trk, ext, author, link, trkseg, copyright} 44 46 private InputSource inputSource; 45 47 … … 87 89 switch(currentState) { 88 90 case init: 91 states.push(currentState); 92 currentState = State.gpx; 93 currentData.creator = atts.getValue("creator"); 94 version = atts.getValue("version"); 95 if (!equal(version, "1.0") && !equal(version, "1.1")) { 96 version = "1.1"; 97 } 98 System.err.println("Version: "+version); 99 case gpx: 89 100 if (qName.equals("metadata")) { 90 101 states.push(currentState); … … 110 121 } 111 122 break; 123 case metadata: 124 if (qName.equals("author")) { 125 states.push(currentState); 126 currentState = State.author; 127 } else if (qName.equals("extensions")) { 128 states.push(currentState); 129 currentState = State.ext; 130 } else if (qName.equals("copyright")) { 131 states.push(currentState); 132 currentState = State.copyright; 133 currentData.attr.put(GpxData.META_COPYRIGHT_AUTHOR, atts.getValue("author")); 134 } else if (qName.equals("link")) { 135 states.push(currentState); 136 currentState = State.link; 137 currentLink = new GpxLink(atts.getValue("href")); 138 } 139 break; 112 140 case author: 113 141 if (qName.equals("link")) { … … 131 159 states.push(currentState); 132 160 currentState = State.ext; 133 }134 break;135 case metadata:136 if (qName.equals("author")) {137 states.push(currentState);138 currentState = State.author;139 } else if (qName.equals("extensions")) {140 states.push(currentState);141 currentState = State.ext;142 } else if (qName.equals("copyright")) {143 states.push(currentState);144 currentState = State.copyright;145 currentData.attr.put(GpxData.META_COPYRIGHT_AUTHOR, atts.getValue("author"));146 } else if (qName.equals("link")) {147 states.push(currentState);148 currentState = State.link;149 currentLink = new GpxLink(atts.getValue("href"));150 161 } 151 162 break; … … 323 334 currentState = states.pop(); 324 335 } 336 break; 337 case gpx: 338 currentState = states.pop(); 325 339 break; 326 340 default:
Note:
See TracChangeset
for help on using the changeset viewer.