diff --git a/ diy-layout-creator --username bancika@gmail.com/DIYLC/library/main.jar b/ diy-layout-creator --username bancika@gmail.com/DIYLC/library/main.jar index e01573d3..d886f9d3 100644 Binary files a/ diy-layout-creator --username bancika@gmail.com/DIYLC/library/main.jar and b/ diy-layout-creator --username bancika@gmail.com/DIYLC/library/main.jar differ diff --git a/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/components/AbstractLeadedComponent.java b/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/components/AbstractLeadedComponent.java index a53dc2f9..f4c0a480 100644 --- a/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/components/AbstractLeadedComponent.java +++ b/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/components/AbstractLeadedComponent.java @@ -32,7 +32,7 @@ public abstract class AbstractLeadedComponent extends AbstractTransparentComp private static final long serialVersionUID = 1L; - public static Color LEAD_COLOR = Color.decode("#65909A"); + public static Color LEAD_COLOR = Color.decode("#236B8E"); public static Color LABEL_COLOR = Color.black; public static Color LABEL_COLOR_SELECTED = Color.red; public static Size LEAD_THICKNESS = new Size(0.8d, SizeUnit.mm); @@ -94,13 +94,24 @@ public abstract class AbstractLeadedComponent extends AbstractTransparentComp // Draw leads. int leadThickness = getLeadThickness().convertToPixels(); g2d.setStroke(new BasicStroke(leadThickness)); - g2d.setColor(getLeadColor(componentState)); + g2d.setColor(shouldShadeLeads() ? getLeadColor(componentState).darker() + : getLeadColor(componentState)); g2d.drawLine((int) (shapeRect.width - distance) / 2, (int) shapeRect.height / 2, (int) ((shapeRect.width - distance) / 2 + leadLenght) - leadThickness / 2, (int) shapeRect.height / 2); g2d.drawLine((int) (shapeRect.width + distance) / 2, (int) shapeRect.height / 2, (int) ((shapeRect.width + distance) / 2 - leadLenght) + leadThickness / 2, (int) shapeRect.height / 2); + if (shouldShadeLeads()) { + g2d.setStroke(new BasicStroke(leadThickness - 2)); + g2d.setColor(getLeadColor(componentState)); + g2d.drawLine((int) (shapeRect.width - distance) / 2, (int) shapeRect.height / 2, + (int) ((shapeRect.width - distance) / 2 + leadLenght) - leadThickness / 2, + (int) shapeRect.height / 2); + g2d.drawLine((int) (shapeRect.width + distance) / 2, (int) shapeRect.height / 2, + (int) ((shapeRect.width + distance) / 2 - leadLenght) + leadThickness / 2, + (int) shapeRect.height / 2); + } // Do not track the label because that area was already covered. drawingObserver.stopTracking(); // Draw label. @@ -120,6 +131,10 @@ public abstract class AbstractLeadedComponent extends AbstractTransparentComp (int) (shapeRect.height - textRect.getHeight()) / 2 + fontMetrics.getAscent()); } + protected boolean shouldShadeLeads() { + return true; + } + /** * @return default component width. */ diff --git a/ diy-layout-creator --username bancika@gmail.com/Library/src/org/diylc/components/boards/PerfBoard.java b/ diy-layout-creator --username bancika@gmail.com/Library/src/org/diylc/components/boards/PerfBoard.java index 09a8efca..c019534b 100644 --- a/ diy-layout-creator --username bancika@gmail.com/Library/src/org/diylc/components/boards/PerfBoard.java +++ b/ diy-layout-creator --username bancika@gmail.com/Library/src/org/diylc/components/boards/PerfBoard.java @@ -20,7 +20,7 @@ public class PerfBoard extends AbstractBoard { private static final long serialVersionUID = 1L; - public static Color PAD_COLOR = Color.decode("#F3926C"); + public static Color COPPER_COLOR = Color.decode("#DA8A67"); public static Size SPACING = new Size(0.1d, SizeUnit.in); public static Size PAD_SIZE = new Size(0.08d, SizeUnit.in); @@ -28,7 +28,7 @@ public class PerfBoard extends AbstractBoard { // private Area copperArea; protected Size spacing = SPACING; - protected Color padColor = PAD_COLOR; + protected Color padColor = COPPER_COLOR; @Override public void draw(Graphics2D g2d, ComponentState componentState, Project project, @@ -88,13 +88,13 @@ public class PerfBoard extends AbstractBoard { g2d.fillRect(2, 2, width - 4, height - 4); g2d.setColor(BORDER_COLOR); g2d.drawRect(2, 2, width - 4, height - 4); - g2d.setColor(PAD_COLOR); + g2d.setColor(COPPER_COLOR); g2d.fillOval(width / 4, width / 4, width / 2, width / 2); - g2d.setColor(PAD_COLOR.darker()); + g2d.setColor(COPPER_COLOR.darker()); g2d.drawOval(width / 4, width / 4, width / 2, width / 2); g2d.setColor(Constants.CANVAS_COLOR); g2d.fillOval(width / 2 - 2, width / 2 - 2, 5, 5); - g2d.setColor(PAD_COLOR.darker()); + g2d.setColor(COPPER_COLOR.darker()); g2d.drawOval(width / 2 - 2, width / 2 - 2, 5, 5); } } diff --git a/ diy-layout-creator --username bancika@gmail.com/Library/src/org/diylc/components/boards/VeroBoard.java b/ diy-layout-creator --username bancika@gmail.com/Library/src/org/diylc/components/boards/VeroBoard.java index d9910044..b3ff1152 100644 --- a/ diy-layout-creator --username bancika@gmail.com/Library/src/org/diylc/components/boards/VeroBoard.java +++ b/ diy-layout-creator --username bancika@gmail.com/Library/src/org/diylc/components/boards/VeroBoard.java @@ -21,7 +21,7 @@ public class VeroBoard extends AbstractBoard { private static final long serialVersionUID = 1L; - public static Color PAD_COLOR = Color.decode("#F3926C"); + public static Color COPPER_COLOR = Color.decode("#DA8A67"); public static Color BORDER_COLOR = BOARD_COLOR.darker(); public static Size SPACING = new Size(0.1d, SizeUnit.in); @@ -29,7 +29,7 @@ public class VeroBoard extends AbstractBoard { public static Size HOLE_SIZE = new Size(0.7d, SizeUnit.mm); protected Size spacing = SPACING; - protected Color padColor = PAD_COLOR; + protected Color padColor = COPPER_COLOR; @Override public void draw(Graphics2D g2d, ComponentState componentState, Project project, @@ -92,14 +92,14 @@ public class VeroBoard extends AbstractBoard { g2d.fillRect(2, 2, width - 4, height - 4); g2d.setColor(BORDER_COLOR); g2d.drawRect(2, 2, width - 4, height - 4); - g2d.setColor(PAD_COLOR); + g2d.setColor(COPPER_COLOR); g2d.fillRect(4, width / 4, width - 8, width / 2); - g2d.setColor(PAD_COLOR.darker()); + g2d.setColor(COPPER_COLOR.darker()); g2d.drawRect(4, width / 4, width - 8, width / 2); g2d.setColor(Constants.CANVAS_COLOR); g2d.fillOval(width / 3 - 2, width / 2 - 2, 5, 5); g2d.fillOval(2 * width / 3 - 2, width / 2 - 2, 5, 5); - g2d.setColor(PAD_COLOR.darker()); + g2d.setColor(COPPER_COLOR.darker()); g2d.drawOval(width / 3 - 2, width / 2 - 2, 5, 5); g2d.drawOval(2 * width / 3 - 2, width / 2 - 2, 5, 5); } diff --git a/ diy-layout-creator --username bancika@gmail.com/Library/src/org/diylc/components/connectivity/CopperTrace.java b/ diy-layout-creator --username bancika@gmail.com/Library/src/org/diylc/components/connectivity/CopperTrace.java index 2d53b1b4..1103fa17 100644 --- a/ diy-layout-creator --username bancika@gmail.com/Library/src/org/diylc/components/connectivity/CopperTrace.java +++ b/ diy-layout-creator --username bancika@gmail.com/Library/src/org/diylc/components/connectivity/CopperTrace.java @@ -56,6 +56,11 @@ public class CopperTrace extends AbstractLeadedComponent { public void setLeadThickness(Size leadThickness) { this.leadThickness = leadThickness; } + + @Override + protected boolean shouldShadeLeads() { + return false; + } @Deprecated public Color getBodyColor() {