|
17 | 17 | import org.w3c.dom.Element; |
18 | 18 | import org.w3c.dom.Text; |
19 | 19 |
|
20 | | -import java.util.ArrayList; |
21 | 20 | import java.util.List; |
22 | 21 | import java.util.Objects; |
23 | 22 |
|
@@ -60,14 +59,13 @@ public void drawLegend(VoltageLevelGraph graph, GraphMetadata metadata, StylePro |
60 | 59 | protected List<BusLegendInfo> getBusLegendInfos(VoltageLevelGraph graph) { |
61 | 60 | VoltageLevel vl = network.getVoltageLevel(graph.getVoltageLevelInfos().id()); |
62 | 61 | return vl.getBusView().getBusStream() |
63 | | - .map(bus -> { |
64 | | - List<BusLegendInfo.Caption> captions = new ArrayList<>(4); |
65 | | - captions.add(new BusLegendInfo.Caption(valueFormatter.formatVoltage(bus.getV(), "kV"), "v")); |
66 | | - captions.add(new BusLegendInfo.Caption(valueFormatter.formatAngleInDegrees(bus.getAngle()), "angle")); |
67 | | - captions.add(new BusLegendInfo.Caption(valueFormatter.formatPower(bus.getFictitiousP0(), withDefaultUnit(svgParameters.getActivePowerUnit(), "MW")), "fictitiousP0")); |
68 | | - captions.add(new BusLegendInfo.Caption(valueFormatter.formatPower(bus.getFictitiousQ0(), withDefaultUnit(svgParameters.getReactivePowerUnit(), "MVar")), "fictitiousQ0")); |
69 | | - return new BusLegendInfo(bus.getId(), captions); |
70 | | - }).toList(); |
| 62 | + .map(bus -> new BusLegendInfo(bus.getId(), List.of( |
| 63 | + new BusLegendInfo.Caption(valueFormatter.formatVoltage(bus.getV(), "kV"), "v"), |
| 64 | + new BusLegendInfo.Caption(valueFormatter.formatAngleInDegrees(bus.getAngle()), "angle"), |
| 65 | + new BusLegendInfo.Caption(valueFormatter.formatPower(bus.getFictitiousP0(), withDefaultUnit(svgParameters.getActivePowerUnit(), "MW")), "fictitiousP0"), |
| 66 | + new BusLegendInfo.Caption(valueFormatter.formatPower(bus.getFictitiousQ0(), withDefaultUnit(svgParameters.getReactivePowerUnit(), "MVar")), "fictitiousQ0") |
| 67 | + ))) |
| 68 | + .toList(); |
71 | 69 | } |
72 | 70 |
|
73 | 71 | private static String withDefaultUnit(String configuredUnit, String defaultUnit) { |
|
0 commit comments