Skip to content

Commit

Permalink
Remove unused parameter in NAD SvgWriter
Browse files Browse the repository at this point in the history
Signed-off-by: massimo.ferraro <[email protected]>
  • Loading branch information
massimo-ferraro committed Sep 26, 2024
1 parent 855dfd1 commit 1b36c7d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected String generateSvgString(Network network, Predicate<VoltageLevel> 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);
Expand Down

0 comments on commit 1b36c7d

Please sign in to comment.