diff --git a/network-area-diagram/src/main/java/com/powsybl/nad/NetworkAreaDiagram.java b/network-area-diagram/src/main/java/com/powsybl/nad/NetworkAreaDiagram.java index 419ca1a31..f5512bd55 100644 --- a/network-area-diagram/src/main/java/com/powsybl/nad/NetworkAreaDiagram.java +++ b/network-area-diagram/src/main/java/com/powsybl/nad/NetworkAreaDiagram.java @@ -92,8 +92,7 @@ private static void genericDraw(Network network, Object svgObject, Object metada Graph graph = new NetworkGraphBuilder(network, voltageLevelFilter, param.getIdProviderFactory().create()).buildGraph(); param.getLayoutFactory().create().run(graph, param.getLayoutParameters()); - SvgWriter svgWriter = new SvgWriter(param.getSvgParameters(), param.getStyleProviderFactory().create(network), param.createLabelProvider(network), - param.getLayoutParameters()); + SvgWriter svgWriter = new SvgWriter(param.getSvgParameters(), param.getStyleProviderFactory().create(network), param.createLabelProvider(network)); DiagramMetadata metadata = new DiagramMetadata(param.getLayoutParameters(), param.getSvgParameters()); if (svgObject instanceof Path svgFile) { diff --git a/network-area-diagram/src/main/java/com/powsybl/nad/svg/SvgWriter.java b/network-area-diagram/src/main/java/com/powsybl/nad/svg/SvgWriter.java index ae5b6c0cb..b640d2c11 100644 --- a/network-area-diagram/src/main/java/com/powsybl/nad/svg/SvgWriter.java +++ b/network-area-diagram/src/main/java/com/powsybl/nad/svg/SvgWriter.java @@ -8,7 +8,6 @@ import com.powsybl.commons.exceptions.UncheckedXmlStreamException; import com.powsybl.commons.xml.XmlUtil; -import com.powsybl.nad.layout.LayoutParameters; import com.powsybl.nad.model.*; import org.apache.commons.io.output.WriterOutputStream; import org.jgrapht.alg.util.Pair; @@ -63,15 +62,12 @@ public class SvgWriter { private final StyleProvider styleProvider; private final LabelProvider labelProvider; private final EdgeRendering edgeRendering; - private final LayoutParameters layoutParameters; - public SvgWriter(SvgParameters svgParameters, StyleProvider styleProvider, LabelProvider labelProvider, - LayoutParameters layoutParameters) { + public SvgWriter(SvgParameters svgParameters, StyleProvider styleProvider, LabelProvider labelProvider) { this.svgParameters = Objects.requireNonNull(svgParameters); this.styleProvider = Objects.requireNonNull(styleProvider); this.labelProvider = Objects.requireNonNull(labelProvider); this.edgeRendering = new DefaultEdgeRendering(); - this.layoutParameters = layoutParameters; } public void writeSvg(Graph graph, Path svgFile) { diff --git a/network-area-diagram/src/test/java/com/powsybl/nad/AbstractTest.java b/network-area-diagram/src/test/java/com/powsybl/nad/AbstractTest.java index 8022580b1..9a243fd98 100644 --- a/network-area-diagram/src/test/java/com/powsybl/nad/AbstractTest.java +++ b/network-area-diagram/src/test/java/com/powsybl/nad/AbstractTest.java @@ -51,7 +51,7 @@ protected String generateSvgString(Network network, Predicate volt Graph graph = new NetworkGraphBuilder(network, voltageLevelFilter).buildGraph(); new BasicForceLayout().run(graph, getLayoutParameters()); StringWriter writer = new StringWriter(); - new SvgWriter(getSvgParameters(), getStyleProvider(network), getLabelProvider(network), getLayoutParameters()).writeSvg(graph, writer); + new SvgWriter(getSvgParameters(), getStyleProvider(network), getLabelProvider(network)).writeSvg(graph, writer); String svgString = writer.toString(); if (debugSvg) { writeToHomeDir(refFilename, svgString);