* Inserts node into nearby segment.
* @param e current mouse point
*/
private void addNewNode(MouseEvent e) {
// Should maybe do the same as in DrawAction and fetch all nearby segments?
WaySegment ws = Main.map.mapView.getNearestWaySegment(e.getPoint(), OsmPrimitive.isSelectablePredicate);
if (ws != null) {
Node n = new Node(Main.map.mapView.getLatLon(e.getX(), e.getY()));
EastNorth A = ws.getFirstNode().getEastNorth();
EastNorth B = ws.getSecondNode().getEastNorth();
n.setEastNorth(Geometry.closestPointToSegment(A, B, n.getEastNorth()));
Way wnew = new Way(ws.way);
wnew.addNode(ws.lowerIndex+1, n);
SequenceCommand cmds = new SequenceCommand(tr("Add a new node to an existing way"),
new AddCommand(n), new ChangeCommand(ws.way, wnew));