-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from floscher/update-josm-api
Replace calls of JOSM API that is now removed (since JOSM 14215)
- Loading branch information
Showing
7 changed files
with
42 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
package org.openstreetmap.josm.plugins.fieldpapers; | ||
|
||
import static org.openstreetmap.josm.gui.help.HelpUtil.ht; | ||
import static org.openstreetmap.josm.tools.I18n.tr; | ||
|
||
import java.awt.event.KeyEvent; | ||
|
||
import javax.swing.JMenu; | ||
import javax.swing.JMenuItem; | ||
|
||
import org.openstreetmap.josm.data.Preferences; | ||
import org.openstreetmap.josm.data.preferences.StringProperty; | ||
import org.openstreetmap.josm.gui.MainApplication; | ||
import org.openstreetmap.josm.gui.MainMenu; | ||
import org.openstreetmap.josm.plugins.Plugin; | ||
import org.openstreetmap.josm.plugins.PluginInformation; | ||
import org.openstreetmap.josm.tools.Logging; | ||
|
||
/** | ||
* Main class for the field papers plugin. | ||
|
@@ -20,14 +16,22 @@ | |
* @author Frederik Ramm <[email protected]> | ||
* | ||
*/ | ||
public class FieldPapersPlugin extends Plugin | ||
{ | ||
public FieldPapersPlugin(PluginInformation info) | ||
{ | ||
public class FieldPapersPlugin extends Plugin { | ||
public static final StringProperty LAST_USED_ID = new StringProperty("fieldpapers.last-used-id", ""); | ||
|
||
public static final StringProperty BASE_URL = new StringProperty("fieldpapers.base-url", "http://fieldpapers.org/"); | ||
|
||
public FieldPapersPlugin(PluginInformation info) { | ||
super(info); | ||
|
||
MainMenu menu = MainApplication.getMenu(); | ||
JMenu fpMenu = menu.addMenu("Field Papers", tr("Field Papers"), KeyEvent.VK_K, menu.getDefaultMenuPos(), ht("/Plugin/FieldPapers")); | ||
fpMenu.add(new JMenuItem(new FieldPapersAddLayerAction())); | ||
// Migrate old setting, remove this in one of the next versions. | ||
final String oldValue = Preferences.main().get("fieldpapers-base-url"); | ||
if (!"".equals(oldValue) && !BASE_URL.isSet()) { | ||
BASE_URL.put(oldValue); | ||
Preferences.main().put("fieldpapers-base-url", null); | ||
Logging.info("Preference `fieldpapers-base-url`={0} was renamed to `fieldpapers.base-url`!", oldValue); | ||
} | ||
|
||
MainApplication.getMenu().imageryMenu.add(new JMenuItem(new FieldPapersAddLayerAction())); | ||
} | ||
} |