powsybl-diagram
powsybl-diagram copied to clipboard
Decorator attributes are not properly set
Describe the current behavior
In the setDecoratorAttributes
method of the DefaultSVGWriter
class, the line
List<String> svgNodeSubcomponentStyles = styleProvider.getNodeSubcomponentStyles(graph, node, subComponentName)
may call the AbstractVoltageStyleProvider
getNodeSubcomponentStyles
.
The decorator gets the style of its associated node (a switch node, a feeder node, etc.). This behavior may disturb or bother users.
Moreover, when the node is a FeederNode, the getNodeSubcomponentStyles
calls in turn the getSubComponentVoltageLevelInfos
method.
That last method was designed for components like two-winding transformers, as the if condition (if (subComponentName.equals(WINDING2))
) shows, and not really for decorators.
Describe the expected behavior
In the setDecoratorAttributes
method of the DefaultSVGWriter
class, a function specific to decorators should be called to retrieve the svgNodeSubComponentStyles
, so that the decorator does not end up with the style of its associated node.
Another solution would be to delete this line of code, but this would prevent users from customizing the decorators.
Describe the steps
No response
Environment
No response
Relevant Log Output
No response
Extra Information
No response