From 915a8e30ae735e7660e7a87bec77b0982b5abc15 Mon Sep 17 00:00:00 2001
From: Jiri Vlasak <jiri.hubacek@gmail.com>
Date: Mon, 14 Nov 2022 21:35:28 +0100
Subject: [PATCH 2/3] Separate move nodes command code

---
 .../josm/actions/AlignInCircleAction.java       | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/org/openstreetmap/josm/actions/AlignInCircleAction.java b/src/org/openstreetmap/josm/actions/AlignInCircleAction.java
index 42bec22818..ee03219f7c 100644
--- a/src/org/openstreetmap/josm/actions/AlignInCircleAction.java
+++ b/src/org/openstreetmap/josm/actions/AlignInCircleAction.java
@@ -258,7 +258,24 @@ public final class AlignInCircleAction extends JosmAction {
             }
             radius = radius / nodes.size();
         }
+        return moveNodesCommand(nodes, fixNodes, center, radius);
+    }
 
+    /**
+     * Move each node of the list of nodes to be arranged in a circle.
+     * @param nodes The list of nodes to be moved.
+     * @param fixNodes The list of nodes that must not be moved.
+     * @param center A center of the circle formed by the nodes.
+     * @param radius A radius of the circle fromed by the nodes.
+     * @return the command that arranges the nodes in a circle.
+     * @since xxx
+     */
+    public static Command moveNodesCommand(
+            List<Node> nodes,
+            Set<Node> fixNodes,
+            EastNorth center,
+            double radius) throws InvalidSelection
+    {
         List<Command> cmds = new LinkedList<>();
 
         // Move each node to that distance from the center.
-- 
2.30.2

