mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
reduced number of base layers
This commit is contained in:
Binary file not shown.
+5
-9
@@ -30,15 +30,11 @@ import org.diylc.core.annotations.EditableProperty;
|
|||||||
*/
|
*/
|
||||||
public interface IDIYComponent<T> extends Serializable {
|
public interface IDIYComponent<T> extends Serializable {
|
||||||
|
|
||||||
public static final int BELOW_CHASSIS = 1;
|
public static final int CHASSIS = 1;
|
||||||
public static final int CHASSIS = 2;
|
public static final int BOARD = 2;
|
||||||
public static final int ABOVE_CHASSIS = 3;
|
public static final int TRACE = 3;
|
||||||
public static final int BELOW_BOARD = 4;
|
public static final int COMPONENT = 4;
|
||||||
public static final int BOARD = 5;
|
public static final int TEXT = 5;
|
||||||
public static final int ABOVE_BOARD = 6;
|
|
||||||
public static final int BELOW_COMPONENT = 7;
|
|
||||||
public static final int COMPONENT = 8;
|
|
||||||
public static final int ABOVE_COMPONENT = 9;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return component instance name.
|
* @return component instance name.
|
||||||
|
|||||||
+1
-1
@@ -679,7 +679,7 @@ public class Presenter implements IPlugInPort {
|
|||||||
boolean isFirst = true;
|
boolean isFirst = true;
|
||||||
for (Map.Entry<IDIYComponent<?>, Set<Integer>> entry : controlPointMap.entrySet()) {
|
for (Map.Entry<IDIYComponent<?>, Set<Integer>> entry : controlPointMap.entrySet()) {
|
||||||
IDIYComponent<?> c = entry.getKey();
|
IDIYComponent<?> c = entry.getKey();
|
||||||
// drawingManager.invalidateComponent(c);
|
drawingManager.invalidateComponent(c);
|
||||||
for (Integer index : entry.getValue()) {
|
for (Integer index : entry.getValue()) {
|
||||||
Point p = new Point(c.getControlPoint(index));
|
Point p = new Point(c.getControlPoint(index));
|
||||||
// When the first point is moved, calculate how much it
|
// When the first point is moved, calculate how much it
|
||||||
|
|||||||
+1
-1
@@ -27,7 +27,7 @@ public class TraceMaskDrawingProvider implements IDrawingProvider {
|
|||||||
public TraceMaskDrawingProvider(IPlugInPort plugInPort) {
|
public TraceMaskDrawingProvider(IPlugInPort plugInPort) {
|
||||||
super();
|
super();
|
||||||
this.plugInPort = plugInPort;
|
this.plugInPort = plugInPort;
|
||||||
this.filter = new ComponentZOrderFiler(IDIYComponent.ABOVE_BOARD);
|
this.filter = new ComponentZOrderFiler(IDIYComponent.TRACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+3
-6
@@ -65,12 +65,9 @@ public class LayersMenuPlugin implements IPlugIn {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static enum Layer {
|
static enum Layer {
|
||||||
BELOW_CHASSIS("Below Chassis", IDIYComponent.BELOW_CHASSIS), CHASSIS("Chassis",
|
CHASSIS("Chassis", IDIYComponent.CHASSIS), BOARD("Board", IDIYComponent.BOARD), TRACE(
|
||||||
IDIYComponent.CHASSIS), ABOVE_CHASSIS("Above Chassis", IDIYComponent.ABOVE_CHASSIS), BELOW_BOARD(
|
"Trace", IDIYComponent.TRACE), COMPONENT("Component", IDIYComponent.COMPONENT), TEXT(
|
||||||
"Below Board", IDIYComponent.BELOW_BOARD), BOARD("Board", IDIYComponent.BOARD), ABOVE_BOARD(
|
"Text", IDIYComponent.TEXT);
|
||||||
"Above Board", IDIYComponent.ABOVE_BOARD), BELOW_COMPONENT("Below Component",
|
|
||||||
IDIYComponent.BELOW_COMPONENT), COMPONENT("Component", IDIYComponent.COMPONENT), ABOVE_COMPONENT(
|
|
||||||
"Above Component", IDIYComponent.ABOVE_COMPONENT);
|
|
||||||
|
|
||||||
String title;
|
String title;
|
||||||
int zOrder;
|
int zOrder;
|
||||||
|
|||||||
Binary file not shown.
+2
-2
@@ -14,7 +14,7 @@ import org.diylc.core.annotations.EditableProperty;
|
|||||||
import org.diylc.core.measures.Size;
|
import org.diylc.core.measures.Size;
|
||||||
import org.diylc.core.measures.SizeUnit;
|
import org.diylc.core.measures.SizeUnit;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Copper Trace", author = "Branislav Stojkovic", category = "Connectivity", creationMethod = CreationMethod.POINT_BY_POINT, instanceNamePrefix = "Trace", description = "", zOrder = IDIYComponent.ABOVE_BOARD)
|
@ComponentDescriptor(name = "Copper Trace", author = "Branislav Stojkovic", category = "Connectivity", creationMethod = CreationMethod.POINT_BY_POINT, instanceNamePrefix = "Trace", description = "", zOrder = IDIYComponent.TRACE)
|
||||||
public class CopperTrace extends AbstractLeadedComponent<Void> {
|
public class CopperTrace extends AbstractLeadedComponent<Void> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@@ -56,7 +56,7 @@ public class CopperTrace extends AbstractLeadedComponent<Void> {
|
|||||||
public void setLeadThickness(Size leadThickness) {
|
public void setLeadThickness(Size leadThickness) {
|
||||||
this.leadThickness = leadThickness;
|
this.leadThickness = leadThickness;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean shouldShadeLeads() {
|
protected boolean shouldShadeLeads() {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
+4
-4
@@ -13,7 +13,7 @@ import org.diylc.core.annotations.EditableProperty;
|
|||||||
import org.diylc.core.measures.Size;
|
import org.diylc.core.measures.Size;
|
||||||
import org.diylc.core.measures.SizeUnit;
|
import org.diylc.core.measures.SizeUnit;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Curved Trace", author = "Branislav Stojkovic", category = "Connectivity", instanceNamePrefix = "Trace", description = "Curved copper trace with two control points", zOrder = IDIYComponent.ABOVE_BOARD)
|
@ComponentDescriptor(name = "Curved Trace", author = "Branislav Stojkovic", category = "Connectivity", instanceNamePrefix = "Trace", description = "Curved copper trace with two control points", zOrder = IDIYComponent.TRACE)
|
||||||
public class CurvedTrace extends AbstractCurvedComponent<Void> {
|
public class CurvedTrace extends AbstractCurvedComponent<Void> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@@ -36,7 +36,7 @@ public class CurvedTrace extends AbstractCurvedComponent<Void> {
|
|||||||
|| componentState == ComponentState.DRAGGING ? SELECTION_COLOR : color);
|
|| componentState == ComponentState.DRAGGING ? SELECTION_COLOR : color);
|
||||||
g2d.draw(curve);
|
g2d.draw(curve);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EditableProperty(name = "Width")
|
@EditableProperty(name = "Width")
|
||||||
public Size getSize() {
|
public Size getSize() {
|
||||||
return size;
|
return size;
|
||||||
@@ -51,7 +51,7 @@ public class CurvedTrace extends AbstractCurvedComponent<Void> {
|
|||||||
public Void getValue() {
|
public Void getValue() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setValue(Void value) {
|
public void setValue(Void value) {
|
||||||
}
|
}
|
||||||
@@ -61,7 +61,7 @@ public class CurvedTrace extends AbstractCurvedComponent<Void> {
|
|||||||
public Byte getAlpha() {
|
public Byte getAlpha() {
|
||||||
return super.getAlpha();
|
return super.getAlpha();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setAlpha(Byte alpha) {
|
public void setAlpha(Byte alpha) {
|
||||||
super.setAlpha(alpha);
|
super.setAlpha(alpha);
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ import org.diylc.core.annotations.ComponentDescriptor;
|
|||||||
import org.diylc.core.annotations.EditableProperty;
|
import org.diylc.core.annotations.EditableProperty;
|
||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Hookup Wire", author = "Branislav Stojkovic", category = "Connectivity", instanceNamePrefix = "W", description = "Flexible wire with two control points", zOrder = IDIYComponent.ABOVE_COMPONENT)
|
@ComponentDescriptor(name = "Hookup Wire", author = "Branislav Stojkovic", category = "Connectivity", instanceNamePrefix = "W", description = "Flexible wire with two control points", zOrder = IDIYComponent.COMPONENT)
|
||||||
public class HookupWire extends AbstractCurvedComponent<Void> {
|
public class HookupWire extends AbstractCurvedComponent<Void> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@ import org.diylc.core.annotations.ComponentDescriptor;
|
|||||||
import org.diylc.core.annotations.EditableProperty;
|
import org.diylc.core.annotations.EditableProperty;
|
||||||
import org.diylc.core.measures.Size;
|
import org.diylc.core.measures.Size;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Jumper", author = "Branislav Stojkovic", category = "Connectivity", creationMethod = CreationMethod.POINT_BY_POINT, instanceNamePrefix = "J", description = "", zOrder = IDIYComponent.ABOVE_BOARD)
|
@ComponentDescriptor(name = "Jumper", author = "Branislav Stojkovic", category = "Connectivity", creationMethod = CreationMethod.POINT_BY_POINT, instanceNamePrefix = "J", description = "", zOrder = IDIYComponent.COMPONENT)
|
||||||
public class Jumper extends AbstractLeadedComponent<Void> {
|
public class Jumper extends AbstractLeadedComponent<Void> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ import org.diylc.core.measures.Size;
|
|||||||
import org.diylc.core.measures.SizeUnit;
|
import org.diylc.core.measures.SizeUnit;
|
||||||
import org.diylc.utils.Constants;
|
import org.diylc.utils.Constants;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Solder Pad", category = "Connectivity", author = "Branislav Stojkovic", description = "test", instanceNamePrefix = "Pad", stretchable = false, zOrder = IDIYComponent.ABOVE_BOARD + 0.1)
|
@ComponentDescriptor(name = "Solder Pad", category = "Connectivity", author = "Branislav Stojkovic", description = "test", instanceNamePrefix = "Pad", stretchable = false, zOrder = IDIYComponent.TRACE + 0.1)
|
||||||
public class SolderPad extends AbstractComponent<Void> {
|
public class SolderPad extends AbstractComponent<Void> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|||||||
+6
-7
@@ -16,7 +16,7 @@ import org.diylc.core.annotations.EditableProperty;
|
|||||||
import org.diylc.core.measures.Size;
|
import org.diylc.core.measures.Size;
|
||||||
import org.diylc.core.measures.SizeUnit;
|
import org.diylc.core.measures.SizeUnit;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Trace Cut", category = "Connectivity", author = "Branislav Stojkovic", description = "test", instanceNamePrefix = "Cut", stretchable = false, zOrder = IDIYComponent.ABOVE_BOARD)
|
@ComponentDescriptor(name = "Trace Cut", category = "Connectivity", author = "Branislav Stojkovic", description = "test", instanceNamePrefix = "Cut", stretchable = false, zOrder = IDIYComponent.BOARD + 1)
|
||||||
public class TraceCut extends AbstractComponent<Void> {
|
public class TraceCut extends AbstractComponent<Void> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@@ -29,7 +29,7 @@ public class TraceCut extends AbstractComponent<Void> {
|
|||||||
private Size size = SIZE;
|
private Size size = SIZE;
|
||||||
private Color fillColor = FILL_COLOR;
|
private Color fillColor = FILL_COLOR;
|
||||||
private Color borderColor = BORDER_COLOR;
|
private Color borderColor = BORDER_COLOR;
|
||||||
|
|
||||||
protected Point point = new Point(0, 0);
|
protected Point point = new Point(0, 0);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -70,7 +70,7 @@ public class TraceCut extends AbstractComponent<Void> {
|
|||||||
public Point getControlPoint(int index) {
|
public Point getControlPoint(int index) {
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isControlPointSticky(int index) {
|
public boolean isControlPointSticky(int index) {
|
||||||
return false;
|
return false;
|
||||||
@@ -81,23 +81,22 @@ public class TraceCut extends AbstractComponent<Void> {
|
|||||||
return VisibilityPolicy.NEVER;
|
return VisibilityPolicy.NEVER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setControlPoint(Point point, int index) {
|
public void setControlPoint(Point point, int index) {
|
||||||
this.point.setLocation(point);
|
this.point.setLocation(point);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@Override
|
@Override
|
||||||
public Void getValue() {
|
public Void getValue() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@Override
|
@Override
|
||||||
public void setValue(Void value) {
|
public void setValue(Void value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@EditableProperty
|
@EditableProperty
|
||||||
public Size getSize() {
|
public Size getSize() {
|
||||||
return size;
|
return size;
|
||||||
|
|||||||
+5
-5
@@ -19,10 +19,10 @@ import org.diylc.core.annotations.ComponentDescriptor;
|
|||||||
import org.diylc.core.annotations.EditableProperty;
|
import org.diylc.core.annotations.EditableProperty;
|
||||||
import org.diylc.core.measures.Size;
|
import org.diylc.core.measures.Size;
|
||||||
import org.diylc.core.measures.SizeUnit;
|
import org.diylc.core.measures.SizeUnit;
|
||||||
import org.diylc.plugins.file.BomEntry;
|
import org.diylc.swing.plugins.file.BomEntry;
|
||||||
import org.diylc.plugins.file.BomMaker;
|
import org.diylc.swing.plugins.file.BomMaker;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Bill of Materials", author = "Branislav Stojkovic", category = "Misc", description = "", instanceNamePrefix = "BOM", zOrder = IDIYComponent.ABOVE_COMPONENT, stretchable = false)
|
@ComponentDescriptor(name = "Bill of Materials", author = "Branislav Stojkovic", category = "Misc", description = "", instanceNamePrefix = "BOM", zOrder = IDIYComponent.TEXT, stretchable = false)
|
||||||
public class BOM extends AbstractComponent<Void> {
|
public class BOM extends AbstractComponent<Void> {
|
||||||
|
|
||||||
public static Size DEFAULT_SIZE = new Size(10d, SizeUnit.cm);
|
public static Size DEFAULT_SIZE = new Size(10d, SizeUnit.cm);
|
||||||
@@ -134,12 +134,12 @@ public class BOM extends AbstractComponent<Void> {
|
|||||||
public Point getControlPoint(int index) {
|
public Point getControlPoint(int index) {
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isControlPointSticky(int index) {
|
public boolean isControlPointSticky(int index) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VisibilityPolicy getControlPointVisibilityPolicy(int index) {
|
public VisibilityPolicy getControlPointVisibilityPolicy(int index) {
|
||||||
return VisibilityPolicy.NEVER;
|
return VisibilityPolicy.NEVER;
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ import org.diylc.core.VisibilityPolicy;
|
|||||||
import org.diylc.core.annotations.ComponentDescriptor;
|
import org.diylc.core.annotations.ComponentDescriptor;
|
||||||
import org.diylc.core.annotations.EditableProperty;
|
import org.diylc.core.annotations.EditableProperty;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Label", author = "Branislav Stojkovic", category = "Misc", description = "User defined label", instanceNamePrefix = "L", zOrder = IDIYComponent.ABOVE_COMPONENT, stretchable = false)
|
@ComponentDescriptor(name = "Label", author = "Branislav Stojkovic", category = "Misc", description = "User defined label", instanceNamePrefix = "L", zOrder = IDIYComponent.TEXT, stretchable = false)
|
||||||
public class Label extends AbstractComponent<Void> {
|
public class Label extends AbstractComponent<Void> {
|
||||||
|
|
||||||
public static String DEFAULT_TEXT = "Double click to edit text";
|
public static String DEFAULT_TEXT = "Double click to edit text";
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@ import org.diylc.core.annotations.ComponentDescriptor;
|
|||||||
import org.diylc.core.measures.Size;
|
import org.diylc.core.measures.Size;
|
||||||
import org.diylc.core.measures.SizeUnit;
|
import org.diylc.core.measures.SizeUnit;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Project Information", author = "Branislav Stojkovic", category = "Misc", description = "Draws a box with general project information", instanceNamePrefix = "BOM", zOrder = IDIYComponent.ABOVE_COMPONENT, stretchable = false)
|
@ComponentDescriptor(name = "Project Information", author = "Branislav Stojkovic", category = "Misc", description = "Draws a box with general project information", instanceNamePrefix = "BOM", zOrder = IDIYComponent.TEXT, stretchable = false)
|
||||||
public class ProjectInformation extends AbstractComponent<Void> {
|
public class ProjectInformation extends AbstractComponent<Void> {
|
||||||
|
|
||||||
public static Size DEFAULT_SIZE = new Size(10d, SizeUnit.cm);
|
public static Size DEFAULT_SIZE = new Size(10d, SizeUnit.cm);
|
||||||
|
|||||||
Reference in New Issue
Block a user