mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-07 12:24:58 +10:00
Capacitor components now label their terminal nodes as '+' and '-' instead of '1' and '2' when 'Polarized' property is ticked
This commit is contained in:
@@ -397,6 +397,10 @@
|
||||
<changeType>IMPROVEMENT</changeType>
|
||||
<description>Diode components now label their terminal nodes as 'A' (anode) and 'K' (cathode) instead of '1' and '2'</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>IMPROVEMENT</changeType>
|
||||
<description>Capacitor components now label their terminal nodes as '+' and '-' instead of '1' and '2' when 'Polarized' property is ticked</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>IMPROVEMENT</changeType>
|
||||
<description>Percentage values such as transparency Alpha, image Scale, etc, can have decimal values and not just integers</description>
|
||||
|
||||
+13
@@ -203,6 +203,19 @@ public class AxialElectrolyticCapacitor extends AbstractLeadedComponent<Capacita
|
||||
this.polarized = polarized;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getControlPointNodeName(int index) {
|
||||
if (getPolarized()) {
|
||||
switch (index) {
|
||||
case 0:
|
||||
return "+";
|
||||
case 1:
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
return super.getControlPointNodeName(index);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Shape getBodyShape() {
|
||||
double lengthFinal = getLength().convertToPixels();
|
||||
|
||||
@@ -96,6 +96,19 @@ public class CapacitorSymbol extends AbstractSchematicLeadedSymbol<Capacitance>
|
||||
this.polarized = polarized;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getControlPointNodeName(int index) {
|
||||
if (getPolarized()) {
|
||||
switch (index) {
|
||||
case 0:
|
||||
return "+";
|
||||
case 1:
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
return super.getControlPointNodeName(index);
|
||||
}
|
||||
|
||||
public void drawIcon(Graphics2D g2d, int width, int height) {
|
||||
g2d.rotate(-Math.PI / 4, width / 2, height / 2);
|
||||
g2d.setColor(LEAD_COLOR);
|
||||
|
||||
+15
-1
@@ -72,6 +72,7 @@ public class RadialElectrolytic extends AbstractRadialComponent<Capacitance> imp
|
||||
private boolean polarized = true;
|
||||
private boolean folded = false;
|
||||
private Size height = HEIGHT;
|
||||
@Deprecated
|
||||
private boolean invert = false;
|
||||
|
||||
public RadialElectrolytic() {
|
||||
@@ -304,7 +305,7 @@ public class RadialElectrolytic extends AbstractRadialComponent<Capacitance> imp
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
@EditableProperty(name = "Invert Polarity")
|
||||
// @EditableProperty(name = "Invert Polarity")
|
||||
public boolean getInvert() {
|
||||
return invert;
|
||||
}
|
||||
@@ -313,6 +314,19 @@ public class RadialElectrolytic extends AbstractRadialComponent<Capacitance> imp
|
||||
this.invert = invert;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getControlPointNodeName(int index) {
|
||||
if (getPolarized()) {
|
||||
switch (index) {
|
||||
case 0:
|
||||
return getInvert() ? "-" : "+";
|
||||
case 1:
|
||||
return getInvert() ? "+" : "-";
|
||||
}
|
||||
}
|
||||
return super.getControlPointNodeName(index);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Shape getBodyShape() {
|
||||
double height = (int) getHeight().convertToPixels();
|
||||
|
||||
Reference in New Issue
Block a user