Changeset 20729 in osm for applications/editors/josm/plugins/public_transport/src
- Timestamp:
- 2010-03-29T15:59:26+02:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/public_transport/src/public_transport
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/public_transport/src/public_transport/RoutePatternAction.java
r20674 r20729 1858 1858 else if ("tram".equals(currentRoute.get("route"))) 1859 1859 { 1860 stopKey = " highway";1860 stopKey = "railway"; 1861 1861 stopValue = "tram_stop"; 1862 1862 } -
applications/editors/josm/plugins/public_transport/src/public_transport/StopImporterAction.java
r20728 r20729 23 23 import javax.swing.DefaultListModel; 24 24 import javax.swing.JButton; 25 import javax.swing.JComboBox; 25 26 import javax.swing.JDialog; 26 27 import javax.swing.JFileChooser; … … 497 498 public void insertRow(int insPos, WayPoint wp) 498 499 { 499 Node node = createNode(wp.getCoor(), "");500 501 500 String[] buf = { "", "" }; 502 501 buf[0] = wp.getString("time"); … … 506 505 if (buf[1] == null) 507 506 buf[1] = ""; 507 508 Node node = createNode(wp.getCoor(), buf[1]); 509 508 510 if (insPos == -1) 509 511 { … … 542 544 private static JTabbedPane tabbedPane = null; 543 545 private static DefaultListModel tracksListModel = null; 546 private static JComboBox cbStoptype = null; 544 547 private static JList tracksList = null; 545 548 private static JTextField tfGPSTimeStart = null; … … 622 625 contentPane.setLayout(gridbag); 623 626 624 /*JLabel*/ label = new JLabel("T ime on your GPS device");627 /*JLabel*/ label = new JLabel("Type of stops to add"); 625 628 626 629 layoutCons.gridx = 0; … … 633 636 contentPane.add(label); 634 637 638 cbStoptype = new JComboBox(); 639 cbStoptype.setEditable(false); 640 cbStoptype.addItem("bus"); 641 cbStoptype.addItem("tram"); 642 cbStoptype.addItem("light_rail"); 643 cbStoptype.addItem("subway"); 644 cbStoptype.addItem("rail"); 645 cbStoptype.setActionCommand("stopImporter.settingsStoptype"); 646 cbStoptype.addActionListener(this); 647 648 layoutCons.gridx = 0; 649 layoutCons.gridy = 1; 650 layoutCons.gridwidth = 1; 651 layoutCons.weightx = 0.0; 652 layoutCons.weighty = 0.0; 653 layoutCons.fill = GridBagConstraints.BOTH; 654 gridbag.setConstraints(cbStoptype, layoutCons); 655 contentPane.add(cbStoptype); 656 657 /*JLabel*/ label = new JLabel("Time on your GPS device"); 658 659 layoutCons.gridx = 0; 660 layoutCons.gridy = 2; 661 layoutCons.gridwidth = 2; 662 layoutCons.weightx = 0.0; 663 layoutCons.weighty = 0.0; 664 layoutCons.fill = GridBagConstraints.BOTH; 665 gridbag.setConstraints(label, layoutCons); 666 contentPane.add(label); 667 635 668 tfGPSTimeStart = new JTextField("00:00:00", 15); 636 669 tfGPSTimeStart.setActionCommand("stopImporter.settingsGPSTimeStart"); … … 638 671 639 672 layoutCons.gridx = 0; 640 layoutCons.gridy = 1;673 layoutCons.gridy = 3; 641 674 layoutCons.gridwidth = 1; 642 675 layoutCons.weightx = 0.0; … … 649 682 650 683 layoutCons.gridx = 1; 651 layoutCons.gridy = 1;684 layoutCons.gridy = 3; 652 685 layoutCons.gridwidth = 1; 653 686 layoutCons.weightx = 0.0; … … 660 693 661 694 layoutCons.gridx = 0; 662 layoutCons.gridy = 2;695 layoutCons.gridy = 4; 663 696 layoutCons.gridwidth = 2; 664 697 layoutCons.weightx = 0.0; … … 673 706 674 707 layoutCons.gridx = 0; 675 layoutCons.gridy = 3;708 layoutCons.gridy = 5; 676 709 layoutCons.gridwidth = 1; 677 710 layoutCons.weightx = 0.0; … … 684 717 685 718 layoutCons.gridx = 1; 686 layoutCons.gridy = 3;719 layoutCons.gridy = 5; 687 720 layoutCons.gridwidth = 1; 688 721 layoutCons.weightx = 0.0; … … 695 728 696 729 layoutCons.gridx = 0; 697 layoutCons.gridy = 4;730 layoutCons.gridy = 6; 698 731 layoutCons.gridwidth = 2; 699 732 layoutCons.weightx = 0.0; … … 708 741 709 742 layoutCons.gridx = 0; 710 layoutCons.gridy = 5;743 layoutCons.gridy = 7; 711 744 layoutCons.gridwidth = 1; 712 745 layoutCons.weightx = 0.0; … … 719 752 720 753 layoutCons.gridx = 1; 721 layoutCons.gridy = 5;754 layoutCons.gridy = 7; 722 755 layoutCons.gridwidth = 1; 723 756 layoutCons.weightx = 0.0; … … 730 763 731 764 layoutCons.gridx = 0; 732 layoutCons.gridy = 6;765 layoutCons.gridy = 8; 733 766 layoutCons.gridwidth = 2; 734 767 layoutCons.weightx = 0.0; … … 743 776 744 777 layoutCons.gridx = 0; 745 layoutCons.gridy = 7;778 layoutCons.gridy = 9; 746 779 layoutCons.gridwidth = 1; 747 780 layoutCons.weightx = 0.0; … … 754 787 755 788 layoutCons.gridx = 1; 756 layoutCons.gridy = 7;789 layoutCons.gridy = 9; 757 790 layoutCons.gridwidth = 1; 758 791 layoutCons.weightx = 0.0; … … 767 800 768 801 layoutCons.gridx = 0; 769 layoutCons.gridy = 8;802 layoutCons.gridy = 10; 770 803 layoutCons.gridwidth = 3; 771 804 layoutCons.weightx = 1.0; … … 1374 1407 } 1375 1408 } 1409 else if ("stopImporter.settingsStoptype".equals(event.getActionCommand())) 1410 { 1411 for (int i = 0; i < waypointTM.getRowCount(); ++i) 1412 { 1413 if ((Node)waypointTM.nodes.elementAt(i) != null) 1414 { 1415 Node node = (Node)waypointTM.nodes.elementAt(i); 1416 node.remove("highway"); 1417 node.remove("railway"); 1418 if ("bus".equals((String)cbStoptype.getSelectedItem())) 1419 node.put("highway", "bus_stop"); 1420 else if ("tram".equals((String)cbStoptype.getSelectedItem())) 1421 node.put("railway", "tram_stop"); 1422 else if ("light_rail".equals((String)cbStoptype.getSelectedItem())) 1423 node.put("railway", "station"); 1424 else if ("subway".equals((String)cbStoptype.getSelectedItem())) 1425 node.put("railway", "station"); 1426 else if ("rail".equals((String)cbStoptype.getSelectedItem())) 1427 node.put("railway", "station"); 1428 } 1429 } 1430 for (int j = 0; j < tracksListModel.size(); ++j) 1431 { 1432 TrackReference track = (TrackReference)tracksListModel.elementAt(j); 1433 for (int i = 0; i < track.stoplistTM.getRowCount(); ++i) 1434 { 1435 if ((Node)track.stoplistTM.nodes.elementAt(i) != null) 1436 { 1437 Node node = (Node)track.stoplistTM.nodes.elementAt(i); 1438 node.remove("highway"); 1439 node.remove("railway"); 1440 if ("bus".equals((String)cbStoptype.getSelectedItem())) 1441 node.put("highway", "bus_stop"); 1442 else if ("tram".equals((String)cbStoptype.getSelectedItem())) 1443 node.put("railway", "tram_stop"); 1444 else if ("light_rail".equals((String)cbStoptype.getSelectedItem())) 1445 node.put("railway", "station"); 1446 else if ("subway".equals((String)cbStoptype.getSelectedItem())) 1447 node.put("railway", "station"); 1448 else if ("rail".equals((String)cbStoptype.getSelectedItem())) 1449 node.put("railway", "station"); 1450 } 1451 } 1452 } 1453 } 1376 1454 } 1377 1455 … … 1489 1567 { 1490 1568 Node node = new Node(latLon); 1491 node.put("highway", "bus_stop"); 1569 if ("bus".equals((String)cbStoptype.getSelectedItem())) 1570 node.put("highway", "bus_stop"); 1571 else if ("tram".equals((String)cbStoptype.getSelectedItem())) 1572 node.put("railway", "tram_stop"); 1573 else if ("light_rail".equals((String)cbStoptype.getSelectedItem())) 1574 node.put("railway", "station"); 1575 else if ("subway".equals((String)cbStoptype.getSelectedItem())) 1576 node.put("railway", "station"); 1577 else if ("rail".equals((String)cbStoptype.getSelectedItem())) 1578 node.put("railway", "station"); 1492 1579 node.put("name", name); 1493 1580 if (Main.main.getCurrentDataSet() == null)
Note:
See TracChangeset
for help on using the changeset viewer.