Ticket #15709: josm_fix-r13264-regression_imageviewerdialog-opening-two-windows-if-undocked_bugfix-variant1.patch
File josm_fix-r13264-regression_imageviewerdialog-opening-two-windows-if-undocked_bugfix-variant1.patch, 1.5 KB (added by , 6 years ago) |
---|
-
src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
999 999 1000 1000 MapFrame map = MainApplication.getMap(); 1001 1001 if (map.getToggleDialog(ImageViewerDialog.class) == null) { 1002 ImageViewerDialog.createInstance(); 1002 1003 map.addToggleDialog(ImageViewerDialog.getInstance()); 1003 1004 } 1004 1005 } -
src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java
58 58 59 59 private boolean collapseButtonClicked; 60 60 61 public static void createInstance() { 62 if (dialog != null) 63 throw new IllegalStateException("ImageViewerDialog instance was already created"); 64 dialog = new ImageViewerDialog(); 65 } 66 61 67 /** 62 68 * Replies the unique instance of this dialog 63 69 * @return the unique instance 64 70 */ 65 71 public static ImageViewerDialog getInstance() { 66 72 if (dialog == null) 67 dialog = new ImageViewerDialog();73 throw new AssertionError("a new instance needs to be created first"); 68 74 return dialog; 69 75 } 70 76