Skip to content

Commit bd0b80f

Browse files
committed
Requested changes
Signed-off-by: Ayoub LABIDI <[email protected]>
1 parent ae6fd3b commit bd0b80f

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

network-area-diagram/src/main/java/com/powsybl/nad/svg/iidm/TopologicalStyleProvider.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,24 @@
2222
*/
2323
public class TopologicalStyleProvider extends AbstractVoltageStyleProvider {
2424

25-
private final Map<String, String> violationStyles;
25+
private Map<String, String> limitViolationStyles = Map.of();
2626

2727
public TopologicalStyleProvider(Network network) {
28-
this(network, Collections.emptyMap());
28+
super(network);
2929
}
3030

3131
public TopologicalStyleProvider(Network network, BaseVoltagesConfig baseVoltageStyle) {
32-
this(network, baseVoltageStyle, Collections.emptyMap());
32+
super(network, baseVoltageStyle);
3333
}
3434

35-
public TopologicalStyleProvider(Network network, Map<String, String> violationStyles) {
35+
public TopologicalStyleProvider(Network network, Map<String, String> limitViolationStyles) {
3636
super(network);
37-
this.violationStyles = violationStyles != null ? violationStyles : Collections.emptyMap();
37+
this.limitViolationStyles = limitViolationStyles;
3838
}
3939

40-
public TopologicalStyleProvider(Network network, BaseVoltagesConfig baseVoltageStyle, Map<String, String> violationStyles) {
40+
public TopologicalStyleProvider(Network network, BaseVoltagesConfig baseVoltageStyle, Map<String, String> limitViolationStyles) {
4141
super(network, baseVoltageStyle);
42-
this.violationStyles = violationStyles != null ? violationStyles : Collections.emptyMap();
42+
this.limitViolationStyles = limitViolationStyles;
4343
}
4444

4545
@Override
@@ -50,8 +50,8 @@ public List<String> getCssFilenames() {
5050
@Override
5151
public List<String> getBranchEdgeStyleClasses(BranchEdge branchEdge) {
5252
// Check custom violations first
53-
if (!violationStyles.isEmpty()) {
54-
String customStyle = violationStyles.get(branchEdge.getEquipmentId());
53+
if (!limitViolationStyles.isEmpty()) {
54+
String customStyle = limitViolationStyles.get(branchEdge.getEquipmentId());
5555
if (customStyle != null && !customStyle.isBlank()) {
5656
return List.of(customStyle);
5757
}

single-line-diagram/single-line-diagram-core/src/main/java/com/powsybl/sld/svg/styles/iidm/LimitHighlightStyleProvider.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@
2222
*/
2323
public class LimitHighlightStyleProvider extends EmptyStyleProvider {
2424
private final Network network;
25-
private final Map<String, String> violationStyles;
25+
private Map<String, String> limitViolationStyles = Map.of();
2626

2727
public LimitHighlightStyleProvider(Network network) {
2828
this(network, Collections.emptyMap());
2929
}
3030

31-
public LimitHighlightStyleProvider(Network network, Map<String, String> violationStyles) {
31+
public LimitHighlightStyleProvider(Network network, Map<String, String> limitViolationStyles) {
3232
this.network = network;
33-
this.violationStyles = violationStyles != null ? violationStyles : Collections.emptyMap();
33+
this.limitViolationStyles = limitViolationStyles;
3434
}
3535

3636
@Override
3737
public List<String> getEdgeStyles(Graph graph, Edge edge) {
3838
// Check custom violations first
39-
if (!violationStyles.isEmpty()) {
39+
if (!limitViolationStyles.isEmpty()) {
4040
Optional<String> customStyle = getCustomViolationStyle(edge);
4141
if (customStyle.isPresent()) {
4242
return List.of(customStyle.get());
@@ -50,7 +50,7 @@ public List<String> getEdgeStyles(Graph graph, Edge edge) {
5050
private Optional<String> getCustomViolationStyle(Edge edge) {
5151
for (Node node : edge.getNodes()) {
5252
if (node instanceof FeederNode feederNode) {
53-
String style = violationStyles.get(feederNode.getEquipmentId());
53+
String style = limitViolationStyles.get(feederNode.getEquipmentId());
5454
if (style != null && !style.isBlank()) {
5555
return Optional.of(style);
5656
}

0 commit comments

Comments
 (0)