Ignore:
Timestamp:
2012-04-14T15:05:44+02:00 (13 years ago)
Author:
simon04
Message:

JOSM/wikipedia: fix #josm7610

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaToggleDialog.java

    r28244 r28293  
    4949    }
    5050    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) {
    5353
    5454        {
     
    5959                    if (e.getClickCount() == 2 && getSelectedValue() != null) {
    6060                        BoundingXYVisitor bbox = new BoundingXYVisitor();
    61                         bbox.visit(getSelectedValue().coordinate);
     61                        bbox.visit(((WikipediaEntry) getSelectedValue()).coordinate);
    6262                        Main.map.mapView.recalculateCenterScale(bbox);
    6363                    }
     
    7070            final int index = locationToIndex(e.getPoint());
    7171            if (index >= 0) {
    72                 return "<html>" + model.getElementAt(index).description + "</html>";
     72                return "<html>" + ((WikipediaEntry) model.getElementAt(index)).description + "</html>";
    7373            } else {
    7474                return null;
     
    189189        public void actionPerformed(ActionEvent e) {
    190190            if (list.getSelectedValue() != null) {
    191                 String url = list.getSelectedValue().getHrefFromDescription();
     191                String url = ((WikipediaEntry) list.getSelectedValue()).getHrefFromDescription();
    192192                if (url != null) {
    193193                    System.out.println("Wikipedia: opening " + url);
     
    227227        public void actionPerformed(ActionEvent e) {
    228228            if (list.getSelectedValue() != null) {
    229                 Tag tag = list.getSelectedValue().createWikipediaTag();
     229                Tag tag = ((WikipediaEntry) list.getSelectedValue()).createWikipediaTag();
    230230                if (tag != null) {
    231231                    ChangePropertyCommand cmd = new ChangePropertyCommand(
Note: See TracChangeset for help on using the changeset viewer.