Ignore:
Timestamp:
2017-09-26T01:28:38+02:00 (7 years ago)
Author:
donvip
Message:

update to JOSM 12900

Location:
applications/editors/josm/plugins/wikipedia
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/wikipedia/build.xml

    r33641 r33673  
    55    <property name="commit.message" value="Commit message"/>
    66    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    7     <property name="plugin.main.version" value="12880"/>
     7    <property name="plugin.main.version" value="12900"/>
    88    <property name="plugin.canloadatruntime" value="true"/>
    99
  • applications/editors/josm/plugins/wikipedia/src/org/wikipedia/actions/WikipediaCopyTemplate.java

    r33541 r33673  
    1414import org.openstreetmap.josm.actions.JosmAction;
    1515import org.openstreetmap.josm.data.Preferences;
    16 import org.openstreetmap.josm.data.Preferences.pref;
     16import org.openstreetmap.josm.data.StructUtils;
     17import org.openstreetmap.josm.data.StructUtils.StructEntry;
    1718import org.openstreetmap.josm.data.osm.DataSet;
    1819import org.openstreetmap.josm.data.osm.Node;
     
    3233
    3334    private static final List<CoordCopyTemplateEntry> TEMPLATE_ENTRIES =
    34             Main.pref.getListOfStructs("wikipedia.copytemplates", DEFAULT_TEMPLATES, CoordCopyTemplateEntry.class);
     35            StructUtils.getListOfStructs(Main.pref, "wikipedia.copytemplates", DEFAULT_TEMPLATES, CoordCopyTemplateEntry.class);
    3536
    3637    public WikipediaCopyTemplate() {
     
    5051    @SuppressWarnings("WeakerAccess")
    5152    public static class CoordCopyTemplateEntry {
    52         @pref
     53        @StructEntry
    5354        public String name;
    54         @pref
     55        @StructEntry
    5556        public String id;
    56         @pref
     57        @StructEntry
    5758        public String pattern;
    5859
  • applications/editors/josm/plugins/wikipedia/src/org/wikipedia/gui/WikidataItemSearchDialog.java

    r33541 r33673  
    2424import org.openstreetmap.josm.data.osm.DataSet;
    2525import org.openstreetmap.josm.data.osm.Tag;
     26import org.openstreetmap.josm.data.tagging.ac.AutoCompletionItem;
    2627import org.openstreetmap.josm.gui.ExtendedDialog;
    2728import org.openstreetmap.josm.gui.MainApplication;
    2829import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingComboBox;
    29 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionListItem;
     30import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager;
    3031import org.openstreetmap.josm.gui.util.GuiHelper;
    3132import org.openstreetmap.josm.tools.GBC;
     
    4546        this.targetKey = new AutoCompletingComboBox();
    4647        this.targetKey.setEditable(true);
    47         this.targetKey.setSelectedItem(new AutoCompletionListItem("wikidata"));
     48        this.targetKey.setSelectedItem(new AutoCompletionItem("wikidata"));
    4849
    4950        final JPanel panel = new JPanel(new GridBagLayout());
     
    7980            return;
    8081        }
    81         final Collection<AutoCompletionListItem> keys = new TreeSet<>();
     82        final Collection<AutoCompletionItem> keys = new TreeSet<>();
    8283        // from http://wiki.openstreetmap.org/wiki/Proposed_features/Wikidata#Tagging
    83         keys.add(new AutoCompletionListItem("wikidata"));
    84         keys.add(new AutoCompletionListItem("operator:wikidata"));
    85         keys.add(new AutoCompletionListItem("brand:wikidata"));
    86         keys.add(new AutoCompletionListItem("architect:wikidata"));
    87         keys.add(new AutoCompletionListItem("artist:wikidata"));
    88         keys.add(new AutoCompletionListItem("subject:wikidata"));
    89         keys.add(new AutoCompletionListItem("name:etymology:wikidata"));
    90         editDataSet.getAutoCompletionManager().getKeys().stream()
     84        keys.add(new AutoCompletionItem("wikidata"));
     85        keys.add(new AutoCompletionItem("operator:wikidata"));
     86        keys.add(new AutoCompletionItem("brand:wikidata"));
     87        keys.add(new AutoCompletionItem("architect:wikidata"));
     88        keys.add(new AutoCompletionItem("artist:wikidata"));
     89        keys.add(new AutoCompletionItem("subject:wikidata"));
     90        keys.add(new AutoCompletionItem("name:etymology:wikidata"));
     91        AutoCompletionManager.of(editDataSet).getTagKeys().stream()
    9192                .filter(v -> v.getValue().contains("wikidata"))
    9293                .forEach(keys::add);
    93         targetKey.setPossibleACItems(keys);
     94        targetKey.setPossibleAcItems(keys);
    9495    }
    9596
  • applications/editors/josm/plugins/wikipedia/src/org/wikipedia/gui/WikipediaToggleDialog.java

    r33541 r33673  
    223223                List<WikipediaEntry> getEntries() {
    224224                    return WikipediaApp.forLanguage(wikipediaLang.get())
    225                             .getEntriesFromCategory(category, Main.pref.getInteger("wikipedia.depth", 3));
     225                            .getEntriesFromCategory(category, Main.pref.getInt("wikipedia.depth", 3));
    226226                }
    227227            }.execute();
  • applications/editors/josm/plugins/wikipedia/src/org/wikipedia/gui/WikosmDownloadSource.java

    r33641 r33673  
    2626import org.openstreetmap.josm.gui.MainApplication;
    2727import org.openstreetmap.josm.gui.download.AbstractDownloadSourcePanel;
     28import org.openstreetmap.josm.gui.download.DownloadDialog;
    2829import org.openstreetmap.josm.gui.download.DownloadSettings;
    2930import org.openstreetmap.josm.gui.download.DownloadSource;
     
    4445
    4546    @Override
    46     public AbstractDownloadSourcePanel<WikosmDownloadData> createPanel() {
     47    public AbstractDownloadSourcePanel<WikosmDownloadData> createPanel(DownloadDialog dialog) {
    4748        return new WikosmDownloadSourcePanel(this);
    4849    }
     
    165166                    + "parent relations and for nodes, additionally, parent ways"));
    166167            referrers.setSelected(Main.pref.getBoolean("wikosm.downloadprimitive.referrers", true));
    167             referrers.addActionListener(e -> Main.pref.put("wikosm.downloadprimitive.referrers", referrers.isSelected()));
     168            referrers.addActionListener(e -> Main.pref.putBoolean("wikosm.downloadprimitive.referrers", referrers.isSelected()));
    168169
    169170            fullRel = new JCheckBox(tr("Download relation members"));
    170171            fullRel.setToolTipText(tr("Select if the members of a relation should be downloaded as well"));
    171172            fullRel.setSelected(Main.pref.getBoolean("wikosm.downloadprimitive.full", true));
    172             fullRel.addActionListener(e -> Main.pref.put("wikosm.downloadprimitive.full", fullRel.isSelected()));
     173            fullRel.addActionListener(e -> Main.pref.putBoolean("wikosm.downloadprimitive.full", fullRel.isSelected()));
    173174
    174175            // https://stackoverflow.com/questions/527719/how-to-add-hyperlink-in-jlabel
  • applications/editors/josm/plugins/wikipedia/src/org/wikipedia/io/WikosmDownloadReader.java

    r33626 r33673  
    77import org.openstreetmap.josm.data.coor.LatLon;
    88import org.openstreetmap.josm.data.osm.*;
    9 import org.openstreetmap.josm.data.preferences.CollectionProperty;
     9import org.openstreetmap.josm.data.preferences.ListProperty;
    1010import org.openstreetmap.josm.data.preferences.StringProperty;
    1111import org.openstreetmap.josm.gui.progress.ProgressMonitor;
     
    5151//    public static final ListProperty WIKOSM_SERVER_HISTORY = new ListProperty("download.wikosm.servers",
    5252//            Arrays.asList("http://88.99.164.208/bigdata/namespace/wdq/sparql"));
    53     public static final CollectionProperty WIKOSM_SERVER_HISTORY = new CollectionProperty("download.wikosm.servers",
     53    public static final ListProperty WIKOSM_SERVER_HISTORY = new ListProperty("download.wikosm.servers",
    5454            Arrays.asList("http://88.99.164.208/bigdata/namespace/wdq/sparql"));
    5555
Note: See TracChangeset for help on using the changeset viewer.