source: osm/applications/editors/josm/plugins/OsmInspectorPlugin/src/org/openstreetmap/josm/plugins/osminspector/OsmInspectorPlugin.java

Last change on this file was 36176, checked in by taylor.smock, 6 months ago

Fix error_prone version issue and dependency updates (see #23218)

Plugins with an ivy_settings.xml file were not reading the error_prone version
from the core ivysettings.xml file. This removes redundant ivy_settings.xml files
and includes the core ivysettings.xml file in the remaining ivy_settings.xml
files.

Dependency updates:
apache-commons:

  • zstd-jni: 1.5.2-5 -> 1.5.5-6
  • commons-compress: 1.22 -> 1.24.0
  • commons-io: 2.11.0 -> 2.14.0
  • commons-lang3: 3.12.0 -> 3.13.0

apache-http:

  • httpclient5: 5.1.2 -> 5.2.1
  • Drops legacy httpcore, httpclient, and httpmime dependencies

ejml: 0.41 -> 0.43.1

  • ejml now requires Java 11

flatlaf: 3.2 -> 3.2.2
geotools: 28.2 -> 30.0

  • geotools now requires Java 11
  • 30.0 had some breaking API changes, but provided a migration script

jackson: 2.14.0 -> 2.15.3
jna: 5.12.1 -> 5.13.0
log4j: 2.19.0 -> 2.21.0
lwjgl: 3.3.1 -> 3.3.3
pbf:

  • protobuf-java: 3.20.3 -> 3.24.4
File size: 4.6 KB
Line 
1package org.openstreetmap.josm.plugins.osminspector;
2
3import static org.openstreetmap.josm.tools.I18n.tr;
4
5import java.awt.event.KeyEvent;
6import java.awt.event.MouseEvent;
7import java.awt.event.MouseListener;
8
9import org.openstreetmap.josm.data.Bounds;
10import org.openstreetmap.josm.data.UserIdentityManager;
11import org.openstreetmap.josm.gui.MainApplication;
12import org.openstreetmap.josm.gui.MapFrame;
13import org.openstreetmap.josm.gui.NavigatableComponent;
14import org.openstreetmap.josm.gui.NavigatableComponent.ZoomChangeListener;
15import org.openstreetmap.josm.gui.download.DownloadDialog;
16import org.openstreetmap.josm.gui.download.DownloadSelection;
17import org.openstreetmap.josm.plugins.Plugin;
18import org.openstreetmap.josm.plugins.PluginInformation;
19import org.openstreetmap.josm.spi.preferences.Config;
20import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;
21import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;
22import org.openstreetmap.josm.tools.Shortcut;
23
24public class OsmInspectorPlugin extends Plugin
25implements ZoomChangeListener,
26MouseListener, PreferenceChangedListener, DownloadSelection{
27
28 /** The JOSM user identity manager, it is used for obtaining the user name */
29 private final UserIdentityManager userIdentityManager;
30
31
32 /** The bounding box from where the MapDust bugs are down-loaded */
33 //private Bounds bBox;
34
35 private OsmInspectorLayer inspectorLayer;
36
37 public OsmInspectorPlugin(PluginInformation info) {
38 super(info);
39 userIdentityManager = UserIdentityManager.getInstance();
40 initializePlugin();
41 }
42
43 /**
44 * Initialize the <code>OsmInspectorPlugin</code> object. Creates the
45 * <code>OsmInspectorGUI</code> and initializes the following variables with
46 *.
47 */
48 private void initializePlugin() {
49 Shortcut.registerShortcut("OsmInspector", tr("Toggle: {0}", tr("Open OsmInspector")),
50 KeyEvent.VK_1, Shortcut.ALT_SHIFT);
51 //String name = "Osm Inspector error reports";
52 //String tooltip = "Activates the Osm Inspector reporter plugin";
53
54 /* add default values for static variables */
55 Config.getPref().put("osmInspector.nickname", "osmi");
56 Config.getPref().putBoolean("osmInspector.showBugs", true);
57 Config.getPref().put("osmInspector.version", getPluginInformation().version);
58 Config.getPref().put("osmInspector.localVersion",getPluginInformation().localversion);
59 inspectorLayer = null;
60 }
61 @Override
62 public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
63 MainApplication.getToolbar().register( new ImportOsmInspectorBugsAction( this ) );
64 if (newFrame == null) {
65 /* if new MapFrame is null, remove listener */
66 NavigatableComponent.removeZoomChangeListener(this);
67 } else {
68 /* add MapDust dialog window */
69 if (MainApplication.getMap() != null && MainApplication.getMap().mapView != null) {
70 /* add MapdustGUI */
71 MainApplication.getMap().setBounds(newFrame.getBounds());
72
73 /* add Listeners */
74 NavigatableComponent.addZoomChangeListener(this);
75 MainApplication.getMap().mapView.addMouseListener(this);
76 Config.getPref().addPreferenceChangeListener(this);
77 /* put username to preferences */
78 Config.getPref().put("osmInspector.josmUserName",
79 userIdentityManager.getUserName());
80 MainApplication.getToolbar().control.add( new ImportOsmInspectorBugsAction( this ) );
81 }
82 }
83 }
84
85 @Override
86 public void zoomChanged() {
87
88 }
89
90 @Override
91 //
92 // Delegate feature selection to layer
93 //
94 public void mouseClicked(MouseEvent e) {
95 if (inspectorLayer != null) {
96 inspectorLayer.selectFeatures(e.getX(), e.getY());
97 }
98 }
99
100 @Override
101 public void mouseEntered(MouseEvent e) {
102
103 }
104
105 @Override
106 public void mouseExited(MouseEvent e) {
107
108 }
109
110 @Override
111 public void mousePressed(MouseEvent e) {
112
113 }
114
115 @Override
116 public void mouseReleased(MouseEvent e) {
117
118 }
119
120 @Override
121 public void preferenceChanged(PreferenceChangeEvent e) {
122
123 }
124
125 public OsmInspectorLayer getLayer()
126 {
127 return inspectorLayer;
128 }
129
130 public void setLayer( OsmInspectorLayer theLayer )
131 {
132 inspectorLayer = theLayer;
133 }
134
135 @Override
136 public void addGui(DownloadDialog gui) {
137 // TODO Auto-generated method stub
138 }
139
140 @Override
141 public void setDownloadArea(Bounds bounds) {
142 // TODO Auto-generated method stub
143 }
144}
Note: See TracBrowser for help on using the repository browser.