Ticket #11217: 11217.patch

File 11217.patch, 1.6 KB (added by simon04, 3 years ago)
  • src/org/openstreetmap/josm/gui/layer/NoteLayer.java

    diff --git a/src/org/openstreetmap/josm/gui/layer/NoteLayer.java b/src/org/openstreetmap/josm/gui/layer/NoteLayer.java
    index 42d0697..cc7cf7f 100644
    a b import javax.swing.Action; 
    1717import javax.swing.Icon;
    1818import javax.swing.ImageIcon;
    1919import javax.swing.JToolTip;
     20import javax.swing.SwingUtilities;
    2021
    2122import org.openstreetmap.josm.Main;
    2223import org.openstreetmap.josm.actions.SaveActionBase;
    import org.openstreetmap.josm.gui.dialogs.LayerListDialog; 
    3132import org.openstreetmap.josm.gui.dialogs.LayerListPopup;
    3233import org.openstreetmap.josm.gui.dialogs.NotesDialog;
    3334import org.openstreetmap.josm.io.NoteExporter;
     35import org.openstreetmap.josm.io.OsmApi;
    3436import org.openstreetmap.josm.io.XmlWriter;
    3537import org.openstreetmap.josm.tools.ColorHelper;
     38import org.openstreetmap.josm.tools.Utils;
    3639
    3740/**
    3841 * A layer to hold Note objects
    public class NoteLayer extends AbstractModifiableLayer implements MouseListener 
    216219
    217220    @Override
    218221    public void mouseClicked(MouseEvent e) {
    219         if (e.getButton() != MouseEvent.BUTTON1) {
     222        if (SwingUtilities.isRightMouseButton(e) && noteData.getSelectedNote() != null) {
     223            final String url = OsmApi.getOsmApi().getBaseUrl() + "notes/" + noteData.getSelectedNote().getId();
     224            if (SwingUtilities.isRightMouseButton(e)) {
     225                Utils.copyToClipboard(url);
     226            }
     227        } else if (!SwingUtilities.isLeftMouseButton(e)) {
    220228            return;
    221229        }
    222230        Point clickPoint = e.getPoint();