Changeset 7859 in josm for trunk/src/org/openstreetmap/josm/actions/JoinNodeWayAction.java
- Timestamp:
- 2014-12-20T16:00:06+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/JoinNodeWayAction.java
r7668 r7859 38 38 * <li><b>Move Node onto Way</b>: Move the node onto the nearest way segments and include it</li> 39 39 * </ul> 40 * @since 466 40 41 */ 41 42 public class JoinNodeWayAction extends JosmAction { … … 43 44 protected final boolean joinWayToNode; 44 45 45 protected JoinNodeWayAction(boolean joinWayToNode, String name, String iconName, String tooltip, Shortcut shortcut, boolean registerInToolbar) { 46 protected JoinNodeWayAction(boolean joinWayToNode, String name, String iconName, String tooltip, 47 Shortcut shortcut, boolean registerInToolbar) { 46 48 super(name, iconName, tooltip, shortcut, registerInToolbar); 47 49 this.joinWayToNode = joinWayToNode; … … 54 56 public static JoinNodeWayAction createJoinNodeToWayAction() { 55 57 JoinNodeWayAction action = new JoinNodeWayAction(false, 56 tr("Join Node to Way"), /* ICON */ "joinnodeway", tr("Include a node into the nearest way segments"), 57 Shortcut.registerShortcut("tools:joinnodeway", tr("Tool: {0}", tr("Join Node to Way")), KeyEvent.VK_J, Shortcut.DIRECT), true); 58 tr("Join Node to Way"), /* ICON */ "joinnodeway", 59 tr("Include a node into the nearest way segments"), 60 Shortcut.registerShortcut("tools:joinnodeway", tr("Tool: {0}", tr("Join Node to Way")), 61 KeyEvent.VK_J, Shortcut.DIRECT), true); 58 62 action.putValue("help", ht("/Action/JoinNodeWay")); 59 63 return action; … … 66 70 public static JoinNodeWayAction createMoveNodeOntoWayAction() { 67 71 JoinNodeWayAction action = new JoinNodeWayAction(true, 68 tr("Move Node onto Way"), /* ICON*/ "movenodeontoway", tr("Move the node onto the nearest way segments and include it"), 69 Shortcut.registerShortcut("tools:movenodeontoway", tr("Tool: {0}", tr("Move Node onto Way")), KeyEvent.VK_N, Shortcut.DIRECT), true); 72 tr("Move Node onto Way"), /* ICON*/ "movenodeontoway", 73 tr("Move the node onto the nearest way segments and include it"), 74 Shortcut.registerShortcut("tools:movenodeontoway", tr("Tool: {0}", tr("Move Node onto Way")), 75 KeyEvent.VK_N, Shortcut.DIRECT), true); 76 action.putValue("help", ht("/Action/MoveNodeWay")); 70 77 return action; 71 78 } … … 95 102 } 96 103 97 if ( ws.getFirstNode() != node && ws.getSecondNode() != node) {104 if (!ws.getFirstNode().equals(node) && !ws.getSecondNode().equals(node)) { 98 105 insertPoints.put(ws.way, ws.lowerIndex); 99 106 } … … 137 144 List<Node> nodesToAdd = new LinkedList<>(); 138 145 nodesToAdd.addAll(nodesInSegment); 139 Collections.sort(nodesToAdd, new NodeDistanceToRefNodeComparator(w.getNode(segmentIndex), w.getNode(segmentIndex+1), !joinWayToNode)); 146 Collections.sort(nodesToAdd, new NodeDistanceToRefNodeComparator( 147 w.getNode(segmentIndex), w.getNode(segmentIndex+1), !joinWayToNode)); 140 148 wayNodes.addAll(segmentIndex + 1, nodesToAdd); 141 149 }
Note:
See TracChangeset
for help on using the changeset viewer.