diff --git a/diagram-util/src/main/java/com/powsybl/diagram/util/forcelayout/ForceLayout.java b/diagram-util/src/main/java/com/powsybl/diagram/util/forcelayout/ForceLayoutSpringy.java similarity index 94% rename from diagram-util/src/main/java/com/powsybl/diagram/util/forcelayout/ForceLayout.java rename to diagram-util/src/main/java/com/powsybl/diagram/util/forcelayout/ForceLayoutSpringy.java index a1b6715b5..c833ff28a 100644 --- a/diagram-util/src/main/java/com/powsybl/diagram/util/forcelayout/ForceLayout.java +++ b/diagram-util/src/main/java/com/powsybl/diagram/util/forcelayout/ForceLayoutSpringy.java @@ -41,8 +41,8 @@ * * @author Mathilde Grapin {@literal } */ -public class ForceLayout extends AbstractForceLayout { - private static final Logger LOGGER = LoggerFactory.getLogger(ForceLayout.class); +public class ForceLayoutSpringy extends AbstractForceLayout { + private static final Logger LOGGER = LoggerFactory.getLogger(ForceLayoutSpringy.class); private static final double DEFAULT_REPULSION = 800.0; private static final double DEFAULT_FRICTION = 500; private static final double DEFAULT_MAX_SPEED = 100; @@ -53,7 +53,7 @@ public class ForceLayout extends AbstractForceLayout { private double maxSpeed; private double springRepulsionFactor; - public ForceLayout(Graph graph) { + public ForceLayoutSpringy(Graph graph) { super(graph); this.friction = DEFAULT_FRICTION; this.maxSpeed = DEFAULT_MAX_SPEED; @@ -61,22 +61,22 @@ public ForceLayout(Graph graph) { this.springRepulsionFactor = DEFAULT_SPRING_REPULSION_FACTOR; } - public ForceLayout setRepulsion(double repulsion) { + public ForceLayoutSpringy setRepulsion(double repulsion) { this.repulsion = repulsion; return this; } - public ForceLayout setFriction(double friction) { + public ForceLayoutSpringy setFriction(double friction) { this.friction = friction; return this; } - public ForceLayout setMaxSpeed(double maxSpeed) { + public ForceLayoutSpringy setMaxSpeed(double maxSpeed) { this.maxSpeed = maxSpeed; return this; } - public ForceLayout setSpringRepulsionFactor(double springRepulsionFactor) { + public ForceLayoutSpringy setSpringRepulsionFactor(double springRepulsionFactor) { this.springRepulsionFactor = springRepulsionFactor; return this; } diff --git a/network-area-diagram/src/main/java/com/powsybl/nad/layout/BasicForceLayout.java b/network-area-diagram/src/main/java/com/powsybl/nad/layout/BasicForceLayout.java index bf58b9b35..5bda43013 100644 --- a/network-area-diagram/src/main/java/com/powsybl/nad/layout/BasicForceLayout.java +++ b/network-area-diagram/src/main/java/com/powsybl/nad/layout/BasicForceLayout.java @@ -6,7 +6,7 @@ */ package com.powsybl.nad.layout; -import com.powsybl.diagram.util.forcelayout.ForceLayout; +import com.powsybl.diagram.util.forcelayout.ForceLayoutSpringy; import com.powsybl.diagram.util.forcelayout.Vector; import com.powsybl.nad.model.Edge; import com.powsybl.nad.model.Graph; @@ -27,7 +27,7 @@ public class BasicForceLayout extends AbstractLayout { @Override protected void nodesLayout(Graph graph, LayoutParameters layoutParameters) { org.jgrapht.Graph jgraphtGraph = graph.getJgraphtGraph(layoutParameters.isTextNodesForceLayout()); - ForceLayout forceLayout = new ForceLayout<>(jgraphtGraph); + ForceLayoutSpringy forceLayout = new ForceLayoutSpringy<>(jgraphtGraph); forceLayout.setSpringRepulsionFactor(layoutParameters.getSpringRepulsionFactorForceLayout()); forceLayout.setMaxSteps(layoutParameters.getMaxSteps()); @@ -50,7 +50,7 @@ protected void nodesLayout(Graph graph, LayoutParameters layoutParameters) { } } - private void setInitialPositions(ForceLayout forceLayout, Graph graph) { + private void setInitialPositions(ForceLayoutSpringy forceLayout, Graph graph) { Map initialPoints = getInitialNodePositions().entrySet().stream() // Only accept positions for nodes in the graph .filter(nodePosition -> graph.getNode(nodePosition.getKey()).isPresent()) diff --git a/network-area-diagram/src/test/java/com/powsybl/nad/layout/ForceLayoutTest.java b/network-area-diagram/src/test/java/com/powsybl/nad/layout/ForceLayoutSpringyTest.java similarity index 97% rename from network-area-diagram/src/test/java/com/powsybl/nad/layout/ForceLayoutTest.java rename to network-area-diagram/src/test/java/com/powsybl/nad/layout/ForceLayoutSpringyTest.java index cb3356d64..d0a2ed0b9 100644 --- a/network-area-diagram/src/test/java/com/powsybl/nad/layout/ForceLayoutTest.java +++ b/network-area-diagram/src/test/java/com/powsybl/nad/layout/ForceLayoutSpringyTest.java @@ -21,7 +21,7 @@ /** * @author Luma Zamarreno {@literal } */ -class ForceLayoutTest extends AbstractTest { +class ForceLayoutSpringyTest extends AbstractTest { @BeforeEach void setup() {