Changeset 20835 in osm
- Timestamp:
- 2010-04-08T09:01:03+02:00 (15 years ago)
- Location:
- applications/editors/josm
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/public_transport/src/public_transport/StopImporterAction.java
r20834 r20835 131 131 if ((!inEvent) && (dialog.gpsTimeStartValid()) && (currentTrack != null)) 132 132 Main.main.undoRedo.add(new TrackStoplistRelocateCommand(this)); 133 /* {134 currentTrack.gpsSyncTime = dialog.getGpsTimeStart();135 currentTrack.relocateNodes();136 }*/137 133 } 138 134 else if ("stopImporter.settingsStopwatchStart".equals(event.getActionCommand())) … … 140 136 if ((!inEvent) && (dialog.stopwatchStartValid()) && (currentTrack != null)) 141 137 Main.main.undoRedo.add(new TrackStoplistRelocateCommand(this)); 142 /* {143 currentTrack.stopwatchStart = dialog.getStopwatchStart();144 currentTrack.relocateNodes();145 }*/146 138 } 147 139 else if ("stopImporter.settingsTimeWindow".equals(event.getActionCommand())) … … 264 256 waypointTM.addRow(waypoint); 265 257 } 266 dialog. getWaypointsTable().setModel(waypointTM);258 dialog.setWaypointsTableModel(waypointTM); 267 259 } 268 260 else -
applications/editors/josm/plugins/public_transport/src/public_transport/StopImporterDialog.java
r20834 r20835 21 21 import java.util.zip.GZIPInputStream; 22 22 23 import javax.swing.DefaultCellEditor; 23 24 import javax.swing.DefaultListModel; 24 25 import javax.swing.JButton; … … 435 436 waypointTable = new JTable(); 436 437 tableSP = new JScrollPane(waypointTable); 437 438 438 439 layoutCons.gridx = 0; 439 440 layoutCons.gridy = 0; … … 623 624 { 624 625 return waypointTable; 626 } 627 628 public void setWaypointsTableModel(WaypointTableModel model) 629 { 630 waypointTable.setModel(model); 631 JComboBox comboBox = new JComboBox(); 632 comboBox.addItem(""); 633 comboBox.addItem("yes"); 634 comboBox.addItem("no"); 635 comboBox.addItem("implicit"); 636 waypointTable.getColumnModel().getColumn(2) 637 .setCellEditor(new DefaultCellEditor(comboBox)); 638 int width = waypointTable.getPreferredSize().width; 639 waypointTable.getColumnModel().getColumn(0).setPreferredWidth((int)(width * 0.4)); 640 waypointTable.getColumnModel().getColumn(1).setPreferredWidth((int)(width * 0.5)); 641 waypointTable.getColumnModel().getColumn(2).setPreferredWidth((int)(width * 0.1)); 625 642 } 626 643 -
applications/editors/josm/plugins/public_transport/src/public_transport/WaypointTableModel.java
r20791 r20835 27 27 addColumn("Time"); 28 28 addColumn("Stopname"); 29 addColumn("Shelter"); 29 30 addTableModelListener(this); 30 31 } … … 32 33 public boolean isCellEditable(int row, int column) 33 34 { 34 if (column == 1)35 if (column >= 1) 35 36 return true; 36 37 return false; … … 54 55 public void insertRow(int insPos, WayPoint wp) 55 56 { 56 String[] buf = { "", "" };57 String[] buf = { "", "", "" }; 57 58 buf[0] = wp.getString("time"); 58 59 if (buf[0] == null) … … 63 64 64 65 Node node = controller.createNode(wp.getCoor(), buf[1]); 65 66 66 67 if (insPos == -1) 67 68 { … … 91 92 return; 92 93 Main.main.undoRedo.add(new WaypointsNameCommand 93 (this, e.getFirstRow(), (String)getValueAt(e.getFirstRow(), 1))); 94 (this, e.getFirstRow(), (String)getValueAt(e.getFirstRow(), 1), 95 (String)getValueAt(e.getFirstRow(), 2))); 94 96 } 95 /* {96 if (nodes.elementAt(e.getFirstRow()) != null)97 {98 Node node = nodes.elementAt(e.getFirstRow());99 node.put("name", (String)getValueAt(e.getFirstRow(), 1));100 }101 }*/102 97 } 103 98 }; -
applications/editors/josm/plugins/public_transport/src/public_transport/WaypointsEnableCommand.java
r20772 r20835 52 52 Node node = StopImporterAction.createNode 53 53 (waypointTM.coors.elementAt(j), type, (String)waypointTM.getValueAt(j, 1)); 54 if ("".equals((String)waypointTM.getValueAt(j, 2))) 55 node.put("shelter", null); 56 else 57 node.put("shelter", (String)waypointTM.getValueAt(j, 2)); 54 58 waypointTM.nodes.set(j, node); 55 59 } -
applications/editors/josm/plugins/public_transport/src/public_transport/WaypointsNameCommand.java
r20791 r20835 17 17 private String oldName = null; 18 18 private String name = null; 19 private String oldShelter = null; 20 private String shelter = null; 19 21 20 public WaypointsNameCommand(WaypointTableModel waypointTM, int workingLine, String name) 22 public WaypointsNameCommand 23 (WaypointTableModel waypointTM, int workingLine, String name, String shelter) 21 24 { 22 25 this.waypointTM = waypointTM; 23 26 this.workingLine = workingLine; 24 27 if (waypointTM.nodes.elementAt(workingLine) != null) 28 { 25 29 oldName = waypointTM.nodes.elementAt(workingLine).get("name"); 30 oldShelter = waypointTM.nodes.elementAt(workingLine).get("shelter"); 31 } 26 32 this.name = name; 33 this.shelter = shelter; 34 if ("".equals(shelter)) 35 shelter = null; 27 36 } 28 37 … … 32 41 { 33 42 waypointTM.nodes.elementAt(workingLine).put("name", name); 43 waypointTM.nodes.elementAt(workingLine).put("shelter", shelter); 34 44 waypointTM.inEvent = true; 35 45 waypointTM.setValueAt(name, workingLine, 1); 46 if (shelter == null) 47 waypointTM.setValueAt("", workingLine, 2); 48 else 49 waypointTM.setValueAt(shelter, workingLine, 2); 36 50 waypointTM.inEvent = false; 37 51 } … … 44 58 { 45 59 waypointTM.nodes.elementAt(workingLine).put("name", oldName); 60 waypointTM.nodes.elementAt(workingLine).put("shelter", oldShelter); 46 61 waypointTM.inEvent = true; 47 62 waypointTM.setValueAt(oldName, workingLine, 1); 63 if (oldShelter == null) 64 waypointTM.setValueAt("", workingLine, 2); 65 else 66 waypointTM.setValueAt(oldShelter, workingLine, 2); 48 67 waypointTM.inEvent = false; 49 68 }
Note:
See TracChangeset
for help on using the changeset viewer.