Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused glued and stretchable style classes #676

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ public interface StyleProvider {
String LABEL_BOX_CLASS = CLASSES_PREFIX + "label-box";
String LEGEND_SQUARE_CLASS = CLASSES_PREFIX + "legend-square";
String PST_ARROW_CLASS = CLASSES_PREFIX + "pst-arrow";
String STRETCHABLE_CLASS = CLASSES_PREFIX + "stretchable";
String GLUED_CLASS = CLASSES_PREFIX + "glued";
String GLUED_CENTER_CLASS = CLASSES_PREFIX + "glued-center";

List<String> getCssFilenames();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ private void drawEdgeCenter(XMLStreamWriter writer, BranchEdge edge) throws XMLS
}
if (!BranchEdge.LINE_EDGE.equals(edge.getType()) || svgParameters.isEdgeNameDisplayed()) {
writer.writeStartElement(GROUP_ELEMENT_NAME);
writer.writeAttribute(CLASS_ATTRIBUTE, StyleProvider.GLUED_CENTER_CLASS);
switch (edge.getType()) {
case BranchEdge.PST_EDGE:
case BranchEdge.TWO_WT_EDGE:
Expand Down Expand Up @@ -255,7 +254,7 @@ private void drawHalfEdge(Graph graph, XMLStreamWriter writer, BranchEdge edge,
Optional<EdgeInfo> edgeInfo = labelProvider.getEdgeInfo(graph, edge, side);
if (!graph.isLoop(edge)) {
writer.writeEmptyElement(POLYLINE_ELEMENT_NAME);
writeStyleClasses(writer, StyleProvider.EDGE_PATH_CLASS, StyleProvider.STRETCHABLE_CLASS, StyleProvider.GLUED_CLASS + "-" + side.getNum());
writeStyleClasses(writer, StyleProvider.EDGE_PATH_CLASS);
writer.writeAttribute(POINTS_ATTRIBUTE, getPolylinePointsString(edge, side));
if (edgeInfo.isPresent()) {
drawBranchEdgeInfo(graph, writer, edge, side, edgeInfo.get());
Expand Down Expand Up @@ -301,7 +300,7 @@ private void drawThreeWtEdge(Graph graph, XMLStreamWriter writer, ThreeWtEdge ed
insertName(writer, edge::getName);

writer.writeEmptyElement(POLYLINE_ELEMENT_NAME);
writeStyleClasses(writer, StyleProvider.EDGE_PATH_CLASS, StyleProvider.STRETCHABLE_CLASS);
writeStyleClasses(writer, StyleProvider.EDGE_PATH_CLASS);
writer.writeAttribute(POINTS_ATTRIBUTE, getPolylinePointsString(edge));

Optional<EdgeInfo> edgeInfo = labelProvider.getEdgeInfo(graph, edge);
Expand Down Expand Up @@ -351,15 +350,13 @@ private void drawLoopEdgeInfo(XMLStreamWriter writer, BranchEdge edge, BranchEdg
private void drawBranchEdgeInfo(Graph graph, XMLStreamWriter writer, BranchEdge edge, BranchEdge.Side side, EdgeInfo edgeInfo) throws XMLStreamException {
VoltageLevelNode vlNode = graph.getVoltageLevelNode(edge, side);
BusNode busNode = graph.getBusGraphNode(edge, side);
List<String> additionalStyles = List.of(StyleProvider.GLUED_CLASS + "-" + side.getNum());
drawEdgeInfo(writer, additionalStyles, edgeInfo, getArrowCenter(vlNode, busNode, edge.getPoints(side)), edge.getEdgeEndAngle(side));
drawEdgeInfo(writer, edgeInfo, getArrowCenter(vlNode, busNode, edge.getPoints(side)), edge.getEdgeEndAngle(side));
}

private void drawThreeWtEdgeInfo(Graph graph, XMLStreamWriter writer, ThreeWtEdge edge, EdgeInfo edgeInfo) throws XMLStreamException {
VoltageLevelNode vlNode = graph.getVoltageLevelNode(edge);
BusNode busNode = graph.getBusGraphNode(edge);
List<String> additionalStyles = List.of(StyleProvider.GLUED_CLASS + "-1");
drawEdgeInfo(writer, additionalStyles, edgeInfo, getArrowCenter(vlNode, busNode, edge.getPoints()), edge.getEdgeAngle());
drawEdgeInfo(writer, edgeInfo, getArrowCenter(vlNode, busNode, edge.getPoints()), edge.getEdgeAngle());
}

private void drawEdgeInfo(XMLStreamWriter writer, EdgeInfo edgeInfo, Point infoCenter, double edgeAngle) throws XMLStreamException {
Expand Down
12 changes: 6 additions & 6 deletions network-area-diagram/src/test/resources/3wt.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions network-area-diagram/src/test/resources/3wt_disconnected.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions network-area-diagram/src/test/resources/3wt_partial.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading