Changeset 30737 in osm for applications/editors/josm/plugins/wikipedia
- Timestamp:
- 2014-10-18T23:07:52+02:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/wikipedia/src/org/wikipedia
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaAddNamesAction.java
r30629 r30737 31 31 public void actionPerformed(ActionEvent e) { 32 32 final WikipediaApp.WikipediaLangArticle wp = WikipediaApp.WikipediaLangArticle.parseTag("wikipedia", getWikipediaValue()); 33 List<String[]> tags = new ArrayList< String[]>();33 List<String[]> tags = new ArrayList<>(); 34 34 for (WikipediaApp.WikipediaLangArticle i : WikipediaApp.getInterwikiArticles(wp.lang, wp.article)) { 35 35 if (useWikipediaLangArticle(i)) { -
applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaApp.java
r30448 r30737 54 54 NodeList nodes = (NodeList) xpathPlacemark.evaluate(doc, XPathConstants.NODESET); 55 55 // construct WikipediaEntry for each XML element 56 List<WikipediaEntry> entries = new ArrayList< WikipediaEntry>(nodes.getLength());56 List<WikipediaEntry> entries = new ArrayList<>(nodes.getLength()); 57 57 for (int i = 0; i < nodes.getLength(); i++) { 58 58 final String[] coord = xpathCoord.evaluate(nodes.item(i)).split(","); … … 79 79 System.out.println("Wikipedia: GET " + url); 80 80 final Scanner scanner = new Scanner(new URL(url).openStream(), "UTF-8").useDelimiter("\n"); 81 final List<WikipediaEntry> entries = new ArrayList< WikipediaEntry>();81 final List<WikipediaEntry> entries = new ArrayList<>(); 82 82 while (scanner.hasNext()) { 83 83 final String article = scanner.next().trim().replace("_", " "); … … 92 92 static List<WikipediaEntry> getEntriesFromClipboard(final String wikipediaLang) { 93 93 final List<String> clipboardLines = Arrays.asList(Utils.getClipboardContent().split("[\\n\\r]+")); 94 return new ArrayList< WikipediaEntry>(Utils.transform(clipboardLines, new Function<String, WikipediaEntry>() {94 return new ArrayList<>(Utils.transform(clipboardLines, new Function<String, WikipediaEntry>() { 95 95 96 96 @Override … … 102 102 103 103 static void updateWIWOSMStatus(String wikipediaLang, Collection<WikipediaEntry> entries) { 104 Collection<String> articleNames = new ArrayList< String>();104 Collection<String> articleNames = new ArrayList<>(); 105 105 for (WikipediaEntry i : entries) { 106 106 articleNames.add(i.wikipediaArticle); 107 107 } 108 Map<String, Boolean> status = new HashMap< String, Boolean>();108 Map<String, Boolean> status = new HashMap<>(); 109 109 if (!articleNames.isEmpty()) { 110 110 final String url = "https://tools.wmflabs.org/wiwosm/osmjson/getGeoJSON.php?action=check" … … 162 162 static Collection<WikipediaLangArticle> getInterwikiArticles(String wikipediaLang, String article) { 163 163 try { 164 Collection<WikipediaLangArticle> r = new ArrayList< WikipediaLangArticle>();164 Collection<WikipediaLangArticle> r = new ArrayList<>(); 165 165 final String url = "https://" + wikipediaLang + ".wikipedia.org/w/api.php" + 166 166 "?action=query" + -
applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaToggleDialog.java
r30532 r30737 59 59 String titleContext = null; 60 60 final StringProperty wikipediaLang = new StringProperty("wikipedia.lang", LanguageInfo.getJOSMLocaleCode().substring(0, 2)); 61 final Set<String> articles = new HashSet< String>();61 final Set<String> articles = new HashSet<>(); 62 62 final DefaultListModel<WikipediaEntry> model = new DefaultListModel<>(); 63 63 final JList<WikipediaEntry> list = new JList<WikipediaEntry>(model) {
Note:
See TracChangeset
for help on using the changeset viewer.