Changeset 20752 in osm for applications/editors/josm/plugins
- Timestamp:
- 2010-03-30T16:38:59+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/public_transport/src/public_transport/StopImporterAction.java
r20751 r20752 812 812 { 813 813 BoundingXYVisitor box = new BoundingXYVisitor(); 814 if (dialog.getWaypointsTable().getSelectedRowCount() > 0) 815 { 816 for (int i = 0; i < waypointTM.getRowCount(); ++i) 817 { 818 if ((dialog.getWaypointsTable().isRowSelected(i)) && 819 (waypointTM.nodes.elementAt(i) != null)) 820 { 821 waypointTM.nodes.elementAt(i).visit(box); 822 } 823 } 824 } 825 else 826 { 827 for (int i = 0; i < waypointTM.getRowCount(); ++i) 828 { 829 if (waypointTM.nodes.elementAt(i) != null) 830 waypointTM.nodes.elementAt(i).visit(box); 831 } 814 Vector< Integer > consideredLines = getConsideredLines 815 (dialog.getWaypointsTable()); 816 for (int i = 0; i < consideredLines.size(); ++i) 817 { 818 int j = consideredLines.elementAt(i); 819 if (waypointTM.nodes.elementAt(j) != null) 820 waypointTM.nodes.elementAt(j).visit(box); 832 821 } 833 822 if (box.getBounds() == null) … … 840 829 OsmPrimitive[] osmp = { null }; 841 830 Main.main.getCurrentDataSet().setSelected(osmp); 842 if (dialog.getWaypointsTable().getSelectedRowCount() > 0) 843 { 844 for (int i = 0; i < waypointTM.getRowCount(); ++i) 845 { 846 if ((dialog.getWaypointsTable().isRowSelected(i)) && 847 (waypointTM.nodes.elementAt(i) != null)) 848 { 849 Main.main.getCurrentDataSet().addSelected(waypointTM.nodes.elementAt(i)); 850 } 851 } 852 } 853 else 854 { 855 for (int i = 0; i < waypointTM.getRowCount(); ++i) 856 { 857 if (waypointTM.nodes.elementAt(i) != null) 858 Main.main.getCurrentDataSet().addSelected(waypointTM.nodes.elementAt(i)); 859 } 831 Vector< Integer > consideredLines = getConsideredLines 832 (dialog.getWaypointsTable()); 833 for (int i = 0; i < consideredLines.size(); ++i) 834 { 835 int j = consideredLines.elementAt(i); 836 if (waypointTM.nodes.elementAt(j) != null) 837 Main.main.getCurrentDataSet().addSelected(waypointTM.nodes.elementAt(j)); 860 838 } 861 839 } … … 1058 1036 return node; 1059 1037 } 1060 1038 1039 /* returns a collection of all slected lines or 1040 a collection of all lines otherwise */ 1041 public static Vector< Integer > getConsideredLines(JTable table) 1042 { 1043 int[] selectedLines = table.getSelectedRows(); 1044 Vector< Integer > consideredLines = new Vector< Integer >(); 1045 if (selectedLines.length > 0) 1046 { 1047 for (int i = 0; i < selectedLines.length; ++i) 1048 consideredLines.add(selectedLines[i]); 1049 } 1050 else 1051 { 1052 for (int i = 0; i < table.getRowCount(); ++i) 1053 consideredLines.add(new Integer(i)); 1054 } 1055 return consideredLines; 1056 } 1057 1061 1058 private static String timeOf(double t) 1062 1059 {
Note:
See TracChangeset
for help on using the changeset viewer.