Source:
<code>private void handleArrowKeys(final KeyboardEvent.Key... keys) { final int selectedIDsCount = selectedIDs.size(); if (selectedIDsCount == 0) { return; } <START> final double multiplier = 10d; <END> final double divider = 5d; double movementDistance = 5d; double horizontalDistance = 0d; double verticalDistance = 0d; if (KeysMatcher.isKeyMatch(keys, KeyboardEvent.Key.CONTROL)){ movementDistance *= multiplier; } else if (KeysMatcher.isKeyMatch(keys, KeyboardEvent.Key.SHIFT)){ movementDistance /= divider; } if (KeysMatcher.isKeyMatch(keys, KeyboardEvent.Key.ARROW_UP)) { verticalDistance = -movementDistance; } else if (KeysMatcher.isKeyMatch(keys, KeyboardEvent.Key.ARROW_DOWN)) { verticalDistance = movementDistance; } if (KeysMatcher.isKeyMatch(keys, KeyboardEvent.Key.ARROW_LEFT)) { horizontalDistance = -movementDistance; }else if (KeysMatcher.isKeyMatch(keys, KeyboardEvent.Key.ARROW_RIGHT)) { horizontalDistance = movementDistance; } if (verticalDistance == 0 && horizontalDistance == 0) { return; } ArrayList<Element> moveNodes = new ArrayList<>(); ArrayList<Point2D> movePositions = new ArrayList<>(); for (String uuid : selectedIDs) { final Node<View<?>, Edge> node = canvasHandler.getGraphIndex().getNode(uuid); if (node != null) { final Point2D nodePosition = GraphUtils.getPosition(node.getContent()); final Point2D movePosition = new Point2D(nodePosition.getX() + horizontalDistance, nodePosition.getY() + verticalDistance); moveNodes.add(node); movePositions.add(movePosition); } } move(moveNodes.toArray(new Element[] {}), movePositions.toArray(new Point2D[] {})); }</code><technical_language>@Josephblt constants class</technical_language>

Target:
private void handleArrowKeys(final KeyboardEvent.Key... keys) { final int selectedIDsCount = selectedIDs.size(); if (selectedIDsCount == 0) { return; } double movementDistance = NORMAL_DISTANCE; if (KeysMatcher.isKeyMatch(keys, KeyboardEvent.Key.CONTROL)) { movementDistance = LARGE_DISTANCE; } else if (KeysMatcher.isKeyMatch(keys, KeyboardEvent.Key.SHIFT)) { movementDistance = SHORT_DISTANCE; } double horizontalDistance = 0d; double verticalDistance = 0d; if (KeysMatcher.isKeyMatch(keys, KeyboardEvent.Key.ARROW_LEFT)) { horizontalDistance = -movementDistance; } else if (KeysMatcher.isKeyMatch(keys, KeyboardEvent.Key.ARROW_RIGHT)) { horizontalDistance = movementDistance; } if (KeysMatcher.isKeyMatch(keys, KeyboardEvent.Key.ARROW_UP)) { verticalDistance = -movementDistance; } else if (KeysMatcher.isKeyMatch(keys, KeyboardEvent.Key.ARROW_DOWN)) { verticalDistance = movementDistance; } if (verticalDistance == 0 && horizontalDistance == 0) { return; } List<Element> moveNodes = new ArrayList<>(); List<Point2D> movePositions = new ArrayList<>(); for (String uuid : selectedIDs) { final Node<View<?>, Edge> node = canvasHandler.getGraphIndex().getNode(uuid); if (node != null) { final Point2D nodePosition = GraphUtils.getPosition(node.getContent()); final Point2D movePosition = new Point2D(nodePosition.getX() + horizontalDistance, nodePosition.getY() + verticalDistance); moveNodes.add(node); movePositions.add(movePosition); } } move(moveNodes.toArray(new Element[]{}), movePositions.toArray(new Point2D[]{})); }