source: josm/trunk/src/org/openstreetmap/josm/actions/PasteAtSourcePositionAction.java@ 11747

Last change on this file since 11747 was 10766, checked in by Don-vip, 8 years ago

fix #13290 - pasting from other layer changes objects position (modified patch by michael2402) - gsoc-core

  • Property svn:eol-style set to native
File size: 1.2 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.actions;
3
4import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
5import static org.openstreetmap.josm.tools.I18n.tr;
6
7import java.awt.event.ActionEvent;
8import java.awt.event.KeyEvent;
9
10import org.openstreetmap.josm.data.coor.EastNorth;
11import org.openstreetmap.josm.tools.Shortcut;
12
13/**
14 * A special version of the {@link PasteAction} that pastes at the exact source location the item was copied from.
15 * @author Michael Zangl
16 * @since 10765
17 */
18public class PasteAtSourcePositionAction extends AbstractPasteAction {
19
20 /**
21 * Constructs a new {@link PasteAtSourcePositionAction}.
22 */
23 public PasteAtSourcePositionAction() {
24 super(tr("Paste at source position"), "paste", tr("Paste contents of clipboard at the position they were copied from."),
25 Shortcut.registerShortcut("menu:edit:pasteAtSource", tr("Edit: {0}", tr("Paste at source position")),
26 KeyEvent.VK_V, Shortcut.ALT_CTRL), true, "pasteatsource");
27 putValue("help", ht("/Action/Paste"));
28 }
29
30 @Override
31 protected EastNorth computePastePosition(ActionEvent e) {
32 // null means use old position
33 return null;
34 }
35}
Note: See TracBrowser for help on using the repository browser.