diff --git a/HouseNumberTaggingTool/src/org/openstreetmap/josm/plugins/housenumbertool/LaunchAction.java b/HouseNumberTaggingTool/src/org/openstreetmap/josm/plugins/housenumbertool/LaunchAction.java
index 400aa9ffe..44b091941 100644
|
a
|
b
|
import java.awt.event.KeyEvent;
|
| 8 | 8 | import java.io.File; |
| 9 | 9 | import java.util.Set; |
| 10 | 10 | |
| | 11 | import javax.swing.JFrame; |
| | 12 | |
| 11 | 13 | import org.openstreetmap.josm.actions.JosmAction; |
| 12 | 14 | import org.openstreetmap.josm.data.osm.DataSelectionListener; |
| 13 | 15 | import org.openstreetmap.josm.data.osm.OsmPrimitive; |
| 14 | 16 | import org.openstreetmap.josm.data.osm.event.SelectionEventManager; |
| | 17 | import org.openstreetmap.josm.gui.MainApplication; |
| 15 | 18 | import org.openstreetmap.josm.tools.Shortcut; |
| 16 | 19 | |
| 17 | 20 | /** |
| … |
… |
public class LaunchAction extends JosmAction implements DataSelectionListener {
|
| 66 | 69 | |
| 67 | 70 | TagDialog dialog = new TagDialog(pluginDir, selection, switchIncrement); |
| 68 | 71 | dialog.showDialog(); |
| | 72 | |
| | 73 | // give the focus back to JOSM |
| | 74 | JFrame mainFrame = MainApplication.getMainFrame(); |
| | 75 | if (mainFrame != null) { |
| | 76 | mainFrame.toFront(); |
| | 77 | mainFrame.requestFocus(); |
| | 78 | } |
| | 79 | if (MainApplication.isDisplayingMapView()) { |
| | 80 | MainApplication.getMap().mapView.requestFocusInWindow(); |
| | 81 | } |
| 69 | 82 | } |
| 70 | 83 | |
| 71 | 84 | @Override |
diff --git a/HouseNumberTaggingTool/src/org/openstreetmap/josm/plugins/housenumbertool/TagDialog.java b/HouseNumberTaggingTool/src/org/openstreetmap/josm/plugins/housenumbertool/TagDialog.java
index 917a44c58..379432c55 100644
|
a
|
b
|
public class TagDialog extends ExtendedDialog {
|
| 147 | 147 | setupDialog(); |
| 148 | 148 | getRootPane().setDefaultButton(defaultButton); |
| 149 | 149 | |
| 150 | | // middle of the screen |
| 151 | | setLocationRelativeTo(null); |
| | 150 | // center on the JOSM main window |
| | 151 | setLocationRelativeTo(MainApplication.getMainFrame()); |
| 152 | 152 | |
| 153 | 153 | SwingUtilities.invokeLater(() -> { |
| 154 | 154 | housenumber.requestFocus(); |