Changeset 18686 in josm for trunk/src/org
- Timestamp:
- 2023-03-08T20:00:36+01:00 (21 months ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/DialogsPanel.java
r17374 r18686 105 105 } else { 106 106 dlg.hideDialog(); 107 } 108 } 109 110 /** 111 * Remove a {@link ToggleDialog} from the list of known dialogs and trigger reconstruct. 112 * @param toggleDialog The dialog to remove 113 * @since 18686 114 */ 115 public void remove(ToggleDialog toggleDialog) { 116 remove(toggleDialog, true); 117 } 118 119 /** 120 * Remove a {@link ToggleDialog} from the list of known dialogs. 121 * @param toggleDialog The dialog to remove 122 * @param doReconstruct <code>true</code> if reconstruction should be triggered. 123 * @since 18686 124 */ 125 public void remove(ToggleDialog toggleDialog, boolean doReconstruct) { 126 toggleDialog.setDialogsPanel(null); 127 final JPanel oldPanel = panels.get(allDialogs.indexOf(toggleDialog)); 128 allDialogs.remove(toggleDialog); 129 panels.remove(oldPanel); 130 mSpltPane.remove(oldPanel); 131 if (doReconstruct && !allDialogs.isEmpty()) { 132 reconstruct(Action.ELEMENT_SHRINKS, toggleDialog); 107 133 } 108 134 } … … 326 352 @Override 327 353 public void destroy() { 328 for (ToggleDialog t : allDialogs) {354 for (ToggleDialog t : new ArrayList<>(allDialogs)) { 329 355 try { 330 356 t.destroy(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
r18216 r18686 478 478 @Override 479 479 public void destroy() { 480 dialogsPanel = null; 480 if (dialogsPanel != null) { 481 dialogsPanel.remove(this); 482 dialogsPanel = null; 483 } 481 484 rememberHeight(); 482 485 closeDetachedDialog(); -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java
r18685 r18686 145 145 */ 146 146 private static void destroyInstance() { 147 MapFrame map = MainApplication.getMap(); 148 synchronized (ImageViewerDialog.class) { 149 if (dialog != null && map != null && map.getToggleDialog(ImageViewerDialog.class) != null) { 150 map.removeToggleDialog(dialog); 151 } 152 } 147 153 dialog = null; 148 154 }
Note:
See TracChangeset
for help on using the changeset viewer.