Skip to content

Migration guide v3.2.0

Florian Dupuy edited this page Apr 7, 2023 · 16 revisions

powsybl-single-line-diagram

Styles refactor

Nominal voltage style provider

If you are using NominalVoltageDiagramStyleProvider, be aware that it has been moved in this release to package com.powsybl.sld.svg.styles and renamed to NominalVoltageStyleProvider. Note that you don't need a network to construct such a provider anymore. Besides, if you were using the highlight line state layoutParameters.setHighlightLineStateStyle(true), you should replace

new NominalVoltageDiagramStyleProvider(network);

with

new StyleProvidersList(new NominalVoltageStyleProvider(), new HighlightLineStateStyleProvider(network));

Topological style provider

If you are using TopologicalStyleProvider, be aware that it has been moved in this release to package com.powsybl.sld.svg.styles.iidm. Besides, if you were using the highlight line state layoutParameters.setHighlightLineStateStyle(true), you should replace

new TopologicalStyleProvider(network);

with

new StyleProvidersList(new TopologicalStyleProvider(network), new HighlightLineStateStyleProvider(network));

Style provider interface

DiagramStyleProvider has been renamed to StyleProvider and moved to package com.powsybl.sld.svg.styles. The methods name have been renamed:

  • DiagramStyleProvider::getSvgWireStyles is renamed into StyleProvider::getEdgeStyles
  • DiagramStyleProvider::getSvgNodeStyles is renamed into StyleProvider::getNodeStyles
  • DiagramStyleProvider::getSvgNodeDecoratorStyles is renamed into StyleProvider::getNodeDecoratorStyles
  • DiagramStyleProvider::getZoneLineStyles is renamed into StyleProvider::getBranchEdgeStyles
  • DiagramStyleProvider::getSvgNodeSubcomponentStyles is renamed into StyleProvider::getNodeSubcomponentStyles
  • StyleProvider::getBusInfoStyle should now return a List<String> instead of an Optional<String>

Other style providers

  • BasicStyleProvider has been moved to package com.powsybl.sld.svg.styles,
  • AbstractBaseVoltageDiagramStyleProvider has been renamed to AbstractVoltageStyleProvider and moved to package com.powsybl.sld.svg.styles,
  • a new style provider AnimatedFeederInfoStyleProvider for animating arrows of feeder infos has been added
  • a new abstract basic style provider AbstractStyleProvider has been added
  • a new style provider StyleProvidersList has been added to have multiple style providers at once

Id escaping

If you were using id escaping methods which were in DiagramStyles utility class, these methods have been moved to com.powsybl.sld.util.IdUtil in this release.

Style classes

If you are using style classes constants which were in DiagramStyles utility class, this class has been renamed to com.powsybl.sld.svg.styles.StyleClassConstants in this release.

Highlight line state

The highlightLineStateStyle parameter in LayoutParameters has been removed and replaced by a style provider class HighlightLineStateStyleProvider. As mentioned above, if you were using a TopologicalStyleProvider with layoutParameters.setHighlightLineStateStyle(true), you should replace

new NominalVoltageDiagramStyleProvider(network);

with

new StyleProvidersList(new NominalVoltageStyleProvider(), new HighlightLineStateStyleProvider(network));

Component library change

Three library components have been added in this release which were not displayed before, therefore if you're interested by one of them and if you have got your own component library, you should add in that component library:

  • a component of componentType BATTERY and styleClass sld-battery for displaying batteries,
  • a component of componentType UNKNOWN_COMPONENT and styleClass sld-unknown for displaying a default component if one component is missing in your library,
  • a component of componentType ARROW_CURRENT and styleClass sld-current for displaying the value of the current as a feeder info.

CSS changes

In components.css files

The styles corresponding to the new components should be added if you're customizing the given CSS, knowing that the CSS provided give the following values:

In ConvergenceLibrary

.sld-battery {stroke: var(--sld-vl-color, blue); fill: none}
.sld-unknown {stroke: none; fill: black}
.sld-feeder-info.sld-current {fill:purple}

In FlatDesignLibrary

.sld-battery {fill: var(--sld-vl-color, blue)}
.sld-unknown {stroke: none; fill: black}
.sld-feeder-info.sld-current {fill:#800080}

In tautologies.css

Before

.sld-active-power .sld-label {dominant-baseline: middle}
.sld-reactive-power .sld-label {dominant-baseline: middle}

After

.sld-active-power .sld-label {dominant-baseline: mathematical}
.sld-reactive-power .sld-label {dominant-baseline: mathematical}
.sld-current .sld-label {dominant-baseline: mathematical}

powsybl-network-area-diagram

CSS changes

In nominalStyle.css and in topologicalStyle.css

The following class styles have been removed:

.nad-active {visibility: visible}
.nad-reactive {visibility: hidden}

The following class style has been added:

.nad-current path {stroke: none; fill: #bd4802}