Changeset 30532 in osm for applications/editors/josm/plugins/editgpx/src/org/openstreetmap
- Timestamp:
- 2014-07-14T04:18:06+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/GPXLayerImportAction.java
r28204 r30532 37 37 class GPXLayerImportAction extends AbstractAction { 38 38 39 40 private static final long serialVersionUID = 5794897888911798168L;41 39 private EditGpxData data; 42 40 public Object importing = new Object(); //used for synchronization … … 54 52 public void activateImport() { 55 53 Box panel = Box.createVerticalBox(); 56 DefaultListModel dModel= new DefaultListModel();54 DefaultListModel<GpxLayer> dModel = new DefaultListModel<>(); 57 55 58 final JList layerList = new JList(dModel);56 final JList<GpxLayer> layerList = new JList<>(dModel); 59 57 Collection<Layer> data = Main.map.mapView.getAllLayers(); 60 58 int layerCnt = 0; … … 62 60 for (Layer l : data){ 63 61 if(l instanceof GpxLayer){ 64 dModel.addElement( l);62 dModel.addElement((GpxLayer) l); 65 63 layerCnt++; 66 64 } … … 69 67 layerList.setSelectionInterval(0, layerCnt-1); 70 68 layerList.setCellRenderer(new DefaultListCellRenderer(){ 71 @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {69 @Override public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) { 72 70 Layer layer = (Layer)value; 73 71 JLabel label = (JLabel)super.getListCellRendererComponent(list, … … 104 102 } 105 103 synchronized(importing) { 106 for (Object o : layerList.getSelectedValues()) { 107 GpxLayer gpx = (GpxLayer )o; 104 for (GpxLayer gpx : layerList.getSelectedValuesList()) { 108 105 this.data.load(gpx.data); 109 106 }
Note:
See TracChangeset
for help on using the changeset viewer.