mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
"Trace Cut" can now be placed horizontally or vertically when "Cut
Between Lines" is selected
This commit is contained in:
@@ -2954,6 +2954,10 @@
|
|||||||
<changeType>NEW_FEATURE</changeType>
|
<changeType>NEW_FEATURE</changeType>
|
||||||
<description>Transistor components can display pinout instead of name or value</description>
|
<description>Transistor components can display pinout instead of name or value</description>
|
||||||
</org.diylc.appframework.update.Change>
|
</org.diylc.appframework.update.Change>
|
||||||
|
<org.diylc.appframework.update.Change>
|
||||||
|
<changeType>NEW_FEATURE</changeType>
|
||||||
|
<description>"Trace Cut" can now be placed horizontally or vertically when "Cut Between Lines" is selected</description>
|
||||||
|
</org.diylc.appframework.update.Change>
|
||||||
<org.diylc.appframework.update.Change>
|
<org.diylc.appframework.update.Change>
|
||||||
<changeType>IMPROVEMENT</changeType>
|
<changeType>IMPROVEMENT</changeType>
|
||||||
<description>Prevent the app from closing while running background operations, like saving and exporting files</description>
|
<description>Prevent the app from closing while running background operations, like saving and exporting files</description>
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import java.awt.Point;
|
|||||||
import java.awt.geom.Rectangle2D;
|
import java.awt.geom.Rectangle2D;
|
||||||
|
|
||||||
import org.diylc.common.ObjectCache;
|
import org.diylc.common.ObjectCache;
|
||||||
|
import org.diylc.common.OrientationHV;
|
||||||
import org.diylc.common.SimpleComponentTransformer;
|
import org.diylc.common.SimpleComponentTransformer;
|
||||||
import org.diylc.components.AbstractComponent;
|
import org.diylc.components.AbstractComponent;
|
||||||
import org.diylc.components.boards.AbstractBoard;
|
import org.diylc.components.boards.AbstractBoard;
|
||||||
@@ -64,6 +65,7 @@ public class TraceCut extends AbstractComponent<Void> {
|
|||||||
private Color borderColor = BORDER_COLOR;
|
private Color borderColor = BORDER_COLOR;
|
||||||
private Color boardColor = AbstractBoard.BOARD_COLOR;
|
private Color boardColor = AbstractBoard.BOARD_COLOR;
|
||||||
private Boolean cutBetweenHoles = false;
|
private Boolean cutBetweenHoles = false;
|
||||||
|
private OrientationHV orientation = OrientationHV.VERTICAL;
|
||||||
private Size holeSpacing = VeroBoard.SPACING;
|
private Size holeSpacing = VeroBoard.SPACING;
|
||||||
|
|
||||||
protected Point point = new Point(0, 0);
|
protected Point point = new Point(0, 0);
|
||||||
@@ -82,7 +84,10 @@ public class TraceCut extends AbstractComponent<Void> {
|
|||||||
g2d.setColor(componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING ? SELECTION_COLOR
|
g2d.setColor(componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING ? SELECTION_COLOR
|
||||||
: getBoardColor());
|
: getBoardColor());
|
||||||
drawingObserver.startTrackingContinuityArea(false);
|
drawingObserver.startTrackingContinuityArea(false);
|
||||||
g2d.fillRect(point.x - holeSpacing / 2 - cutWidth / 2, point.y - size / 2 - 1, cutWidth, size + 2);
|
if (getOrientation() == OrientationHV.VERTICAL)
|
||||||
|
g2d.fillRect(point.x - holeSpacing / 2 - cutWidth / 2, point.y - size / 2 - 1, cutWidth, size + 2);
|
||||||
|
else
|
||||||
|
g2d.fillRect(point.x - size / 2 - 1, point.y - holeSpacing / 2 - cutWidth / 2, size + 2, cutWidth);
|
||||||
drawingObserver.stopTrackingContinuityArea();
|
drawingObserver.stopTrackingContinuityArea();
|
||||||
} else {
|
} else {
|
||||||
g2d.setColor(componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING ? SELECTION_COLOR
|
g2d.setColor(componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING ? SELECTION_COLOR
|
||||||
@@ -193,7 +198,7 @@ public class TraceCut extends AbstractComponent<Void> {
|
|||||||
this.borderColor = borderColor;
|
this.borderColor = borderColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EditableProperty(name = "Cut between holes")
|
@EditableProperty(name = "Cut Between Holes")
|
||||||
public boolean getCutBetweenHoles() {
|
public boolean getCutBetweenHoles() {
|
||||||
if (cutBetweenHoles == null) {
|
if (cutBetweenHoles == null) {
|
||||||
cutBetweenHoles = false;
|
cutBetweenHoles = false;
|
||||||
@@ -217,7 +222,7 @@ public class TraceCut extends AbstractComponent<Void> {
|
|||||||
this.boardColor = boardColor;
|
this.boardColor = boardColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EditableProperty(name = "Hole spacing")
|
@EditableProperty(name = "Hole Spacing")
|
||||||
public Size getHoleSpacing() {
|
public Size getHoleSpacing() {
|
||||||
if (holeSpacing == null) {
|
if (holeSpacing == null) {
|
||||||
holeSpacing = VeroBoard.SPACING;
|
holeSpacing = VeroBoard.SPACING;
|
||||||
@@ -229,6 +234,17 @@ public class TraceCut extends AbstractComponent<Void> {
|
|||||||
this.holeSpacing = holeSpacing;
|
this.holeSpacing = holeSpacing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EditableProperty(name = "Cut Orientation")
|
||||||
|
public OrientationHV getOrientation() {
|
||||||
|
if (orientation == null)
|
||||||
|
orientation = OrientationHV.VERTICAL;
|
||||||
|
return orientation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrientation(OrientationHV orientation) {
|
||||||
|
this.orientation = orientation;
|
||||||
|
}
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
|||||||
Reference in New Issue
Block a user