Changeset 33673 in osm
- Timestamp:
- 2017-09-26T01:28:38+02:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/wikipedia
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/wikipedia/build.xml
r33641 r33673 5 5 <property name="commit.message" value="Commit message"/> 6 6 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 7 <property name="plugin.main.version" value="12 880"/>7 <property name="plugin.main.version" value="12900"/> 8 8 <property name="plugin.canloadatruntime" value="true"/> 9 9 -
applications/editors/josm/plugins/wikipedia/src/org/wikipedia/actions/WikipediaCopyTemplate.java
r33541 r33673 14 14 import org.openstreetmap.josm.actions.JosmAction; 15 15 import org.openstreetmap.josm.data.Preferences; 16 import org.openstreetmap.josm.data.Preferences.pref; 16 import org.openstreetmap.josm.data.StructUtils; 17 import org.openstreetmap.josm.data.StructUtils.StructEntry; 17 18 import org.openstreetmap.josm.data.osm.DataSet; 18 19 import org.openstreetmap.josm.data.osm.Node; … … 32 33 33 34 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); 35 36 36 37 public WikipediaCopyTemplate() { … … 50 51 @SuppressWarnings("WeakerAccess") 51 52 public static class CoordCopyTemplateEntry { 52 @ pref53 @StructEntry 53 54 public String name; 54 @ pref55 @StructEntry 55 56 public String id; 56 @ pref57 @StructEntry 57 58 public String pattern; 58 59 -
applications/editors/josm/plugins/wikipedia/src/org/wikipedia/gui/WikidataItemSearchDialog.java
r33541 r33673 24 24 import org.openstreetmap.josm.data.osm.DataSet; 25 25 import org.openstreetmap.josm.data.osm.Tag; 26 import org.openstreetmap.josm.data.tagging.ac.AutoCompletionItem; 26 27 import org.openstreetmap.josm.gui.ExtendedDialog; 27 28 import org.openstreetmap.josm.gui.MainApplication; 28 29 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingComboBox; 29 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletion ListItem;30 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager; 30 31 import org.openstreetmap.josm.gui.util.GuiHelper; 31 32 import org.openstreetmap.josm.tools.GBC; … … 45 46 this.targetKey = new AutoCompletingComboBox(); 46 47 this.targetKey.setEditable(true); 47 this.targetKey.setSelectedItem(new AutoCompletion ListItem("wikidata"));48 this.targetKey.setSelectedItem(new AutoCompletionItem("wikidata")); 48 49 49 50 final JPanel panel = new JPanel(new GridBagLayout()); … … 79 80 return; 80 81 } 81 final Collection<AutoCompletion ListItem> keys = new TreeSet<>();82 final Collection<AutoCompletionItem> keys = new TreeSet<>(); 82 83 // from http://wiki.openstreetmap.org/wiki/Proposed_features/Wikidata#Tagging 83 keys.add(new AutoCompletion ListItem("wikidata"));84 keys.add(new AutoCompletion ListItem("operator:wikidata"));85 keys.add(new AutoCompletion ListItem("brand:wikidata"));86 keys.add(new AutoCompletion ListItem("architect:wikidata"));87 keys.add(new AutoCompletion ListItem("artist:wikidata"));88 keys.add(new AutoCompletion ListItem("subject:wikidata"));89 keys.add(new AutoCompletion ListItem("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() 91 92 .filter(v -> v.getValue().contains("wikidata")) 92 93 .forEach(keys::add); 93 targetKey.setPossibleA CItems(keys);94 targetKey.setPossibleAcItems(keys); 94 95 } 95 96 -
applications/editors/josm/plugins/wikipedia/src/org/wikipedia/gui/WikipediaToggleDialog.java
r33541 r33673 223 223 List<WikipediaEntry> getEntries() { 224 224 return WikipediaApp.forLanguage(wikipediaLang.get()) 225 .getEntriesFromCategory(category, Main.pref.getInt eger("wikipedia.depth", 3));225 .getEntriesFromCategory(category, Main.pref.getInt("wikipedia.depth", 3)); 226 226 } 227 227 }.execute(); -
applications/editors/josm/plugins/wikipedia/src/org/wikipedia/gui/WikosmDownloadSource.java
r33641 r33673 26 26 import org.openstreetmap.josm.gui.MainApplication; 27 27 import org.openstreetmap.josm.gui.download.AbstractDownloadSourcePanel; 28 import org.openstreetmap.josm.gui.download.DownloadDialog; 28 29 import org.openstreetmap.josm.gui.download.DownloadSettings; 29 30 import org.openstreetmap.josm.gui.download.DownloadSource; … … 44 45 45 46 @Override 46 public AbstractDownloadSourcePanel<WikosmDownloadData> createPanel( ) {47 public AbstractDownloadSourcePanel<WikosmDownloadData> createPanel(DownloadDialog dialog) { 47 48 return new WikosmDownloadSourcePanel(this); 48 49 } … … 165 166 + "parent relations and for nodes, additionally, parent ways")); 166 167 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())); 168 169 169 170 fullRel = new JCheckBox(tr("Download relation members")); 170 171 fullRel.setToolTipText(tr("Select if the members of a relation should be downloaded as well")); 171 172 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())); 173 174 174 175 // https://stackoverflow.com/questions/527719/how-to-add-hyperlink-in-jlabel -
applications/editors/josm/plugins/wikipedia/src/org/wikipedia/io/WikosmDownloadReader.java
r33626 r33673 7 7 import org.openstreetmap.josm.data.coor.LatLon; 8 8 import org.openstreetmap.josm.data.osm.*; 9 import org.openstreetmap.josm.data.preferences. CollectionProperty;9 import org.openstreetmap.josm.data.preferences.ListProperty; 10 10 import org.openstreetmap.josm.data.preferences.StringProperty; 11 11 import org.openstreetmap.josm.gui.progress.ProgressMonitor; … … 51 51 // public static final ListProperty WIKOSM_SERVER_HISTORY = new ListProperty("download.wikosm.servers", 52 52 // 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", 54 54 Arrays.asList("http://88.99.164.208/bigdata/namespace/wdq/sparql")); 55 55
Note:
See TracChangeset
for help on using the changeset viewer.