Changeset 7400 in josm for trunk/src


Ignore:
Timestamp:
2014-08-15T16:13:44+02:00 (5 years ago)
Author:
Don-vip
Message:

fix #10316 - use N as a new shortcut for "Move Node onto Way" action

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/JoinNodeWayAction.java

    r7302 r7400  
    11//License: GPL. For details, see LICENSE file.
    22package 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;
     9import java.util.Collection;
     10import java.util.Collections;
     11import java.util.Comparator;
     12import java.util.HashMap;
     13import java.util.LinkedList;
     14import java.util.List;
     15import java.util.Map;
     16import java.util.Set;
     17import java.util.SortedSet;
     18import java.util.TreeSet;
    319
    420import org.openstreetmap.josm.Main;
     
    1733import org.openstreetmap.josm.tools.Shortcut;
    1834
    19 import java.awt.event.ActionEvent;
    20 import java.awt.event.KeyEvent;
    21 import java.util.Comparator;
    22 import java.util.Collection;
    23 import java.util.Collections;
    24 import java.util.LinkedList;
    25 import java.util.List;
    26 import java.util.Map;
    27 import java.util.HashMap;
    28 import java.util.Set;
    29 import java.util.SortedSet;
    30 import java.util.TreeSet;
    31 
    32 import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
    33 import static org.openstreetmap.josm.tools.I18n.tr;
    34 
     35/**
     36 * Action allowing to join a node to a nearby way, operating on two modes:<ul>
     37 * <li><b>Join Node to Way</b>: Include a node into the nearest way segments. The node does not move</li>
     38 * <li><b>Move Node onto Way</b>: Move the node onto the nearest way segments and include it</li>
     39 * </ul>
     40 */
    3541public class JoinNodeWayAction extends JosmAction {
    3642
     
    4450    /**
    4551     * Constructs a Join Node to Way action.
     52     * @return the Join Node to Way action
    4653     */
    4754    public static JoinNodeWayAction createJoinNodeToWayAction() {
     
    5562    /**
    5663     * Constructs a Move Node onto Way action.
     64     * @return the Move Node onto Way action
    5765     */
    5866    public static JoinNodeWayAction createMoveNodeOntoWayAction() {
    5967        JoinNodeWayAction action = new JoinNodeWayAction(true,
    6068                tr("Move Node onto Way"), "movenodeontoway", tr("Move the node onto the nearest way segments and include it"),
    61                 Shortcut.registerShortcut("tools:movenodeontoway", tr("Tool: {0}", tr("Move Node onto Way")), KeyEvent.VK_J, Shortcut.NONE), true);
     69                Shortcut.registerShortcut("tools:movenodeontoway", tr("Tool: {0}", tr("Move Node onto Way")), KeyEvent.VK_N, Shortcut.DIRECT), true);
    6270        return action;
    6371    }
     
    159167        private EastNorth refPoint2;
    160168        private final boolean projectToSegment;
    161         NodeDistanceToRefNodeComparator(Node referenceNode) {
    162             refPoint = referenceNode.getEastNorth();
    163             projectToSegment = false;
    164         }
    165169        NodeDistanceToRefNodeComparator(Node referenceNode, Node referenceNode2, boolean projectFirst) {
    166170            refPoint = referenceNode.getEastNorth();
Note: See TracChangeset for help on using the changeset viewer.