Changeset 30358 in osm for applications
- Timestamp:
- 2014-03-24T22:26:05+01:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/public_transport/src/public_transport
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/public_transport/src/public_transport/AStarAlgorithm.java
r28318 r30358 93 93 if (knownDistance == null || distance < knownDistance.doubleValue()) 94 94 { 95 95 openList.put(edge.getEnd(), distance); 96 96 pathTail.put(edge.getEnd(), edge); 97 97 } -
applications/editors/josm/plugins/public_transport/src/public_transport/StopImporterAction.java
r29859 r30358 171 171 is = new FileInputStream(file); 172 172 // Workaround for SAX BOM bug 173 // http ://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6206835173 // https://bugs.openjdk.java.net/browse/JDK-6206835 174 174 if (!((is.read() == 0xef) && (is.read() == 0xbb) && (is.read() == 0xbf))) 175 175 { -
applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistNameCommand.java
r29861 r30358 11 11 12 12 public class TrackStoplistNameCommand extends Command { 13 14 15 16 17 18 19 20 21 13 private int workingLine = 0; 14 private TrackReference trackref = null; 15 private String oldName = null; 16 private String name = null; 17 private String oldTime = null; 18 private String time = null; 19 private String oldShelter = null; 20 private TransText shelter = null; 21 private LatLon oldLatLon = null; 22 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 23 public TrackStoplistNameCommand(TrackReference trackref, int workingLine) { 24 this.trackref = trackref; 25 this.workingLine = workingLine; 26 Node node = trackref.stoplistTM.nodeAt(workingLine); 27 if (node != null) { 28 oldName = node.get("name"); 29 oldTime = trackref.stoplistTM.timeAt(workingLine); 30 oldShelter = node.get("shelter"); 31 oldLatLon = node.getCoor(); 32 } 33 this.time = (String) trackref.stoplistTM.getValueAt(workingLine, 0); 34 this.name = (String) trackref.stoplistTM.getValueAt(workingLine, 1); 35 this.shelter = (TransText) trackref.stoplistTM.getValueAt(workingLine, 2); 36 if ("".equals(this.shelter.text)) 37 this.shelter = null; 38 } 39 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 40 public boolean executeCommand() { 41 Node node = trackref.stoplistTM.nodeAt(workingLine); 42 if (node != null) { 43 node.put("name", name); 44 node.put("shelter", shelter.text); 45 double dTime = StopImporterDialog.parseTime(time); 46 node.setCoor(trackref.computeCoor(dTime)); 47 } 48 trackref.inEvent = true; 49 if (time == null) 50 trackref.stoplistTM.setValueAt("", workingLine, 0); 51 else 52 trackref.stoplistTM.setValueAt(time, workingLine, 0); 53 if (name == null) 54 trackref.stoplistTM.setValueAt("", workingLine, 1); 55 else 56 trackref.stoplistTM.setValueAt(name, workingLine, 1); 57 trackref.stoplistTM.setValueAt(shelter, workingLine, 2); 58 trackref.inEvent = false; 59 return true; 60 } 61 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 62 public void undoCommand() { 63 Node node = trackref.stoplistTM.nodeAt(workingLine); 64 if (node != null) { 65 node.put("name", oldName); 66 node.put("shelter", oldShelter); 67 node.setCoor(oldLatLon); 68 } 69 trackref.inEvent = true; 70 if (oldTime == null) 71 trackref.stoplistTM.setValueAt("", workingLine, 0); 72 else 73 trackref.stoplistTM.setValueAt(oldTime, workingLine, 0); 74 if (oldName == null) 75 trackref.stoplistTM.setValueAt("", workingLine, 1); 76 else 77 trackref.stoplistTM.setValueAt(oldName, workingLine, 1); 78 trackref.stoplistTM.setValueAt(new TransText(oldShelter), workingLine, 2); 79 trackref.inEvent = false; 80 } 81 81 82 83 84 82 public void fillModifiedData(Collection<OsmPrimitive> modified, Collection<OsmPrimitive> deleted, 83 Collection<OsmPrimitive> added) { 84 } 85 85 86 87 88 89 86 @Override 87 public String getDescriptionText() { 88 return tr("Public Transport: Edit track stop list"); 89 } 90 90 };
Note:
See TracChangeset
for help on using the changeset viewer.