mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
Ability to flip polarity of IC symbol
This commit is contained in:
@@ -71,6 +71,7 @@ public class ICSymbol extends AbstractTransparentComponent<String> {
|
||||
protected Color borderColor = BORDER_COLOR;
|
||||
protected Display display = Display.NAME;
|
||||
transient private Shape[] body;
|
||||
private Boolean flip;
|
||||
|
||||
public ICSymbol() {
|
||||
super();
|
||||
@@ -136,9 +137,9 @@ public class ICSymbol extends AbstractTransparentComponent<String> {
|
||||
drawCenteredText(g2d, label, x, controlPoints[0].y + pinSpacing, HorizontalAlignment.CENTER,
|
||||
VerticalAlignment.CENTER);
|
||||
// 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);
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -276,6 +277,17 @@ public class ICSymbol extends AbstractTransparentComponent<String> {
|
||||
this.borderColor = borderColor;
|
||||
}
|
||||
|
||||
@EditableProperty
|
||||
public Boolean getFlip() {
|
||||
if (flip == null)
|
||||
flip = false;
|
||||
return flip;
|
||||
}
|
||||
|
||||
public void setFlip(Boolean flip) {
|
||||
this.flip = flip;
|
||||
}
|
||||
|
||||
@EditableProperty
|
||||
public Display getDisplay() {
|
||||
return display;
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -2226,6 +2226,10 @@
|
||||
<changeType>NEW_FEATURE</changeType>
|
||||
<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>
|
||||
<changeType>IMPROVEMENT</changeType>
|
||||
<description>Use hardware acceleration for rendering to improve performance</description>
|
||||
|
||||
Reference in New Issue
Block a user