source: osm/applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/gui/StreetsideViewerDialog.java

Last change on this file was 36228, checked in by taylor.smock, 2 months ago

StreetSide: Update to official API

This also moves the plugin to Java 21 (mostly for virtual threads), reformats the
code to match the JOSM standard (4 spaces), and fixes a bunch of lint issues.

Additionally, a lot of cruft from when this plugin was copied from Mapillary was
removed. That was largely related to image import, uploading, and login.

File size: 1.8 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.plugins.streetside.gui;
3
4import java.io.Serial;
5
6import org.openstreetmap.josm.gui.dialogs.ToggleDialog;
7import 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
15public 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}
Note: See TracBrowser for help on using the repository browser.