-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modify diagram apis #522
Modify diagram apis #522
Conversation
Signed-off-by: Sophie Frasnedo <[email protected]>
* Remove executions goals from sld-cgmes-dl-iidm-extensions * Add new module powsybl-single-line-diagram-cgmes-iidm-extensions-test * Import Networks class from powsybl-single-line-diagram-cgmes-iidm-extensions-test * Use new module powsybl-single-line-diagram-cgmes-iidm-extensions-test instead of using test-jars * Rename & move module powsybl-single-line-diagram-cgmes-iidm-extensions-test to diagram-test * Fix sonar bug * Use Networks class instead of duplication code * Merge NetworkTestFactory into Networks class * Fix code smells on Networks class * Replace CreateNetworksUtil & NetworkFactory by Networks class * Fix code smells on Netorks * Taking into account PR comments * Fix code smells on Networks class Signed-off-by: Thomas ADAM <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
1a28286
to
0248753
Compare
c7f2ad1
to
a32ca14
Compare
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
a32ca14
to
34a8f9c
Compare
Signed-off-by: Sophie Frasnedo <[email protected]>
network-area-diagram/src/main/java/com/powsybl/nad/NetworkAreaDiagram.java
Outdated
Show resolved
Hide resolved
@@ -36,11 +39,12 @@ public abstract class AbstractTestCaseIidm extends AbstractTestCase { | |||
|
|||
@Override | |||
public String toSVG(Graph g, String filename) { | |||
return toSVG(g, filename, getDefaultDiagramLabelProvider(), getDefaultDiagramStyleProvider()); | |||
DefaultSVGWriter defaultSVGWriter = new DefaultSVGWriter(componentLibrary, layoutParameters, svgParameters); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't the SingleLineDiagram class create the SvgWriter like it used to be?
public static void draw(Graph graph, Writer writerForSvg, Writer metadataWriter, LayoutParameters layoutParameters, ComponentLibrary componentLibrary, | ||
DiagramLabelProvider initProvider, StyleProvider styleProvider, String prefixId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You removed this method, but it was used in unit tests. Removing it forced you to instantiate a DefaultSvgWriter in all the unit tests. We don't want this, as this leads to always the same code in all the tests.
With the new design the equivalent would be a draw(graph, writerForSvg, metadataWriter, param)
method.
} | ||
|
||
public static void draw(Graph graph, Writer writerForSvg, Writer metadataWriter, DefaultSVGWriter svgWriter, | ||
DiagramLabelProvider initProvider, StyleProvider styleProvider, String prefixId) { | ||
public static void draw(Graph graph, Writer writerForSvg, Writer metadataWriter, SVGWriter svgWriter, LabelProvider labelProvider, StyleProvider styleProvider, String prefixId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should hide the svgWriter and therefore remove this method. Besides, exposing the providers is against the new design.
This a utility class, hence we want to keep methods simple (simpler than they were!), an advanced user who wants to use a custom SvgWriter can still do it, without using this class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not wish to expose the providers but the LabelProvider and the StyleProvider cannot be retrieved using an SldParameters object only. I need a Network object too. That is why I had to "build" those providers earlier, when I could still have access to the Network object.
...ine-diagram-core/src/test/java/com/powsybl/sld/iidm/TestCase15GraphWithVoltageIndicator.java
Outdated
Show resolved
Hide resolved
...line-diagram/single-line-diagram-core/src/test/resources/TestSldClassSubstationMetadata.json
Outdated
Show resolved
Hide resolved
...ine-diagram-core/src/test/java/com/powsybl/sld/iidm/TestCase15GraphWithVoltageIndicator.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
…orship on recently created factory interfaces Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
…ybl-diagram into modify_diagram_apis
Signed-off-by: Sophie Frasnedo <[email protected]>
…ybl-diagram into modify_diagram_apis
Signed-off-by: Sophie Frasnedo <[email protected]>
…s in a different way Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Sophie Frasnedo <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
Kudos, SonarCloud Quality Gate passed! |
Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
#469
There is another PR on the same topic (#475). This old PR has diverged too much from main and it was easier to start afresh than to rebase or merge.
Developments on the old PR were added to this new PR.
New developments have been added afterwards on the new branch:
What kind of change does this PR introduce?
Modification and standardization of SLD and NAD APIs
Does this PR introduce a breaking change or deprecate an API?