- Timestamp:
- 2024-01-15T20:25:02+01:00 (10 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java
r18934 r18937 147 147 MapFrame map = MainApplication.getMap(); 148 148 synchronized (ImageViewerDialog.class) { 149 if (dialog != null && map != null && map.getToggleDialog(ImageViewerDialog.class) != null) { 150 map.removeToggleDialog(dialog); 149 if (dialog != null) { 150 if (map != null && map.getToggleDialog(ImageViewerDialog.class) != null) { 151 map.removeToggleDialog(dialog); 152 } 153 dialog.destroy(); 151 154 } 152 155 } … … 181 184 // We need to check to see whether or not the worker is shut down. See #22922 for details. 182 185 if (!MainApplication.worker.isShutdown() && this.isDialogShowing()) { 183 MainApplication.worker.execute(() -> GuiHelper.runInEDT(() -> { 184 Component selected = this.layers.getSelectedComponent(); 185 if (selected instanceof MoveImgDisplayPanel) { 186 ((MoveImgDisplayPanel<?>) selected).fireModelUpdate(); 187 } 188 })); 186 MainApplication.worker.execute(() -> GuiHelper.runInEDT(this::showNotify)); 189 187 } 190 188 }); … … 303 301 if (geoImageLayers.isEmpty()) { 304 302 this.layers.setVisible(false); 303 hideNotify(); 304 if (hasInstance()) 305 destroyInstance(); 305 306 } else { 306 307 this.layers.setVisible(true); … … 315 316 this.getImageTabs().filter(m -> m.layer.containsImage(this.currentEntry)).mapToInt(this.layers::indexOfComponent).findFirst() 316 317 .ifPresent(this.layers::setSelectedIndex); 318 } else if (selected == null) { 319 updateTitle(); 317 320 } 318 321 this.layers.invalidate(); … … 352 355 removeImageTab(((MoveImgDisplayPanel<?>) layers.getComponentAt(index)).layer); 353 356 getImageTabs().forEach(m -> m.setVisible(m.isVisible())); 357 showNotify(); 354 358 return; 355 359 } … … 417 421 imageRemoveFromDiskAction.destroy(); 418 422 imageZoomAction.destroy(); 423 toggleAction.destroy(); 419 424 cancelLoadingImage(); 420 425 super.destroy(); 421 destroyInstance();422 426 } 423 427 … … 1066 1070 btnCollapse.setVisible(!isDocked); 1067 1071 } 1068 this.updateLayers(true);1069 1072 } 1070 1073
Note:
See TracChangeset
for help on using the changeset viewer.