Changeset 33053 in osm for applications/editors/josm/plugins/public_transport/src
- Timestamp:
- 2016-11-12T04:29:54+01:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/public_transport/src/public_transport
- Files:
-
- 2 added
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/public_transport/src/public_transport/AStarAlgorithm.java
r32357 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 … … 11 12 // AStarAlgorithm. 12 13 13 public staticabstract class Vertex implements Comparable<Vertex> {14 public abstract static class Vertex implements Comparable<Vertex> { 14 15 @Override 15 16 public abstract int compareTo(Vertex v); 16 } ;17 } 17 18 18 public staticabstract class Edge {19 public abstract static class Edge { 19 20 public abstract Vertex getBegin(); 20 21 … … 22 23 23 24 public abstract double getLength(); 24 } ;25 } 25 26 26 27 public abstract Vector<Edge> getNeighbors(Vertex vertex); … … 103 104 104 105 Vector<Edge> result = new Vector<>(); 105 for (int i = backwards.size() - 1; i >= 0; --i) 106 for (int i = backwards.size() - 1; i >= 0; --i) { 106 107 result.add(backwards.elementAt(i)); 108 } 107 109 return result; 108 110 } -
applications/editors/josm/plugins/public_transport/src/public_transport/AbstractGTFSCatchJoinCommand.java
r33010 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 … … 24 25 25 26 private String type = null; 26 27 27 28 private final boolean isCatch; 28 29 -
applications/editors/josm/plugins/public_transport/src/public_transport/AbstractImporterDialog.java
r32902 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 … … 20 21 public abstract class AbstractImporterDialog<T extends JosmAction> { 21 22 22 private static final String[] stoptypes = new String[] { marktr("bus"), marktr("tram"), 23 marktr("light_rail"), marktr("subway"), marktr("rail") }; 23 private static final String[] stoptypes = new String[] { 24 marktr("bus"), 25 marktr("tram"), 26 marktr("light_rail"), 27 marktr("subway"), 28 marktr("rail") }; 24 29 25 30 private final JDialog jDialog; … … 45 50 cbStoptype = new JComboBox<>(); 46 51 cbStoptype.setEditable(false); 47 for (String type : stoptypes) 52 for (String type : stoptypes) { 48 53 cbStoptype.addItem(new TransText(type)); 54 } 49 55 cbStoptype.setActionCommand(actionPrefix + ".settingsStoptype"); 50 56 cbStoptype.addActionListener(controller); -
applications/editors/josm/plugins/public_transport/src/public_transport/GTFSAddCommand.java
r32902 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 … … 30 31 Vector<Integer> consideredLines = new Vector<>(); 31 32 if (selectedLines.length > 0) { 32 for (int i = 0; i < selectedLines.length; ++i) 33 for (int i = 0; i < selectedLines.length; ++i) { 33 34 consideredLines.add(selectedLines[i]); 35 } 34 36 } else { 35 for (int i = 0; i < gtfsStopTM.getRowCount(); ++i) 37 for (int i = 0; i < gtfsStopTM.getRowCount(); ++i) { 36 38 consideredLines.add(Integer.valueOf(i)); 39 } 37 40 } 38 41 -
applications/editors/josm/plugins/public_transport/src/public_transport/GTFSCatchCommand.java
r33010 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 -
applications/editors/josm/plugins/public_transport/src/public_transport/GTFSDeleteCommand.java
r32902 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 … … 30 31 Vector<Integer> consideredLines = new Vector<>(); 31 32 if (selectedLines.length > 0) { 32 for (int i = 0; i < selectedLines.length; ++i) 33 for (int i = 0; i < selectedLines.length; ++i) { 33 34 consideredLines.add(selectedLines[i]); 35 } 34 36 } else { 35 for (int i = 0; i < gtfsStopTM.getRowCount(); ++i) 37 for (int i = 0; i < gtfsStopTM.getRowCount(); ++i) { 36 38 consideredLines.add(Integer.valueOf(i)); 39 } 37 40 } 38 41 -
applications/editors/josm/plugins/public_transport/src/public_transport/GTFSImporterAction.java
r32902 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 … … 98 99 99 100 refreshData(); 100 } 101 /* else if ("stopImporter.settingsGPSTimeStart".equals(event.getActionCommand())) 101 102 /* } else if ("stopImporter.settingsGPSTimeStart".equals(event.getActionCommand())) 102 103 { 103 104 if ((!inEvent) && (dialog.gpsTimeStartValid()) && (currentTrack != null)) … … 131 132 Main.main.undoRedo.add(new TrackStoplistDetachCommand(this)); 132 133 dialog.getStoplistTable().clearSelection(); 133 }*/134 else if ("gtfsImporter.gtfsStopsAdd".equals(event.getActionCommand())) 134 */ 135 } else if ("gtfsImporter.gtfsStopsAdd".equals(event.getActionCommand())) 135 136 Main.main.undoRedo.add(new GTFSAddCommand(this)); 136 137 else if ("gtfsImporter.gtfsStopsDelete".equals(event.getActionCommand())) … … 155 156 data.clear(); 156 157 157 while (r.ready()) 158 while (r.ready()) { 158 159 data.add(r.readLine()); 160 } 159 161 } catch (FileNotFoundException e) { 160 162 Main.error(e); … … 254 256 Vector<Integer> consideredLines = new Vector<>(); 255 257 if (selectedLines.length > 0) { 256 for (int i = 0; i < selectedLines.length; ++i) 258 for (int i = 0; i < selectedLines.length; ++i) { 257 259 consideredLines.add(selectedLines[i]); 260 } 258 261 } else { 259 for (int i = 0; i < table.getRowCount(); ++i) 262 for (int i = 0; i < table.getRowCount(); ++i) { 260 263 consideredLines.add(Integer.valueOf(i)); 264 } 261 265 } 262 266 return consideredLines; … … 278 282 279 283 /** 280 * shows the nodes that correspond to the marked lines in the table. 284 * shows the nodes that correspond to the marked lines in the table. 281 285 * If no lines are marked in the table, show all nodes from the vector 282 286 */ … … 296 300 297 301 /** 298 * marks the nodes that correspond to the marked lines in the table. 302 * marks the nodes that correspond to the marked lines in the table. 299 303 * If no lines are marked in the table, mark all nodes from the vector 300 304 */ 301 305 public static void markNodesFromTable(JTable table, Vector<Node> nodes) { 302 OsmPrimitive[] osmp = { null};306 OsmPrimitive[] osmp = {null}; 303 307 DataSet ds = Main.getLayerManager().getEditDataSet(); 304 308 ds.setSelected(osmp); -
applications/editors/josm/plugins/public_transport/src/public_transport/GTFSImporterDialog.java
r32357 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 -
applications/editors/josm/plugins/public_transport/src/public_transport/GTFSJoinCommand.java
r33010 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 -
applications/editors/josm/plugins/public_transport/src/public_transport/GTFSStopTableModel.java
r32357 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 … … 19 20 private GTFSImporterAction controller = null; 20 21 21 public Vector<Node> nodes = new Vector< Node>();22 23 public Vector<LatLon> coors = new Vector< LatLon>();22 public Vector<Node> nodes = new Vector<>(); 23 24 public Vector<LatLon> coors = new Vector<>(); 24 25 25 26 private int idCol = -1; … … 99 100 } 100 101 101 /* 102 * tokenizes a line as follows: any comma outside a pair of double quotation marks is taken as field separator. In particular, neither \" nor \, 103 * have a special meaning. Returns the position of the next field separator, if any. Otherwise it returns -1. s - the string to tokenize. startPos 102 /** 103 * tokenizes a line as follows: any comma outside a pair of double quotation marks is taken as field separator. 104 * In particular, neither \" nor \, have a special meaning. Returns the position of the next field separator, if any. 105 * Otherwise it returns -1. s - the string to tokenize. startPos 104 106 * - the position of the last field separator plus 1 or the value 0. 105 107 */ … … 130 132 131 133 public void insertRow(int insPos, String s, Vector<Node> existingStops) { 132 String[] buf = { 134 String[] buf = {"", "", tr("pending")}; 133 135 int pos = tokenize(s, 0); 134 136 int oldPos = 0; -
applications/editors/josm/plugins/public_transport/src/public_transport/ItineraryTableModel.java
r32902 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 … … 48 49 49 50 public void insertRow(int insPos, Way way, String role) { 50 String[] buf = { "", ""};51 String[] buf = {"", ""}; 51 52 String curName = way.get("name"); 52 53 if (way.isIncomplete()) … … 99 100 --i; 100 101 } else if ((i > 0) && gapRequired && (ways.elementAt(i - 1) != null)) { 101 String[] buf = { "", ""};102 String[] buf = {"", ""}; 102 103 buf[0] = tr("[gap]"); 103 104 insertRow(i, buf); -
applications/editors/josm/plugins/public_transport/src/public_transport/PublicTransportAStar.java
r32902 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 … … 32 33 return node.equals(((NodeVertex) o).node); 33 34 } 34 35 35 36 @Override 36 37 public int hashCode() { … … 68 69 69 70 double totalDistance = 0; 70 for (int i = min; i < max; ++i) 71 totalDistance += way.getNode(i).getCoor() 72 .greatCircleDistance(way.getNode(i + 1).getCoor());71 for (int i = min; i < max; ++i) { 72 totalDistance += way.getNode(i).getCoor().greatCircleDistance(way.getNode(i + 1).getCoor()); 73 } 73 74 return totalDistance; 74 75 } … … 140 141 .greatCircleDistance(nodeVertex.node.getCoor()); 141 142 } 142 } ;143 } -
applications/editors/josm/plugins/public_transport/src/public_transport/PublicTransportPlugin.java
r32357 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 -
applications/editors/josm/plugins/public_transport/src/public_transport/RoutePatternAction.java
r32902 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 … … 60 61 RoutePatternAction root = null; 61 62 62 publicRoutesLSL(RoutePatternAction rpa) {63 RoutesLSL(RoutePatternAction rpa) { 63 64 root = rpa; 64 65 } … … 70 71 } 71 72 72 private static class RouteReference implements Comparable<RouteReference> {73 Relation route;74 75 public RouteReference(Relation route) {76 this.route = route;77 }78 79 @Override80 public int compareTo(RouteReference rr) {81 if (route.get("route") != null) {82 if (rr.route.get("route") == null)83 return -1;84 int result = route.get("route").compareTo(rr.route.get("route"));85 if (result != 0)86 return result;87 } else if (rr.route.get("route") != null)88 return 1;89 if (route.get("ref") != null) {90 if (rr.route.get("ref") == null)91 return -1;92 int result = route.get("ref").compareTo(rr.route.get("ref"));93 if (result != 0)94 return result;95 } else if (rr.route.get("ref") != null)96 return 1;97 if (route.get("to") != null) {98 if (rr.route.get("to") == null)99 return -1;100 int result = route.get("to").compareTo(rr.route.get("to"));101 if (result != 0)102 return result;103 } else if (rr.route.get("to") != null)104 return 1;105 if (route.get("direction") != null) {106 if (rr.route.get("direction") == null)107 return -1;108 int result = route.get("direction").compareTo(rr.route.get("direction"));109 if (result != 0)110 return result;111 } else if (rr.route.get("direction") != null)112 return 1;113 if (route.getId() < rr.route.getId())114 return -1;115 else if (route.getId() > rr.route.getId())116 return 1;117 return 0;118 }119 120 @Override121 public String toString() {122 String buf = route.get("route");123 if ((route.get("ref") != null) && (route.get("ref") != "")) {124 buf += " " + route.get("ref");125 }126 if ((route.get("loc_ref") != null) && (route.get("loc_ref") != "")) {127 buf += " [" + route.get("loc_ref") + "]";128 }129 130 if ((route.get("to") != null) && (route.get("to") != "")) {131 buf += ": " + route.get("to");132 } else if ((route.get("direction") != null) && (route.get("direction") != "")) {133 buf += " " + route.get("ref") + ": " + route.get("direction");134 } else {135 buf += " " + route.get("ref");136 }137 buf += tr(" [ID] {0}", Long.toString(route.getId()));138 139 return buf;140 }141 }142 143 73 private static class TagTableModel extends DefaultTableModel implements TableModelListener { 144 74 Relation relation = null; … … 148 78 boolean hasFixedKeys = true; 149 79 150 publicTagTableModel(boolean hasFixedKeys) {80 TagTableModel(boolean hasFixedKeys) { 151 81 this.hasFixedKeys = hasFixedKeys; 152 82 } … … 221 151 TreeMap<Integer, TableCellEditor> col2 = null; 222 152 223 publicCustomCellEditorTable() {153 CustomCellEditorTable() { 224 154 col1 = new TreeMap<>(); 225 155 col2 = new TreeMap<>(); … … 273 203 274 204 public void insertRow(int insPos, Node node, String role, double distance) { 275 String[] buf = { 205 String[] buf = {"", "", "", ""}; 276 206 String curName = node.get("name"); 277 207 if (curName != null) { … … 320 250 public double distance; 321 251 322 publicSegmentMetric(double fromLat, double fromLon, double toLat, double toLon,252 SegmentMetric(double fromLat, double fromLon, double toLat, double toLon, 323 253 double distance) { 324 254 this.distance = distance; … … 344 274 d2 = d2 * Math.cos(fromLat * Math.PI / 180.0); 345 275 o2 = o2 * Math.cos(fromLat * Math.PI / 180.0); 346 }347 }348 349 private static class StopReference implements Comparable<StopReference> {350 public int index = 0;351 352 public double pos = 0;353 354 public double distance = 0;355 356 public String name = "";357 358 public String role = "";359 360 public Node node;361 362 public StopReference(int inIndex, double inPos, double inDistance, String inName,363 String inRole, Node inNode) {364 index = inIndex;365 pos = inPos;366 distance = inDistance;367 name = inName;368 role = inRole;369 node = inNode;370 }371 372 @Override373 public int compareTo(StopReference sr) {374 if (this.index < sr.index)375 return -1;376 if (this.index > sr.index)377 return 1;378 if (this.pos < sr.pos)379 return -1;380 if (this.pos > sr.pos)381 return 1;382 return 0;383 276 } 384 277 } … … 480 373 relsList = new JList<>(relsListModel); 481 374 JScrollPane rpListSP = new JScrollPane(relsList); 482 String[] data = { 375 String[] data = {"1", "2", "3", "4", "5", "6"}; 483 376 relsListModel.copyInto(data); 484 377 relsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); … … 1141 1034 1142 1035 currentRoute.setMembers(null); 1143 for (int i = itemsToReflect.size() - 1; i >= 0; --i) 1036 for (int i = itemsToReflect.size() - 1; i >= 0; --i) { 1144 1037 currentRoute.addMember(itemsToReflect.elementAt(i)); 1145 for (int i = 0; i < otherItems.size(); ++i) 1038 } 1039 for (int i = 0; i < otherItems.size(); ++i) { 1146 1040 currentRoute.addMember(otherItems.elementAt(i)); 1041 } 1147 1042 1148 1043 refreshData(); … … 1155 1050 // Temp 1156 1051 /* 1157 * if (firstNode != null) { Vector< AStarAlgorithm.Edge > path = new PublicTransportAStar(firstNode, lastNode).shortestPath(); Iterator< 1052 * if (firstNode != null) { 1053 * Vector< AStarAlgorithm.Edge > path = new PublicTransportAStar(firstNode, lastNode).shortestPath(); Iterator< 1158 1054 * AStarAlgorithm.Edge > iter = path.iterator(); while (iter.hasNext()) { PublicTransportAStar.PartialWayEdge edge = 1159 1055 * (PublicTransportAStar.PartialWayEdge)iter.next(); System.out.print(edge.way.getUniqueId()); System.out.print("\t"); … … 1207 1103 Main.map.mapView.zoomTo(box); 1208 1104 } else if ("routePattern.itineraryMark".equals(event.getActionCommand())) { 1209 OsmPrimitive[] osmp = { null};1105 OsmPrimitive[] osmp = {null}; 1210 1106 Main.getLayerManager().getEditDataSet().setSelected(osmp); 1211 1107 markedWays.clear(); … … 1266 1162 if ((insPos > 0) && (insPos < itineraryData.getRowCount())) { 1267 1163 while ((insPos < itineraryData.getRowCount()) 1268 && (itineraryData.ways.elementAt(insPos) == null)) 1164 && (itineraryData.ways.elementAt(insPos) == null)) { 1269 1165 ++insPos; 1166 } 1270 1167 itineraryTable.removeRowSelectionInterval(0, itineraryData.getRowCount() - 1); 1271 1168 if (insPos < itineraryData.getRowCount()) … … 1436 1333 Main.map.mapView.zoomTo(box); 1437 1334 } else if ("routePattern.stoplistMark".equals(event.getActionCommand())) { 1438 OsmPrimitive[] osmp = { null};1335 OsmPrimitive[] osmp = {null}; 1439 1336 Main.getLayerManager().getEditDataSet().setSelected(osmp); 1440 1337 markedNodes.clear(); … … 1497 1394 if ((insPos > 0) && (insPos < stoplistData.getRowCount())) { 1498 1395 while ((insPos < stoplistData.getRowCount()) 1499 && (stoplistData.nodes.elementAt(insPos) == null)) 1396 && (stoplistData.nodes.elementAt(insPos) == null)) { 1500 1397 ++insPos; 1398 } 1501 1399 stoplistTable.removeRowSelectionInterval(0, stoplistData.getRowCount() - 1); 1502 1400 if (insPos < stoplistData.getRowCount()) … … 1726 1624 1727 1625 Iterator<RouteReference> iter = relRefs.iterator(); 1728 while (iter.hasNext()) 1626 while (iter.hasNext()) { 1729 1627 relsListModel.addElement(iter.next()); 1628 } 1730 1629 } else { 1731 1630 JOptionPane.showMessageDialog(null, -
applications/editors/josm/plugins/public_transport/src/public_transport/SettingsStoptypeCommand.java
r32902 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 … … 14 15 public class SettingsStoptypeCommand extends Command { 15 16 private static class HighwayRailway { 16 publicHighwayRailway(Node node) {17 HighwayRailway(Node node) { 17 18 this.node = node; 18 19 highway = node.get("highway"); -
applications/editors/josm/plugins/public_transport/src/public_transport/StopImporterAction.java
r32902 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 … … 199 200 200 201 Iterator<TrackReference> iter = trackRefs.iterator(); 201 while (iter.hasNext()) 202 while (iter.hasNext()) { 202 203 tracksListModel.addElement(iter.next()); 204 } 203 205 204 206 waypointTM = new WaypointTableModel(this); … … 277 279 Vector<Integer> consideredLines = new Vector<>(); 278 280 if (selectedLines.length > 0) { 279 for (int i = 0; i < selectedLines.length; ++i) 281 for (int i = 0; i < selectedLines.length; ++i) { 280 282 consideredLines.add(selectedLines[i]); 283 } 281 284 } else { 282 for (int i = 0; i < table.getRowCount(); ++i) 285 for (int i = 0; i < table.getRowCount(); ++i) { 283 286 consideredLines.add(Integer.valueOf(i)); 287 } 284 288 } 285 289 return consideredLines; … … 321 325 */ 322 326 public static void markNodesFromTable(JTable table, Vector<Node> nodes) { 323 OsmPrimitive[] osmp = { null};327 OsmPrimitive[] osmp = {null}; 324 328 DataSet ds = Main.getLayerManager().getEditDataSet(); 325 329 ds.setSelected(osmp); … … 415 419 private String defaultShelter = null; 416 420 417 publicFocusWaypointShelterAction(String defaultShelter) {421 FocusWaypointShelterAction(String defaultShelter) { 418 422 this.defaultShelter = defaultShelter; 419 423 } … … 461 465 private String defaultShelter = null; 462 466 463 publicFocusTrackStoplistShelterAction(String defaultShelter) {467 FocusTrackStoplistShelterAction(String defaultShelter) { 464 468 this.defaultShelter = defaultShelter; 465 469 } -
applications/editors/josm/plugins/public_transport/src/public_transport/StopImporterDialog.java
r32357 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 … … 68 69 tracksList = new JList<>(tracksListModel); 69 70 JScrollPane rpListSP = new JScrollPane(tracksList); 70 String[] data = { 71 String[] data = {"1", "2", "3", "4", "5", "6"}; 71 72 tracksListModel.copyInto(data); 72 73 tracksList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); … … 537 538 StopImporterAction root = null; 538 539 539 publicTracksLSL(StopImporterAction sia) {540 TracksLSL(StopImporterAction sia) { 540 541 root = sia; 541 542 } … … 549 550 root.tracksSelectionChanged(-1); 550 551 } 551 } ;552 } 552 553 } -
applications/editors/josm/plugins/public_transport/src/public_transport/TrackReference.java
r32357 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 … … 181 182 } 182 183 } 183 } ;184 } -
applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistAddCommand.java
r32357 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 -
applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistDeleteCommand.java
r32902 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 … … 47 48 } 48 49 } else { 49 for (int i = 0; i < stoplistTM.getRowCount(); ++i) 50 for (int i = 0; i < stoplistTM.getRowCount(); ++i) { 50 51 workingLines.add(Integer.valueOf(i)); 52 } 51 53 } 52 54 } … … 91 93 return tr("Public Transport: Delete track stop"); 92 94 } 93 } ;95 } -
applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistDetachCommand.java
r32902 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 … … 26 27 Vector<Integer> consideredLines = new Vector<>(); 27 28 if (selectedLines.length > 0) { 28 for (int i = 0; i < selectedLines.length; ++i) 29 for (int i = 0; i < selectedLines.length; ++i) { 29 30 consideredLines.add(selectedLines[i]); 31 } 30 32 } else { 31 for (int i = 0; i < stoplistTM.getRowCount(); ++i) 33 for (int i = 0; i < stoplistTM.getRowCount(); ++i) { 32 34 consideredLines.add(Integer.valueOf(i)); 35 } 33 36 } 34 37 -
applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistNameCommand.java
r32357 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 -
applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistRelocateCommand.java
r32357 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 -
applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistSortCommand.java
r32902 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 … … 36 37 int[] selectedLines = controller.getDialog().getStoplistTable().getSelectedRows(); 37 38 if (selectedLines.length > 0) { 38 for (int i = 0; i < selectedLines.length; ++i) 39 for (int i = 0; i < selectedLines.length; ++i) { 39 40 workingLines.add(selectedLines[i]); 41 } 40 42 } else { 41 for (int i = 0; i < stoplistTM.getRowCount(); ++i) 43 for (int i = 0; i < stoplistTM.getRowCount(); ++i) { 42 44 workingLines.add(Integer.valueOf(i)); 45 } 43 46 } 44 47 } … … 102 105 public double startTime = 0; 103 106 104 publicNodeSortEntry(Node node, String time, String name, TransText shelter,107 NodeSortEntry(Node node, String time, String name, TransText shelter, 105 108 double startTime) { 106 109 this.node = node; -
applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistTableModel.java
r32357 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 … … 93 94 94 95 public void insertRow(int insPos, Node node, String time, String name, TransText shelter) { 95 Object[] buf = { 96 Object[] buf = {time, name, shelter}; 96 97 if (insPos == -1) { 97 98 nodes.addElement(node); -
applications/editors/josm/plugins/public_transport/src/public_transport/TrackSuggestStopsCommand.java
r32357 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 … … 73 74 while (siter.hasNext()) { 74 75 Iterator<WayPoint> witer = siter.next().getWayPoints().iterator(); 75 while (witer.hasNext()) 76 while (witer.hasNext()) { 76 77 wayPoints.add(witer.next()); 78 } 77 79 } 78 80 Vector<Double> wayPointsDist = new Vector<>(wayPoints.size()); -
applications/editors/josm/plugins/public_transport/src/public_transport/TransText.java
r32357 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 -
applications/editors/josm/plugins/public_transport/src/public_transport/WaypointTableModel.java
r32357 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 … … 62 63 Node node = controller.createNode(wp.getCoor(), name); 63 64 64 Object[] buf = { 65 Object[] buf = {time, name, new TransText(null)}; 65 66 if (insPos == -1) { 66 67 nodes.addElement(node); -
applications/editors/josm/plugins/public_transport/src/public_transport/WaypointsDetachCommand.java
r32902 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 … … 26 27 Vector<Integer> consideredLines = new Vector<>(); 27 28 if (selectedLines.length > 0) { 28 for (int i = 0; i < selectedLines.length; ++i) 29 for (int i = 0; i < selectedLines.length; ++i) { 29 30 consideredLines.add(selectedLines[i]); 31 } 30 32 } else { 31 for (int i = 0; i < waypointTM.getRowCount(); ++i) 33 for (int i = 0; i < waypointTM.getRowCount(); ++i) { 32 34 consideredLines.add(Integer.valueOf(i)); 35 } 33 36 } 34 37 -
applications/editors/josm/plugins/public_transport/src/public_transport/WaypointsDisableCommand.java
r32902 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 … … 27 28 Vector<Integer> consideredLines = new Vector<>(); 28 29 if (selectedLines.length > 0) { 29 for (int i = 0; i < selectedLines.length; ++i) 30 for (int i = 0; i < selectedLines.length; ++i) { 30 31 consideredLines.add(selectedLines[i]); 32 } 31 33 } else { 32 for (int i = 0; i < waypointTM.getRowCount(); ++i) 34 for (int i = 0; i < waypointTM.getRowCount(); ++i) { 33 35 consideredLines.add(Integer.valueOf(i)); 36 } 34 37 } 35 38 … … 79 82 return tr("Public Transport: Disable waypoints"); 80 83 } 81 } ;84 } -
applications/editors/josm/plugins/public_transport/src/public_transport/WaypointsEnableCommand.java
r32902 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3 … … 27 28 Vector<Integer> consideredLines = new Vector<>(); 28 29 if (selectedLines.length > 0) { 29 for (int i = 0; i < selectedLines.length; ++i) 30 for (int i = 0; i < selectedLines.length; ++i) { 30 31 consideredLines.add(selectedLines[i]); 32 } 31 33 } else { 32 for (int i = 0; i < waypointTM.getRowCount(); ++i) 34 for (int i = 0; i < waypointTM.getRowCount(); ++i) { 33 35 consideredLines.add(Integer.valueOf(i)); 36 } 34 37 } 35 38 -
applications/editors/josm/plugins/public_transport/src/public_transport/WaypointsNameCommand.java
r32357 r33053 1 // License: GPL. For details, see LICENSE file. 1 2 package public_transport; 2 3
Note:
See TracChangeset
for help on using the changeset viewer.