Changeset 2969 in josm for trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java
- Timestamp:
- 12.02.2010 20:01:55 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java
r2931 r2969 44 44 private boolean centerView = false; 45 45 46 // Only one instance of that class 47 static private ImageViewerDialog INSTANCE = null;46 // Only one instance of that class is present at one time 47 private static ImageViewerDialog dialog; 48 48 49 49 private boolean collapseButtonClicked = false; 50 50 51 static void newInstance() { 52 dialog = new ImageViewerDialog(); 53 } 54 51 55 public static ImageViewerDialog getInstance() { 52 if ( INSTANCE== null) {53 INSTANCE = new ImageViewerDialog();54 } 55 return INSTANCE;56 if (dialog == null) { 57 throw new AssertionError(); // a new instance needs to be created first 58 } 59 return dialog; 56 60 } 57 61 … … 63 67 super(tr("Geotagged Images"), "geoimage", tr("Display geotagged images"), Shortcut.registerShortcut("tools:geotagged", tr("Tool: {0}", tr("Display geotagged images")), KeyEvent.VK_Y, Shortcut.GROUP_EDIT), 200); 64 68 65 if (INSTANCE != null) {66 throw new IllegalStateException("Image viewer dialog should not be instanciated twice !");67 }68 69 69 /* Don't show a detached dialog right from the start. */ 70 70 if (isShowing && !isDocked) { 71 71 setIsShowing(false); 72 72 } 73 74 INSTANCE = this;75 73 76 74 JPanel content = new JPanel(); … … 254 252 // osd.append(tr("\nImage gps time: {0}", Long.toString(entry.getGpsTime().getTime()))); 255 253 //} 256 254 257 255 imgDisplay.setOsdText(osd.toString()); 258 256 } else {
Note: See TracChangeset
for help on using the changeset viewer.
