improve multi-section cap

add more variants
This commit is contained in:
Branislav Stojkovic
2019-01-09 10:41:38 +01:00
parent 8e5b4b0ecc
commit beb6c4857d
5 changed files with 526 additions and 8 deletions
@@ -112,7 +112,7 @@ public class MultiSectionCapacitor extends AbstractTransparentComponent<Capacita
}
private String getStringValue() {
if (value == null)
if (value == null || value.length == 0)
return "";
StringBuilder sb = new StringBuilder();
boolean isFirst = true;
@@ -121,10 +121,10 @@ public class MultiSectionCapacitor extends AbstractTransparentComponent<Capacita
isFirst = false;
else
sb.append("/");
sb.append(c == null ? "" : format.format(c.getValue()));
sb.append(c == null || c.getValue() == null ? "" : format.format(c.getValue()));
}
if (value[0] != null)
sb.append(" " + value[0].getUnit());
sb.append(" " + value[0].getUnit() == null ? "" : value[0].getUnit());
return sb.toString();
}
@@ -143,7 +143,10 @@ public class MultiSectionCapacitor extends AbstractTransparentComponent<Capacita
}
public void setDiameter(Size diameter) {
this.diameter = diameter;
this.diameter = diameter;
// Reset body shape;
updateControlPoints();
body = null;
}
@EditableProperty