mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 09:12:09 +10:00
Ability to flip polarity of IC symbol
This commit is contained in:
@@ -70,7 +70,8 @@ public class ICSymbol extends AbstractTransparentComponent<String> {
|
|||||||
protected Color bodyColor = BODY_COLOR;
|
protected Color bodyColor = BODY_COLOR;
|
||||||
protected Color borderColor = BORDER_COLOR;
|
protected Color borderColor = BORDER_COLOR;
|
||||||
protected Display display = Display.NAME;
|
protected Display display = Display.NAME;
|
||||||
transient private Shape[] body;
|
transient private Shape[] body;
|
||||||
|
private Boolean flip;
|
||||||
|
|
||||||
public ICSymbol() {
|
public ICSymbol() {
|
||||||
super();
|
super();
|
||||||
@@ -135,10 +136,10 @@ public class ICSymbol extends AbstractTransparentComponent<String> {
|
|||||||
}
|
}
|
||||||
drawCenteredText(g2d, label, x, controlPoints[0].y + pinSpacing, HorizontalAlignment.CENTER,
|
drawCenteredText(g2d, label, x, controlPoints[0].y + pinSpacing, HorizontalAlignment.CENTER,
|
||||||
VerticalAlignment.CENTER);
|
VerticalAlignment.CENTER);
|
||||||
// Draw +/- markers
|
// Draw +/- markers
|
||||||
drawCenteredText(g2d, "-", controlPoints[0].x + pinSpacing, controlPoints[0].y, HorizontalAlignment.CENTER,
|
drawCenteredText(g2d, getFlip() ? "+" : "-", controlPoints[0].x + pinSpacing, controlPoints[0].y, HorizontalAlignment.CENTER,
|
||||||
VerticalAlignment.CENTER);
|
VerticalAlignment.CENTER);
|
||||||
drawCenteredText(g2d, "+", controlPoints[1].x + pinSpacing, controlPoints[1].y, HorizontalAlignment.CENTER,
|
drawCenteredText(g2d, getFlip() ? "-" : "+", controlPoints[1].x + pinSpacing, controlPoints[1].y, HorizontalAlignment.CENTER,
|
||||||
VerticalAlignment.CENTER);
|
VerticalAlignment.CENTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -274,6 +275,17 @@ public class ICSymbol extends AbstractTransparentComponent<String> {
|
|||||||
|
|
||||||
public void setBorderColor(Color borderColor) {
|
public void setBorderColor(Color borderColor) {
|
||||||
this.borderColor = borderColor;
|
this.borderColor = borderColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@EditableProperty
|
||||||
|
public Boolean getFlip() {
|
||||||
|
if (flip == null)
|
||||||
|
flip = false;
|
||||||
|
return flip;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlip(Boolean flip) {
|
||||||
|
this.flip = flip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EditableProperty
|
@EditableProperty
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -2225,6 +2225,10 @@
|
|||||||
<org.diylc.appframework.update.Change>
|
<org.diylc.appframework.update.Change>
|
||||||
<changeType>NEW_FEATURE</changeType>
|
<changeType>NEW_FEATURE</changeType>
|
||||||
<description>Added optional arrow to the "Line" component together with configurable thickness</description>
|
<description>Added optional arrow to the "Line" component together with configurable thickness</description>
|
||||||
|
</org.diylc.appframework.update.Change>
|
||||||
|
<org.diylc.appframework.update.Change>
|
||||||
|
<changeType>NEW_FEATURE</changeType>
|
||||||
|
<description>Ability to flip polarity of IC symbol</description>
|
||||||
</org.diylc.appframework.update.Change>
|
</org.diylc.appframework.update.Change>
|
||||||
<org.diylc.appframework.update.Change>
|
<org.diylc.appframework.update.Change>
|
||||||
<changeType>IMPROVEMENT</changeType>
|
<changeType>IMPROVEMENT</changeType>
|
||||||
|
|||||||
Reference in New Issue
Block a user