Changeset 26202 in osm for applications
- Timestamp:
- 2011-06-29T21:47:54+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/GPXLayerImportAction.java
r23189 r26202 58 58 final JList layerList = new JList(dModel); 59 59 Collection<Layer> data = Main.map.mapView.getAllLayers(); 60 Layer lastLayer = null;61 60 int layerCnt = 0; 62 61 … … 64 63 if(l instanceof GpxLayer){ 65 64 dModel.addElement(l); 66 lastLayer = l;67 65 layerCnt++; 68 66 } 69 67 } 70 if(layerCnt == 1){71 layerList.setSelectedValue(lastLayer, true);72 }73 68 if(layerCnt > 0){ 69 layerList.setSelectionInterval(0, layerCnt-1); 74 70 layerList.setCellRenderer(new DefaultListCellRenderer(){ 75 71 @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { … … 103 99 } 104 100 105 GpxLayer gpx = (GpxLayer)layerList.getSelectedValue(); 106 107 synchronized(importing) { 108 this.data.load(gpx.data, dropFirst.isSelected()); 101 for (Object o : layerList.getSelectedValues()) { 102 GpxLayer gpx = (GpxLayer )o; 103 synchronized(importing) { 104 this.data.load(gpx.data, dropFirst.isSelected()); 105 } 109 106 } 110 107 Main.map.mapView.repaint();
Note:
See TracChangeset
for help on using the changeset viewer.