4.27 release

This commit is contained in:
Bane Stojkovic
2022-08-28 10:07:46 +02:00
parent 9e3f1793fd
commit af4c22c856
10 changed files with 48 additions and 27 deletions
Binary file not shown.
@@ -23,18 +23,19 @@ package org.diylc.components.electromechanical;
public enum ToggleSwitchType {
SPST, SPDT, DPDT, _DP3T_mustang, _3PDT, _4PDT, _5PDT, SPDT_off, DPDT_off, _3PDT_off, _4PDT_off, _5PDT_off, DPDT_ononon_1, DPDT_ononon_2;
SPST("SPST"), SPDT("SPDT (On/On)"), SPDT_off("SPDT (On/Off/On"), DPDT("DPDT (On/On)"),DPDT_off("DPDT (On/Off/On"),
DPDT_ononon_1("DPDT (On/On/On Type 1)"), DPDT_ononon_2("DPDT (On/On/On Type 2)"),
_DP3T_mustang("DP3T"), _3PDT("3PDT"),_3PDT_off("3PDT (On/Off/On)"), _4PDT("4PDT"), _4PDT_off("4PDT (On/Off/On)"),
_5PDT("5PDT"), _5PDT_off("5PDT (On/Off/On)");
private String label;
private ToggleSwitchType(String label) {
this.label = label;
}
@Override
public String toString() {
String name = name();
if (name.startsWith("_"))
name = name.substring(1);
name = name.replace("_", " ");
name = name.replace("mustang", "");
name = name.replace("off", " (Center OFF)");
name = name.replace("ononon_1", " On/On/On (Type 1)");
name = name.replace("ononon_2", " On/On/On (Type 2)");
return name;
return label;
}
}
@@ -23,10 +23,9 @@ package org.diylc.components.misc;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.geom.GeneralPath;
import java.awt.geom.Ellipse2D;
import java.awt.geom.GeneralPath;
import java.awt.geom.Line2D;
import org.diylc.components.AbstractSchematicLeadedSymbol;
import org.diylc.core.CreationMethod;
import org.diylc.core.IDIYComponent;
@@ -35,7 +34,6 @@ import org.diylc.core.annotations.EditableProperty;
import org.diylc.core.measures.CurrentUnit;
import org.diylc.core.measures.Size;
import org.diylc.core.measures.SizeUnit;
import org.diylc.core.measures.VoltageUnit;
@ComponentDescriptor(name = "Current Source", author = "JD", category = "Schematic Symbols", creationMethod = CreationMethod.POINT_BY_POINT,
instanceNamePrefix = "I", description = "Current Source schematic symbol", zOrder = IDIYComponent.COMPONENT)
@@ -81,7 +79,7 @@ public class CurrentSourceSymbol extends AbstractSchematicLeadedSymbol<String> {
return currentNew;
}
public void setVoltageNew(org.diylc.core.measures.Current currentNew) {
public void setCurrentNew(org.diylc.core.measures.Current currentNew) {
this.currentNew = currentNew;
}
@@ -25,7 +25,6 @@ import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.geom.CubicCurve2D;
import java.awt.geom.Ellipse2D;
import java.awt.geom.GeneralPath;
import java.awt.geom.Line2D;
import org.diylc.components.AbstractSchematicLeadedSymbol;
import org.diylc.core.CreationMethod;
@@ -119,9 +118,7 @@ public class VoltageSourceSymbol extends AbstractSchematicLeadedSymbol<String> {
// Main body is a circle, drawn with an Ellipse
double width = getWidth().convertToPixels();
double length = getLength().convertToPixels();
GeneralPath body = new GeneralPath();
body.append(new Ellipse2D.Double(0d, 0d, width, length), true);
return (Shape) body;
return new Ellipse2D.Double(0d, 0d, width, length);
}
@Override