Changeset 23192 in osm for applications/editors/josm/plugins/public_transport/src/public_transport/GTFSJoinCommand.java
- Timestamp:
- 2010-09-15T18:59:53+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/public_transport/src/public_transport/GTFSJoinCommand.java
r22148 r23192 18 18 private GTFSStopTableModel gtfsStopTM = null; 19 19 private String type = null; 20 20 21 21 public GTFSJoinCommand(GTFSImporterAction controller) 22 22 { 23 23 gtfsStopTM = controller.getGTFSStopTableModel(); 24 24 workingLines = new Vector< Integer >(); 25 25 26 26 // use either selected lines or all lines if no line is selected 27 27 int[] selectedLines = controller.getDialog().getGTFSStopTable().getSelectedRows(); … … 30 30 workingLines.add(selectedLines[0]); 31 31 } 32 32 33 33 public boolean executeCommand() 34 34 { … … 43 43 Node n = iter.next(); 44 44 if ((n != null) && (n.equals(gtfsStopTM.nodes.elementAt(j)))) 45 45 continue; 46 46 if (dest != null) 47 47 return false; 48 48 dest = n; 49 49 } … … 51 51 return false; 52 52 undoMapNode = new Node(dest); 53 53 54 54 Node node = gtfsStopTM.nodes.elementAt(j); 55 55 undoTableNode = node; … … 59 59 node.setDeleted(true); 60 60 } 61 61 62 62 dest.put("highway", "bus_stop"); 63 63 dest.put("stop_id", (String)gtfsStopTM.getValueAt(j, 0)); … … 67 67 type = (String)gtfsStopTM.getValueAt(j, 2); 68 68 gtfsStopTM.setValueAt("moved", j, 2); 69 69 70 70 return true; 71 71 } 72 72 73 73 public void undoCommand() 74 74 { … … 76 76 return; 77 77 int j = workingLines.elementAt(0); 78 78 79 79 Node node = gtfsStopTM.nodes.elementAt(j); 80 80 if (node != null) … … 83 83 node.setDeleted(true); 84 84 } 85 85 86 86 if (undoMapNode != null) 87 87 { … … 97 97 gtfsStopTM.setValueAt(type, j, 2); 98 98 } 99 99 100 100 public void fillModifiedData 101 101 (Collection< OsmPrimitive > modified, Collection< OsmPrimitive > deleted, … … 103 103 { 104 104 } 105 105 106 106 @Override public JLabel getDescription() 107 107 {
Note:
See TracChangeset
for help on using the changeset viewer.