Changeset 28293 in osm for applications/editors/josm/plugins/wikipedia/src/org
- Timestamp:
- 2012-04-14T15:05:44+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaToggleDialog.java
r28244 r28293 49 49 } 50 50 final StringProperty wikipediaLang = new StringProperty("wikipedia.lang", LanguageInfo.getJOSMLocaleCode().substring(0, 2)); 51 final DefaultListModel <WikipediaEntry> model = new DefaultListModel<WikipediaEntry>();52 final JList <WikipediaEntry> list = new JList<WikipediaEntry>(model) {51 final DefaultListModel model = new DefaultListModel(); 52 final JList list = new JList(model) { 53 53 54 54 { … … 59 59 if (e.getClickCount() == 2 && getSelectedValue() != null) { 60 60 BoundingXYVisitor bbox = new BoundingXYVisitor(); 61 bbox.visit( getSelectedValue().coordinate);61 bbox.visit(((WikipediaEntry) getSelectedValue()).coordinate); 62 62 Main.map.mapView.recalculateCenterScale(bbox); 63 63 } … … 70 70 final int index = locationToIndex(e.getPoint()); 71 71 if (index >= 0) { 72 return "<html>" + model.getElementAt(index).description + "</html>";72 return "<html>" + ((WikipediaEntry) model.getElementAt(index)).description + "</html>"; 73 73 } else { 74 74 return null; … … 189 189 public void actionPerformed(ActionEvent e) { 190 190 if (list.getSelectedValue() != null) { 191 String url = list.getSelectedValue().getHrefFromDescription();191 String url = ((WikipediaEntry) list.getSelectedValue()).getHrefFromDescription(); 192 192 if (url != null) { 193 193 System.out.println("Wikipedia: opening " + url); … … 227 227 public void actionPerformed(ActionEvent e) { 228 228 if (list.getSelectedValue() != null) { 229 Tag tag = list.getSelectedValue().createWikipediaTag();229 Tag tag = ((WikipediaEntry) list.getSelectedValue()).createWikipediaTag(); 230 230 if (tag != null) { 231 231 ChangePropertyCommand cmd = new ChangePropertyCommand(
Note:
See TracChangeset
for help on using the changeset viewer.