1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.plugins.streetside.gui;
|
---|
3 |
|
---|
4 | import java.io.Serial;
|
---|
5 |
|
---|
6 | import org.openstreetmap.josm.gui.dialogs.ToggleDialog;
|
---|
7 | import org.openstreetmap.josm.plugins.streetside.gui.imageinfo.StreetsideViewerPanel;
|
---|
8 |
|
---|
9 | /**
|
---|
10 | * Toggle dialog that shows an image and some buttons.
|
---|
11 | *
|
---|
12 | * @author nokutu
|
---|
13 | */
|
---|
14 |
|
---|
15 | public final class StreetsideViewerDialog extends ToggleDialog {
|
---|
16 |
|
---|
17 | @Serial
|
---|
18 | private static final long serialVersionUID = 6424974077669812562L;
|
---|
19 |
|
---|
20 | private static final String BASE_TITLE = "360° Streetside Viewer";
|
---|
21 |
|
---|
22 | private static StreetsideViewerDialog instance;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * Object containing the shown image and that handles zoom and drag
|
---|
26 | */
|
---|
27 | private final StreetsideViewerPanel streetsideViewerPanel;
|
---|
28 |
|
---|
29 | private StreetsideViewerDialog() {
|
---|
30 | super(StreetsideViewerDialog.BASE_TITLE, "streetside-viewer", "Open Streetside Viewer window", null, 200, true,
|
---|
31 | StreetsidePreferenceSetting.class);
|
---|
32 | streetsideViewerPanel = new StreetsideViewerPanel();
|
---|
33 | createLayout(streetsideViewerPanel, true, null);
|
---|
34 | }
|
---|
35 |
|
---|
36 | /**
|
---|
37 | * Returns the unique instance of the class.
|
---|
38 | *
|
---|
39 | * @return The unique instance of the class.
|
---|
40 | */
|
---|
41 | public static synchronized StreetsideViewerDialog getInstance() {
|
---|
42 | if (StreetsideViewerDialog.instance == null) {
|
---|
43 | StreetsideViewerDialog.instance = new StreetsideViewerDialog();
|
---|
44 | }
|
---|
45 | return StreetsideViewerDialog.instance;
|
---|
46 | }
|
---|
47 |
|
---|
48 | /**
|
---|
49 | * Destroys the unique instance of the class.
|
---|
50 | */
|
---|
51 | public static synchronized void destroyInstance() {
|
---|
52 | StreetsideViewerDialog.instance = null;
|
---|
53 | }
|
---|
54 |
|
---|
55 | public StreetsideViewerPanel getStreetsideViewerPanel() {
|
---|
56 | return streetsideViewerPanel;
|
---|
57 | }
|
---|
58 | }
|
---|