Changeset 7958 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2015-01-11T23:01:33+01:00 (5 years ago)
Author:
bastiK
Message:

applied #10856 - add jump to position of a note in notes dialog (patch by ToeBee)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/NotesDialog.java

    r7937 r7958  
    88import java.awt.Image;
    99import java.awt.event.ActionEvent;
     10import java.awt.event.MouseAdapter;
     11import java.awt.event.MouseEvent;
    1012import java.text.SimpleDateFormat;
    1113import java.util.ArrayList;
     
    2426import javax.swing.ListCellRenderer;
    2527import javax.swing.ListSelectionModel;
     28import javax.swing.SwingUtilities;
    2629import javax.swing.event.ListSelectionEvent;
    2730import javax.swing.event.ListSelectionListener;
     
    113116                updateButtonStates();
    114117            }});
     118        displayList.addMouseListener(new MouseAdapter() {
     119            //center view on selected note on double click
     120            @Override
     121            public void mouseClicked(MouseEvent e) {
     122                if (SwingUtilities.isLeftMouseButton(e) && e.getClickCount() == 2) {
     123                    if (noteData != null && noteData.getSelectedNote() != null) {
     124                        Main.map.mapView.zoomTo(noteData.getSelectedNote().getLatLon());
     125                    }
     126                }
     127            }
     128        });
    115129
    116130        JPanel pane = new JPanel(new BorderLayout());
Note: See TracChangeset for help on using the changeset viewer.