Skip to content

Commit

Permalink
Edge name not displayed by default (#504)
Browse files Browse the repository at this point in the history
* name on line not displayed by default + refactoring
* update test references

Signed-off-by: Sophie Frasnedo <sophie.frasnedo@rte-france.com>
  • Loading branch information
So-Fras authored and BenoitJeanson committed May 4, 2023
1 parent dcbc531 commit 66918c4
Show file tree
Hide file tree
Showing 34 changed files with 20 additions and 3,042 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class SvgParameters {
private double loopEdgesAperture = Math.toRadians(60);
private double loopControlDistance = 40;
private boolean edgeInfoAlongEdge = true;
private boolean edgeNameDisplayed = true;
private boolean edgeNameDisplayed = false;
private double interAnnulusSpace = 5;
private String svgPrefix = "";
private boolean idDisplayed = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,23 +183,25 @@ private void drawEdgeCenter(XMLStreamWriter writer, BranchEdge edge) throws XMLS
if (BranchEdge.DANGLING_LINE_EDGE.equals(edge.getType())) {
return;
}
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:
draw2Wt(writer, edge);
break;
case BranchEdge.HVDC_LINE_EDGE:
drawConverterStation(writer, edge);
break;
default:
break;
}
if (svgParameters.isEdgeNameDisplayed()) {
drawEdgeLabel(writer, edge);
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:
draw2Wt(writer, edge);
break;
case BranchEdge.HVDC_LINE_EDGE:
drawConverterStation(writer, edge);
break;
default:
break;
}
if (svgParameters.isEdgeNameDisplayed()) {
drawEdgeLabel(writer, edge);
}
writer.writeEndElement();
}
writer.writeEndElement();
}

private void draw2Wt(XMLStreamWriter writer, BranchEdge edge) throws XMLStreamException {
Expand Down
Loading

0 comments on commit 66918c4

Please sign in to comment.