Changeset 10192 in josm
- Timestamp:
- 2016-05-11T20:42:43+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/SessionLoadAction.java
r9296 r10192 52 52 Arrays.asList(SessionImporter.FILE_FILTER, FileFilterAllFiles.getInstance()), 53 53 SessionImporter.FILE_FILTER, JFileChooser.FILES_ONLY, "lastDirectory"); 54 if (fc == null) return; 54 if (fc == null) 55 return; 55 56 File file = fc.getSelectedFile(); 56 57 boolean zip = Utils.hasExtension(file, "joz"); … … 114 115 @Override 115 116 public void run() { 116 if (canceled) return; 117 if (!layers.isEmpty()) { 118 Layer firstLayer = layers.get(0); 119 boolean noMap = Main.map == null; 120 if (noMap) { 121 Main.main.createMapFrame(firstLayer, viewport); 122 } 123 for (Layer l : layers) { 124 if (canceled) return; 125 Main.main.addLayer(l, (ViewportData) null); 126 } 127 if (active != null) { 128 Main.map.mapView.setActiveLayer(active); 129 } 130 if (noMap) { 131 Main.map.setVisible(true); 132 } 133 } 134 for (Runnable task : postLoadTasks) { 135 if (canceled) return; 136 if (task == null) { 137 continue; 138 } 139 task.run(); 140 } 117 if (canceled) 118 return; 119 addLayers(); 120 runPostLoadTasks(); 141 121 } 142 122 }); 123 } 124 125 private void addLayers() { 126 if (layers != null && !layers.isEmpty()) { 127 Layer firstLayer = layers.get(0); 128 boolean noMap = Main.map == null; 129 if (noMap) { 130 Main.main.createMapFrame(firstLayer, viewport); 131 } 132 for (Layer l : layers) { 133 if (canceled) 134 return; 135 Main.main.addLayer(l, (ViewportData) null); 136 } 137 if (active != null) { 138 Main.map.mapView.setActiveLayer(active); 139 } 140 if (noMap) { 141 Main.map.setVisible(true); 142 } 143 } 144 } 145 146 private void runPostLoadTasks() { 147 for (Runnable task : postLoadTasks) { 148 if (canceled) 149 return; 150 if (task == null) { 151 continue; 152 } 153 task.run(); 154 } 143 155 } 144 156
Note:
See TracChangeset
for help on using the changeset viewer.