mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +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 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();
|
||||||
@@ -136,9 +137,9 @@ 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -276,6 +277,17 @@ public class ICSymbol extends AbstractTransparentComponent<String> {
|
|||||||
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
|
||||||
public Display getDisplay() {
|
public Display getDisplay() {
|
||||||
return display;
|
return display;
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -2226,6 +2226,10 @@
|
|||||||
<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>
|
||||||
|
<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>
|
||||||
<changeType>IMPROVEMENT</changeType>
|
<changeType>IMPROVEMENT</changeType>
|
||||||
<description>Use hardware acceleration for rendering to improve performance</description>
|
<description>Use hardware acceleration for rendering to improve performance</description>
|
||||||
|
|||||||
Reference in New Issue
Block a user