diff --git a/diagram-viewer/src/main/java/com/powsybl/diagram/viewer/nad/NetworkAreaDiagramController.java b/diagram-viewer/src/main/java/com/powsybl/diagram/viewer/nad/NetworkAreaDiagramController.java index 74b056c..0305690 100644 --- a/diagram-viewer/src/main/java/com/powsybl/diagram/viewer/nad/NetworkAreaDiagramController.java +++ b/diagram-viewer/src/main/java/com/powsybl/diagram/viewer/nad/NetworkAreaDiagramController.java @@ -25,7 +25,6 @@ import java.io.IOException; import java.io.StringWriter; -import java.util.List; import java.util.function.Predicate; /** @@ -76,18 +75,10 @@ protected String call() { } private static Predicate getVoltageLevelFilter(Network network, NetworkAreaDiagramModel model, Container container) { - switch (container.getContainerType()) { - case NETWORK -> { - return VoltageLevelFilter.NO_FILTER; - } - case SUBSTATION -> { - List vls = ((Substation) container).getVoltageLevelStream().map(VoltageLevel::getId).toList(); - return VoltageLevelFilter.createVoltageLevelsDepthFilter(network, vls, model.getDepth()); - } - case VOLTAGE_LEVEL -> { - return VoltageLevelFilter.createVoltageLevelDepthFilter(network, container.getId(), model.getDepth()); - } - default -> throw new AssertionError(); - } + return switch (container.getContainerType()) { + case NETWORK -> VoltageLevelFilter.NO_FILTER; + case SUBSTATION -> VoltageLevelFilter.createVoltageLevelsDepthFilter(network, ((Substation) container).getVoltageLevelStream().map(VoltageLevel::getId).toList(), model.getDepth()); + case VOLTAGE_LEVEL -> VoltageLevelFilter.createVoltageLevelDepthFilter(network, container.getId(), model.getDepth()); + }; } } diff --git a/diagram-viewer/src/main/java/com/powsybl/diagram/viewer/sld/PositionVoltageLevelLayoutBean.java b/diagram-viewer/src/main/java/com/powsybl/diagram/viewer/sld/PositionVoltageLevelLayoutBean.java index 4ddd950..c00d707 100644 --- a/diagram-viewer/src/main/java/com/powsybl/diagram/viewer/sld/PositionVoltageLevelLayoutBean.java +++ b/diagram-viewer/src/main/java/com/powsybl/diagram/viewer/sld/PositionVoltageLevelLayoutBean.java @@ -49,11 +49,11 @@ public BooleanProperty substituteSingularFictitiousNodesProperty() { public PositionVoltageLevelLayoutFactoryParameters getParameters() { PositionVoltageLevelLayoutFactoryParameters parameters = new PositionVoltageLevelLayoutFactoryParameters(); - parameters.setFeederStacked(stackFeeders.get()); - parameters.setExceptionIfPatternNotHandled(exceptionWhenPatternUnhandled.get()); - parameters.setHandleShunts(handleShunts.get()); - parameters.setRemoveUnnecessaryFictitiousNodes(removeFictitiousNodes.get()); - parameters.setSubstituteSingularFictitiousByFeederNode(substituteSingularFictitiousNodes.get()); + parameters.setFeederStacked(stackFeeders.get()) + .setExceptionIfPatternNotHandled(exceptionWhenPatternUnhandled.get()) + .setHandleShunts(handleShunts.get()) + .setRemoveUnnecessaryFictitiousNodes(removeFictitiousNodes.get()) + .setSubstituteSingularFictitiousByFeederNode(substituteSingularFictitiousNodes.get()); return parameters; }