mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
added some icons
This commit is contained in:
Binary file not shown.
+5
-2
@@ -6,7 +6,7 @@ import java.awt.Graphics2D;
|
|||||||
import org.diylc.core.ComponentLayer;
|
import org.diylc.core.ComponentLayer;
|
||||||
import org.diylc.core.annotations.ComponentDescriptor;
|
import org.diylc.core.annotations.ComponentDescriptor;
|
||||||
|
|
||||||
@ComponentDescriptor(name = "Blank Board", category = "Boards", author = "Branislav Stojkovic", componentLayer = ComponentLayer.BOARD, instanceNamePrefix = "B", desciption = "Blank FR4 board")
|
@ComponentDescriptor(name = "Blank Board", category = "Boards", author = "Branislav Stojkovic", componentLayer = ComponentLayer.BOARD, instanceNamePrefix = "B", desciption = "Blank circuit board")
|
||||||
public class BlankBoard extends AbstractBoard {
|
public class BlankBoard extends AbstractBoard {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@@ -26,6 +26,9 @@ public class BlankBoard extends AbstractBoard {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawIcon(Graphics2D g2d, int width, int height) {
|
public void drawIcon(Graphics2D g2d, int width, int height) {
|
||||||
|
g2d.setColor(BOARD_COLOR);
|
||||||
|
g2d.fillRect(2, 2, width - 4, height - 4);
|
||||||
|
g2d.setColor(BORDER_COLOR);
|
||||||
|
g2d.drawRect(2, 2, width - 4, height - 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-1
@@ -136,6 +136,13 @@ public class PerfBoard extends AbstractBoard {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawIcon(Graphics2D g2d, int width, int height) {
|
public void drawIcon(Graphics2D g2d, int width, int height) {
|
||||||
|
g2d.setColor(BOARD_COLOR);
|
||||||
|
g2d.fillRect(2, 2, width - 4, height - 4);
|
||||||
|
g2d.setColor(BORDER_COLOR);
|
||||||
|
g2d.drawRect(2, 2, width - 4, height - 4);
|
||||||
|
g2d.setColor(COPPER_COLOR);
|
||||||
|
g2d.fillOval(width / 4, width / 4, width / 2, width / 2);
|
||||||
|
g2d.setColor(Constants.CANVAS_COLOR);
|
||||||
|
g2d.fillOval(width / 2 - 1, width / 2 - 1, 2, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-2
@@ -14,7 +14,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 = "Vero Board", category = "Boards", author = "Branislav Stojkovic", componentLayer = ComponentLayer.BOARD, instanceNamePrefix = "B", desciption = "Perforated FR4 board with solder pads spaced 0.1 inch apart")
|
@ComponentDescriptor(name = "Vero Board", category = "Boards", author = "Branislav Stojkovic", componentLayer = ComponentLayer.BOARD, instanceNamePrefix = "B", desciption = "Perforated FR4 board with copper strips connecting all holes in a row")
|
||||||
public class VeroBoard extends AbstractBoard {
|
public class VeroBoard extends AbstractBoard {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@@ -135,6 +135,14 @@ public class VeroBoard extends AbstractBoard {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawIcon(Graphics2D g2d, int width, int height) {
|
public void drawIcon(Graphics2D g2d, int width, int height) {
|
||||||
|
g2d.setColor(BOARD_COLOR);
|
||||||
|
g2d.fillRect(2, 2, width - 4, height - 4);
|
||||||
|
g2d.setColor(BORDER_COLOR);
|
||||||
|
g2d.drawRect(2, 2, width - 4, height - 4);
|
||||||
|
g2d.setColor(COPPER_COLOR);
|
||||||
|
g2d.fillRect(4, width / 4, width - 8, width / 2);
|
||||||
|
g2d.setColor(Constants.CANVAS_COLOR);
|
||||||
|
g2d.fillOval(width / 3 - 1, width / 2 - 1, 2, 2);
|
||||||
|
g2d.fillOval(2 * width / 3 - 1, width / 2 - 1, 2, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -39,7 +39,7 @@ public class HookupWire extends AbstractTransparentComponent<AWG> {
|
|||||||
public void draw(Graphics2D g2d, ComponentState componentState, Project project) {
|
public void draw(Graphics2D g2d, ComponentState componentState, Project project) {
|
||||||
if (componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING) {
|
if (componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING) {
|
||||||
g2d.setStroke(new BasicStroke(1, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER, 10f,
|
g2d.setStroke(new BasicStroke(1, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER, 10f,
|
||||||
new float[] {2f, 3f }, 5f));
|
new float[] { 2f, 3f }, 5f));
|
||||||
g2d.setColor(GUIDELINE_COLOR);
|
g2d.setColor(GUIDELINE_COLOR);
|
||||||
g2d.drawLine(controlPoints[0].x, controlPoints[0].y, controlPoints[1].x,
|
g2d.drawLine(controlPoints[0].x, controlPoints[0].y, controlPoints[1].x,
|
||||||
controlPoints[1].y);
|
controlPoints[1].y);
|
||||||
@@ -56,8 +56,8 @@ public class HookupWire extends AbstractTransparentComponent<AWG> {
|
|||||||
|
|
||||||
Composite oldComposite = g2d.getComposite();
|
Composite oldComposite = g2d.getComposite();
|
||||||
if (alpha < MAX_ALPHA) {
|
if (alpha < MAX_ALPHA) {
|
||||||
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,
|
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha
|
||||||
1f * alpha / MAX_ALPHA));
|
/ MAX_ALPHA));
|
||||||
}
|
}
|
||||||
g2d.setColor(color.darker());
|
g2d.setColor(color.darker());
|
||||||
g2d.setStroke(new BasicStroke(thickness));
|
g2d.setStroke(new BasicStroke(thickness));
|
||||||
@@ -83,7 +83,7 @@ public class HookupWire extends AbstractTransparentComponent<AWG> {
|
|||||||
controlPoints[index].setLocation(point);
|
controlPoints[index].setLocation(point);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EditableProperty
|
@EditableProperty(name = "AWG")
|
||||||
@Override
|
@Override
|
||||||
public AWG getValue() {
|
public AWG getValue() {
|
||||||
return value;
|
return value;
|
||||||
|
|||||||
+1
-1
@@ -58,7 +58,7 @@ public class Jumper extends AbstractLeadedDIYComponent<Void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Shape getComponentShape() {
|
protected Shape getBodyShape() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -86,7 +86,7 @@ public class Trace extends AbstractLeadedDIYComponent<Void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Shape getComponentShape() {
|
protected Shape getBodyShape() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+8
-2
@@ -39,7 +39,13 @@ public class AxialFilmCapacitor extends AbstractLeadedDIYComponent<Capacitance>
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void drawIcon(Graphics2D g2d, int width, int height) {
|
public void drawIcon(Graphics2D g2d, int width, int height) {
|
||||||
g2d.drawString("C", 10, 10);
|
g2d.rotate(-Math.PI / 4, width / 2, height / 2);
|
||||||
|
g2d.setColor(LEAD_COLOR);
|
||||||
|
g2d.drawLine(0, height / 2, width, height / 2);
|
||||||
|
g2d.setColor(BODY_COLOR);
|
||||||
|
g2d.fillRect(4, height / 2 - 3, width - 8, 6);
|
||||||
|
g2d.setColor(BORDER_COLOR);
|
||||||
|
g2d.drawRect(4, height / 2 - 3, width - 8, 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -63,7 +69,7 @@ public class AxialFilmCapacitor extends AbstractLeadedDIYComponent<Capacitance>
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Shape getComponentShape() {
|
protected Shape getBodyShape() {
|
||||||
return new Rectangle2D.Double(0f, 0f, getWidth().convertToPixels(), getHeight()
|
return new Rectangle2D.Double(0f, 0f, getWidth().convertToPixels(), getHeight()
|
||||||
.convertToPixels());
|
.convertToPixels());
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-2
@@ -39,7 +39,13 @@ public class RadialCeramicDiskCapacitor extends AbstractLeadedDIYComponent<Capac
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void drawIcon(Graphics2D g2d, int width, int height) {
|
public void drawIcon(Graphics2D g2d, int width, int height) {
|
||||||
g2d.drawString("C", 10, 10);
|
g2d.rotate(-Math.PI / 4, width / 2, height / 2);
|
||||||
|
g2d.setColor(LEAD_COLOR);
|
||||||
|
g2d.drawLine(0, height / 2, width, height / 2);
|
||||||
|
g2d.setColor(BODY_COLOR);
|
||||||
|
g2d.fillOval(4, height / 2 - 3, width - 8, 6);
|
||||||
|
g2d.setColor(BORDER_COLOR);
|
||||||
|
g2d.drawOval(4, height / 2 - 3, width - 8, 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -63,7 +69,7 @@ public class RadialCeramicDiskCapacitor extends AbstractLeadedDIYComponent<Capac
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Shape getComponentShape() {
|
protected Shape getBodyShape() {
|
||||||
return new Ellipse2D.Double(0f, 0f, getWidth().convertToPixels(), getHeight()
|
return new Ellipse2D.Double(0f, 0f, getWidth().convertToPixels(), getHeight()
|
||||||
.convertToPixels());
|
.convertToPixels());
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-2
@@ -39,7 +39,13 @@ public class RadialFilmCapacitor extends AbstractLeadedDIYComponent<Capacitance>
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void drawIcon(Graphics2D g2d, int width, int height) {
|
public void drawIcon(Graphics2D g2d, int width, int height) {
|
||||||
g2d.drawString("C", 10, 10);
|
g2d.rotate(-Math.PI / 4, width / 2, height / 2);
|
||||||
|
g2d.setColor(LEAD_COLOR);
|
||||||
|
g2d.drawLine(0, height / 2, width, height / 2);
|
||||||
|
g2d.setColor(BODY_COLOR);
|
||||||
|
g2d.fillRoundRect(4, height / 2 - 3, width - 8, 6, 2, 2);
|
||||||
|
g2d.setColor(BORDER_COLOR);
|
||||||
|
g2d.drawRoundRect(4, height / 2 - 3, width - 8, 6, 2, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -63,7 +69,7 @@ public class RadialFilmCapacitor extends AbstractLeadedDIYComponent<Capacitance>
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Shape getComponentShape() {
|
protected Shape getBodyShape() {
|
||||||
double radius = getHeight().convertToPixels() * 0.7;
|
double radius = getHeight().convertToPixels() * 0.7;
|
||||||
return new RoundRectangle2D.Double(0f, 0f, getWidth().convertToPixels(), getHeight()
|
return new RoundRectangle2D.Double(0f, 0f, getWidth().convertToPixels(), getHeight()
|
||||||
.convertToPixels(), radius, radius);
|
.convertToPixels(), radius, radius);
|
||||||
|
|||||||
+8
-2
@@ -39,7 +39,13 @@ public class Resistor extends AbstractLeadedDIYComponent<Resistance> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void drawIcon(Graphics2D g2d, int width, int height) {
|
public void drawIcon(Graphics2D g2d, int width, int height) {
|
||||||
g2d.drawString("R", 10, 10);
|
g2d.rotate(-Math.PI / 4, width / 2, height / 2);
|
||||||
|
g2d.setColor(LEAD_COLOR);
|
||||||
|
g2d.drawLine(0, height / 2, width, height / 2);
|
||||||
|
g2d.setColor(BODY_COLOR);
|
||||||
|
g2d.fillRect(4, height / 2 - 3, width - 8, 6);
|
||||||
|
g2d.setColor(BORDER_COLOR);
|
||||||
|
g2d.drawRect(4, height / 2 - 3, width - 8, 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -63,7 +69,7 @@ public class Resistor extends AbstractLeadedDIYComponent<Resistance> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Shape getComponentShape() {
|
protected Shape getBodyShape() {
|
||||||
return new Rectangle2D.Double(0f, 0f, getWidth().convertToPixels(), getHeight()
|
return new Rectangle2D.Double(0f, 0f, getWidth().convertToPixels(), getHeight()
|
||||||
.convertToPixels());
|
.convertToPixels());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user