mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-12 02:02:16 +10:00
Multi-layer PCB support
This commit is contained in:
Binary file not shown.
+14
@@ -5,6 +5,7 @@ import java.awt.Graphics2D;
|
|||||||
import java.awt.Shape;
|
import java.awt.Shape;
|
||||||
|
|
||||||
import org.diylc.common.ObjectCache;
|
import org.diylc.common.ObjectCache;
|
||||||
|
import org.diylc.common.PCBLayer;
|
||||||
import org.diylc.components.AbstractLeadedComponent;
|
import org.diylc.components.AbstractLeadedComponent;
|
||||||
import org.diylc.core.ComponentState;
|
import org.diylc.core.ComponentState;
|
||||||
import org.diylc.core.CreationMethod;
|
import org.diylc.core.CreationMethod;
|
||||||
@@ -26,6 +27,7 @@ public class CopperTrace extends AbstractLeadedComponent<Void> {
|
|||||||
|
|
||||||
private Color leadColor = COLOR;
|
private Color leadColor = COLOR;
|
||||||
private Size thickness = THICKNESS;
|
private Size thickness = THICKNESS;
|
||||||
|
private PCBLayer layer = PCBLayer._1;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawIcon(Graphics2D g2d, int width, int height) {
|
public void drawIcon(Graphics2D g2d, int width, int height) {
|
||||||
@@ -63,6 +65,18 @@ public class CopperTrace extends AbstractLeadedComponent<Void> {
|
|||||||
this.thickness = thickness;
|
this.thickness = thickness;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EditableProperty
|
||||||
|
public PCBLayer getLayer() {
|
||||||
|
if (layer == null) {
|
||||||
|
layer = PCBLayer._1;
|
||||||
|
}
|
||||||
|
return layer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLayer(PCBLayer layer) {
|
||||||
|
this.layer = layer;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getLeadThickness() {
|
protected int getLeadThickness() {
|
||||||
return (int) getThickness().convertToPixels();
|
return (int) getThickness().convertToPixels();
|
||||||
|
|||||||
+14
@@ -5,6 +5,7 @@ import java.awt.Graphics2D;
|
|||||||
import java.awt.geom.CubicCurve2D;
|
import java.awt.geom.CubicCurve2D;
|
||||||
|
|
||||||
import org.diylc.common.ObjectCache;
|
import org.diylc.common.ObjectCache;
|
||||||
|
import org.diylc.common.PCBLayer;
|
||||||
import org.diylc.components.AbstractCurvedComponent;
|
import org.diylc.components.AbstractCurvedComponent;
|
||||||
import org.diylc.core.ComponentState;
|
import org.diylc.core.ComponentState;
|
||||||
import org.diylc.core.IDIYComponent;
|
import org.diylc.core.IDIYComponent;
|
||||||
@@ -23,6 +24,7 @@ public class CurvedTrace extends AbstractCurvedComponent<Void> {
|
|||||||
public static Size SIZE = new Size(1d, SizeUnit.mm);
|
public static Size SIZE = new Size(1d, SizeUnit.mm);
|
||||||
|
|
||||||
protected Size size = SIZE;
|
protected Size size = SIZE;
|
||||||
|
private PCBLayer layer = PCBLayer._1;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Color getDefaultColor() {
|
protected Color getDefaultColor() {
|
||||||
@@ -48,6 +50,18 @@ public class CurvedTrace extends AbstractCurvedComponent<Void> {
|
|||||||
this.size = size;
|
this.size = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EditableProperty
|
||||||
|
public PCBLayer getLayer() {
|
||||||
|
if (layer == null) {
|
||||||
|
layer = PCBLayer._1;
|
||||||
|
}
|
||||||
|
return layer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLayer(PCBLayer layer) {
|
||||||
|
this.layer = layer;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Void getValue() {
|
public Void getValue() {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
+15
@@ -6,6 +6,7 @@ import java.awt.Point;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
import org.diylc.common.ObjectCache;
|
import org.diylc.common.ObjectCache;
|
||||||
|
import org.diylc.common.PCBLayer;
|
||||||
import org.diylc.components.AbstractComponent;
|
import org.diylc.components.AbstractComponent;
|
||||||
import org.diylc.core.ComponentState;
|
import org.diylc.core.ComponentState;
|
||||||
import org.diylc.core.IDIYComponent;
|
import org.diylc.core.IDIYComponent;
|
||||||
@@ -36,6 +37,7 @@ public class GroundFill extends AbstractComponent<Void> {
|
|||||||
|
|
||||||
protected Color color = COLOR;
|
protected Color color = COLOR;
|
||||||
protected PointCount pointCount = PointCount._4;
|
protected PointCount pointCount = PointCount._4;
|
||||||
|
private PCBLayer layer = PCBLayer._1;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(Graphics2D g2d, ComponentState componentState,
|
public void draw(Graphics2D g2d, ComponentState componentState,
|
||||||
@@ -114,6 +116,19 @@ public class GroundFill extends AbstractComponent<Void> {
|
|||||||
this.pointCount = pointCount;
|
this.pointCount = pointCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EditableProperty
|
||||||
|
public PCBLayer getLayer() {
|
||||||
|
if (layer == null) {
|
||||||
|
layer = PCBLayer._1;
|
||||||
|
}
|
||||||
|
return layer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLayer(PCBLayer layer) {
|
||||||
|
this.layer = layer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@Override
|
@Override
|
||||||
public Void getValue() {
|
public Void getValue() {
|
||||||
|
|||||||
+14
@@ -4,6 +4,7 @@ import java.awt.Color;
|
|||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
|
|
||||||
|
import org.diylc.common.PCBLayer;
|
||||||
import org.diylc.components.AbstractComponent;
|
import org.diylc.components.AbstractComponent;
|
||||||
import org.diylc.core.ComponentState;
|
import org.diylc.core.ComponentState;
|
||||||
import org.diylc.core.IDIYComponent;
|
import org.diylc.core.IDIYComponent;
|
||||||
@@ -31,6 +32,7 @@ public class SolderPad extends AbstractComponent<Void> {
|
|||||||
private Point point = new Point(0, 0);
|
private Point point = new Point(0, 0);
|
||||||
private Type type = Type.ROUND;
|
private Type type = Type.ROUND;
|
||||||
private Size holeSize = HOLE_SIZE;
|
private Size holeSize = HOLE_SIZE;
|
||||||
|
private PCBLayer layer = PCBLayer._1;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(Graphics2D g2d, ComponentState componentState, boolean outlineMode,
|
public void draw(Graphics2D g2d, ComponentState componentState, boolean outlineMode,
|
||||||
@@ -84,6 +86,18 @@ public class SolderPad extends AbstractComponent<Void> {
|
|||||||
this.holeSize = holeSize;
|
this.holeSize = holeSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EditableProperty
|
||||||
|
public PCBLayer getLayer() {
|
||||||
|
if (layer == null) {
|
||||||
|
layer = PCBLayer._1;
|
||||||
|
}
|
||||||
|
return layer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLayer(PCBLayer layer) {
|
||||||
|
this.layer = layer;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return super.getName();
|
return super.getName();
|
||||||
|
|||||||
Reference in New Issue
Block a user