micro cleanup

This commit is contained in:
Bane Stojkovic
2026-09-11 11:28:18 +02:00
parent 27b53e60e3
commit b0f1a0bb2c
12 changed files with 67 additions and 116 deletions
@@ -58,6 +58,10 @@ public abstract class AbstractMakerBoard extends AbstractTransparentComponent<Vo
public static final Color ARDUINO_TEAL = Color.decode("#00878F");
public static final Color ARDUINO_BLUE = Color.decode("#015687");
public static final Color RPI_GREEN = Color.decode("#1B5E20");
public static final Color TEENSY_GREEN = Color.decode("#1B5E20");
public static final Color ESP_BLACK = Color.decode("#3E3E3E");
public static final Color WEMOS_BLUE = Color.decode("#006699");
public static Color PIN_COLOR = Color.decode("#00B2EE");
public static Color PIN_BORDER_COLOR = PIN_COLOR.darker();
@@ -78,17 +82,20 @@ public abstract class AbstractMakerBoard extends AbstractTransparentComponent<Vo
public static Color METAL_LABEL_COLOR = Color.decode("#555555");
public static Color ANTENNA_COLOR = Color.decode("#DAA520");
public static Color ANTENNA_BG_COLOR = Color.decode("#1E1E1E");
public static Color PAD_COLOR = Color.decode("#DAA520");
public static Color PAD_COLOR = GOLD_COLOR;
public static Color CONNECTOR_PLASTIC_COLOR = Color.decode("#F5F5DC");
public static Color CONNECTOR_PLASTIC_BORDER = Color.decode("#333333");
public static Color BUTTON_BODY_COLOR = Color.decode("#383838");
public static Color BUTTON_BORDER_COLOR = Color.decode("#666666");
public static Color BUTTON_ACTUATOR_COLOR = Color.decode("#A0A0A0");
public static Color DARK_PLASTIC_COLOR = Color.decode("#181818");
public static Color DARK_PLASTIC_BORDER = Color.decode("#333333");
public static Color SILK_COLOR = Color.WHITE;
public static Size PIN_SIZE = new Size(0.04d, SizeUnit.in);
public static Size PIN_SPACING = new Size(0.1d, SizeUnit.in);
public static Size PAD_SIZE = new Size(0.065d, SizeUnit.in);
public static Size HOLE_SIZE = new Size(0.035d, SizeUnit.in);
public static Size HOLE_SIZE = new Size(0.7d, SizeUnit.mm);
public static Size NOTCH_SIZE = new Size(0.9d, SizeUnit.mm);
public static Size ANTENNA_WIDTH = new Size(15.0d, SizeUnit.mm);
public static Size ANTENNA_LENGTH = new Size(7.0d, SizeUnit.mm);
@@ -124,18 +131,24 @@ public abstract class AbstractMakerBoard extends AbstractTransparentComponent<Vo
MINI
}
public static Font SILK_FONT_SMALL = new Font("SansSerif", Font.PLAIN, 10);
public static Font SILK_FONT = new Font("SansSerif", Font.BOLD, 11);
public static Font SILK_FONT_LARGE = new Font("SansSerif", Font.BOLD, 13);
public static String SILK_FONT_FAMILY = "SansSerif";
public static Font SILK_FONT_TINY = new Font(SILK_FONT_FAMILY, Font.BOLD, 9);
public static Font SILK_FONT_SMALL = new Font(SILK_FONT_FAMILY, Font.PLAIN, 10);
public static Font SILK_FONT = new Font(SILK_FONT_FAMILY, Font.BOLD, 11);
public static Font SILK_FONT_LARGE = new Font(SILK_FONT_FAMILY, Font.BOLD, 13);
public static Font SILK_FONT_TITLE = new Font(SILK_FONT_FAMILY, Font.BOLD, 20);
// the toolbox icon is a fixed 32x32 box, so its lettering does not scale with the board
public static Font ICON_FONT = new Font(SILK_FONT_FAMILY, Font.BOLD, 5);
public static Font ICON_FONT_LARGE = new Font(SILK_FONT_FAMILY, Font.BOLD, 6);
public static Size PIN_LABEL_OFFSET = new Size(1.6d, SizeUnit.mm);
// diagonal labels are anchored by both coordinates at once, so they sit closer to the pad than
// the straight ones without touching it
public static Size PIN_LABEL_CORNER_OFFSET = new Size(1.0d, SizeUnit.mm);
public static Size PIN_ROW_LABEL_OFFSET = new Size(2.0d, SizeUnit.mm);
public static Font PIN_FONT = new Font("SansSerif", Font.PLAIN, 8);
public static Font PIN_FONT = new Font(SILK_FONT_FAMILY, Font.PLAIN, 8);
// labels along a row run across the board rather than down a column of pins, so they can afford
// a size the tightly stacked column labels cannot
public static Font PIN_ROW_FONT = new Font("SansSerif", Font.PLAIN, 9);
public static Font PIN_ROW_FONT = new Font(SILK_FONT_FAMILY, Font.PLAIN, 9);
protected Orientation orientation = Orientation.DEFAULT;
protected Point2D[] controlPoints = new Point2D[] {new Point2D.Double(0, 0)};
@@ -103,7 +103,7 @@ public class MakerBoardPainter {
}
if (label != null && !label.isEmpty()) {
g2d.setColor(Color.WHITE);
g2d.setColor(AbstractMakerBoard.SILK_COLOR);
g2d.setFont(AbstractMakerBoard.SILK_FONT_SMALL);
if (w >= 20 && h >= 10) {
StringUtils.drawCenteredText(g2d, label, x + w / 2.0, y + h / 2.0, HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
@@ -23,7 +23,6 @@ package org.diylc.components.micro;
import java.awt.Color;
import java.awt.Composite;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
@@ -59,8 +58,6 @@ public class ArduinoMega extends AbstractMakerBoard {
private static final long serialVersionUID = 1L;
public static Color SILK_COLOR = Color.WHITE;
public static Size BOARD_WIDTH = new Size(101.6d, SizeUnit.mm);
public static Size BOARD_HEIGHT = new Size(53.4d, SizeUnit.mm);
@@ -461,7 +458,7 @@ public class ArduinoMega extends AbstractMakerBoard {
// MEGA text below logo
g2d.setColor(SILK_COLOR);
int fontSize = Math.max(6, (int) Math.round(boardH * 0.26));
g2d.setFont(new Font("SansSerif", Font.BOLD, fontSize));
g2d.setFont(ICON_FONT.deriveFont((float) fontSize));
double textY = logoY + logoH + (boardY + boardH - (logoY + logoH)) / 2.0;
double textX = boardX + (boardW / 2.0) + 0.5;
StringUtils.drawCenteredText(g2d, "MEGA", textX, textY, HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
@@ -21,7 +21,6 @@
*/
package org.diylc.components.micro;
import java.awt.Color;
import java.awt.Composite;
import java.awt.Graphics2D;
import java.awt.Shape;
@@ -62,8 +61,6 @@ public class ArduinoNano extends AbstractMakerBoard {
private static final long serialVersionUID = 1L;
public static Color SILK_COLOR = Color.WHITE;
public static Size BOARD_WIDTH = new Size(0.73d, SizeUnit.in);
public static Size BOARD_LENGTH = new Size(1.70d, SizeUnit.in);
@@ -23,7 +23,6 @@ package org.diylc.components.micro;
import java.awt.Color;
import java.awt.Composite;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
@@ -82,8 +81,6 @@ public class ArduinoUno extends AbstractMakerBoard {
private ArduinoUnoVersion version = ArduinoUnoVersion.REV3;
public static Color SILK_COLOR = Color.WHITE;
public static Size BOARD_WIDTH = new Size(68.6d, SizeUnit.mm);
public static Size BOARD_HEIGHT = new Size(53.4d, SizeUnit.mm);
@@ -520,13 +517,7 @@ public class ArduinoUno extends AbstractMakerBoard {
double raShiftY = minima ? new Size(4.5d, SizeUnit.mm).convertToPixels() : 0;
double raX = boardX + boardW - new Size(11.5d, SizeUnit.mm).convertToPixels() - raW - raShiftX;
double raY = boardY + new Size(12d, SizeUnit.mm).convertToPixels() + raShiftY;
g2d.setColor(Color.BLACK);
g2d.fill(new RoundRectangle2D.Double(raX, raY, raW, raH, 2, 2));
g2d.setColor(Color.DARK_GRAY);
g2d.draw(new RoundRectangle2D.Double(raX, raY, raW, raH, 2, 2));
g2d.setColor(Color.WHITE);
g2d.setFont(SILK_FONT_SMALL);
StringUtils.drawCenteredText(g2d, "RA4M1", raX + raW / 2.0, raY + raH / 2.0, HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
MakerBoardPainter.drawChip(g2d, raX, raY, raW, raH, "RA4M1");
if (getVersion() == ArduinoUnoVersion.R4_MINIMA) {
double swdW = SWD_WIDTH.convertToPixels();
@@ -578,7 +569,7 @@ public class ArduinoUno extends AbstractMakerBoard {
double arduinoX = boardX + new Size(1.5d, SizeUnit.in).convertToPixels() - new Size(3.0d, SizeUnit.mm).convertToPixels();
double arduinoY = boardY + new Size(0.775d, SizeUnit.in).convertToPixels() - new Size(4.0d, SizeUnit.mm).convertToPixels() + brandShiftY;
g2d.setFont(SILK_FONT_LARGE.deriveFont(SILK_FONT_LARGE.getSize2D() * 1.5f));
g2d.setFont(SILK_FONT_TITLE);
StringUtils.drawCenteredText(g2d, "ARDUINO", arduinoX, arduinoY, HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
String subText = getVersion().toString().toUpperCase(Locale.ROOT);
@@ -674,7 +665,7 @@ public class ArduinoUno extends AbstractMakerBoard {
g2d.setColor(SILK_COLOR);
String iconText = getVersion().toString().toUpperCase(Locale.ROOT).replace("UNO R4 ", "R4 ");
int fontSize = Math.max(5, (int) Math.round(boardH * 0.20));
g2d.setFont(new Font("SansSerif", Font.BOLD, fontSize));
g2d.setFont(ICON_FONT.deriveFont((float) fontSize));
double textY = logoY + logoH + (boardY + boardH - (logoY + logoH)) / 2.0;
double textX = boardX + (boardW / 2.0) + 0.5;
StringUtils.drawCenteredText(g2d, iconText, textX, textY, HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
@@ -23,7 +23,6 @@ package org.diylc.components.micro;
import java.awt.Color;
import java.awt.Composite;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
@@ -82,10 +81,6 @@ public class ESP32DevKit extends AbstractMakerBoard {
}
}
public static Color ESP_BLACK = Color.decode("#3E3E3E");
public static Color ANTENNA_BG_COLOR = Color.decode("#1E1E1E");
public static Color SILK_COLOR = Color.WHITE;
public static Size BOARD_WIDTH_30 = new Size(28.33d, SizeUnit.mm);
public static Size BOARD_LENGTH_30 = new Size(51.45d, SizeUnit.mm);
public static Size TOP_MARGIN_30 = new Size(6.7d, SizeUnit.mm);
@@ -856,7 +851,7 @@ public class ESP32DevKit extends AbstractMakerBoard {
g2d.fillRect(8, 6, width - 16, 12);
g2d.setColor(SILK_COLOR);
g2d.setFont(new Font("SansSerif", Font.BOLD, 5));
g2d.setFont(ICON_FONT);
StringUtils.drawCenteredText(g2d, "ESP32", width / 2, height / 2 + 8, HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
}
}
@@ -23,7 +23,6 @@ package org.diylc.components.micro;
import java.awt.Color;
import java.awt.Composite;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
@@ -60,8 +59,6 @@ public class ESP8266NodeMCU extends AbstractMakerBoard {
private static final long serialVersionUID = 1L;
public static Color NODEMCU_BLACK = Color.decode("#3E3E3E");
public static Color SILK_COLOR = Color.WHITE;
public static Size BOARD_WIDTH = new Size(25.7d, SizeUnit.mm);
public static Size BOARD_LENGTH = new Size(48.0d, SizeUnit.mm);
public static Size TOP_MARGIN = new Size(6.22d, SizeUnit.mm);
@@ -101,7 +98,7 @@ public class ESP8266NodeMCU extends AbstractMakerBoard {
public ESP8266NodeMCU() {
super();
this.bodyColor = NODEMCU_BLACK;
this.bodyColor = ESP_BLACK;
updateControlPoints();
}
@@ -280,7 +277,7 @@ public class ESP8266NodeMCU extends AbstractMakerBoard {
@Override
public void drawIcon(Graphics2D g2d, int width, int height) {
g2d.setColor(NODEMCU_BLACK);
g2d.setColor(ESP_BLACK);
g2d.fill(new RoundRectangle2D.Double(5, 2, width - 10, height - 4, 3, 3));
g2d.setColor(Color.GRAY);
g2d.draw(new RoundRectangle2D.Double(5, 2, width - 10, height - 4, 3, 3));
@@ -290,7 +287,7 @@ public class ESP8266NodeMCU extends AbstractMakerBoard {
g2d.fillRect(8, 6, width - 16, 12);
g2d.setColor(SILK_COLOR);
g2d.setFont(new Font("SansSerif", Font.BOLD, 5));
g2d.setFont(ICON_FONT);
StringUtils.drawCenteredText(g2d, "8266", width / 2, height / 2 + 8, HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
}
}
@@ -21,9 +21,7 @@
*/
package org.diylc.components.micro;
import java.awt.Color;
import java.awt.Composite;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.geom.*;
@@ -56,10 +54,8 @@ public class RaspberryPi extends AbstractMakerBoard {
private static final long serialVersionUID = 1L;
public static Color RPI_GREEN = Color.decode("#1B5E20");
public static Size BOARD_WIDTH = new Size(85.0d, SizeUnit.mm);
public static Size BOARD_HEIGHT = new Size(56.0d, SizeUnit.mm);
public static Font RPI_TITLE_FONT = new Font("SansSerif", Font.BOLD, 20);
public static final String[] PIN_NAMES = new String[] {
"3.3V (Pin 1)", "5V (Pin 2)",
@@ -372,7 +368,7 @@ public class RaspberryPi extends AbstractMakerBoard {
MakerBoardPainter.drawFpcConnector(g2d, mipi1X, mipiY, mipiW, mipiH, true, "");
MakerBoardPainter.drawFpcConnector(g2d, mipi0X, mipiY, mipiW, mipiH, true, "");
g2d.setColor(Color.WHITE);
g2d.setColor(SILK_COLOR);
g2d.setFont(SILK_FONT_SMALL);
StringUtils.drawCenteredText(g2d, "MIPI 1", boardX + new Size(48.5d, SizeUnit.mm).convertToPixels(),
mipiY - new Size(1.5d, SizeUnit.mm).convertToPixels(), HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
@@ -391,7 +387,7 @@ public class RaspberryPi extends AbstractMakerBoard {
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
g2d.draw(new Rectangle2D.Double(uartX, uartY, uartW, uartH));
g2d.setColor(Color.WHITE);
g2d.setColor(SILK_COLOR);
g2d.setFont(SILK_FONT_SMALL);
StringUtils.drawCenteredText(g2d, "UART", boardX + new Size(32.5d, SizeUnit.mm).convertToPixels(),
uartY - new Size(1.5d, SizeUnit.mm).convertToPixels(), HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
@@ -402,13 +398,13 @@ public class RaspberryPi extends AbstractMakerBoard {
double camX = boardX + new Size(camXOffsetDraw, SizeUnit.mm).convertToPixels() - camW / 2.0;
double camY = boardY + boardH - camH;
g2d.setColor(Color.decode("#181818"));
g2d.setColor(DARK_PLASTIC_COLOR);
g2d.fill(new Rectangle2D.Double(camX, camY, camW, camH));
g2d.setColor(Color.decode("#333333"));
g2d.setColor(DARK_PLASTIC_BORDER);
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
g2d.draw(new Rectangle2D.Double(camX, camY, camW, camH));
g2d.setColor(Color.WHITE);
g2d.setColor(SILK_COLOR);
g2d.setFont(SILK_FONT_SMALL);
StringUtils.drawCenteredText(g2d, "CAMERA", boardX + new Size(camXOffsetDraw, SizeUnit.mm).convertToPixels(),
camY - new Size(1.5d, SizeUnit.mm).convertToPixels(), HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
@@ -434,13 +430,13 @@ public class RaspberryPi extends AbstractMakerBoard {
avShape.lineTo(avCenterX - avBaseW / 2.0, avY + avBaseH);
avShape.closePath();
g2d.setColor(Color.decode("#181818"));
g2d.setColor(DARK_PLASTIC_COLOR);
g2d.fill(avShape);
g2d.setColor(Color.decode("#333333"));
g2d.setColor(DARK_PLASTIC_BORDER);
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
g2d.draw(avShape);
g2d.setColor(Color.WHITE);
g2d.setColor(SILK_COLOR);
g2d.setFont(SILK_FONT_SMALL);
StringUtils.drawCenteredText(g2d, "A/V", avCenterX,
avY - new Size(1.5d, SizeUnit.mm).convertToPixels(), HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
@@ -454,7 +450,7 @@ public class RaspberryPi extends AbstractMakerBoard {
double pcieY = boardY + new Size(1.0d, SizeUnit.in).convertToPixels() + new Size(0.75d, SizeUnit.mm).convertToPixels() - pcieH / 2.0;
MakerBoardPainter.drawFpcConnector(g2d, pcieX, pcieY, pcieW, pcieH, true, "");
g2d.setColor(Color.WHITE);
g2d.setColor(SILK_COLOR);
g2d.setFont(SILK_FONT_SMALL);
StringUtils.drawCenteredText(g2d, "PCIe", pcieX + pcieW / 2.0,
pcieY - new Size(1.5d, SizeUnit.mm).convertToPixels(), HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
@@ -464,13 +460,13 @@ public class RaspberryPi extends AbstractMakerBoard {
double dispX = boardX + new Size(4.0d, SizeUnit.mm).convertToPixels() - dispW / 2.0;
double dispY = boardY + boardH - new Size(28.0d, SizeUnit.mm).convertToPixels() - dispH / 2.0;
g2d.setColor(Color.decode("#181818"));
g2d.setColor(DARK_PLASTIC_COLOR);
g2d.fill(new Rectangle2D.Double(dispX, dispY, dispW, dispH));
g2d.setColor(Color.decode("#333333"));
g2d.setColor(DARK_PLASTIC_BORDER);
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
g2d.draw(new Rectangle2D.Double(dispX, dispY, dispW, dispH));
g2d.setColor(Color.WHITE);
g2d.setColor(SILK_COLOR);
g2d.setFont(SILK_FONT_SMALL);
StringUtils.drawCenteredText(g2d, "DISPLAY", dispX + dispW / 2.0,
dispY - new Size(1.5d, SizeUnit.mm).convertToPixels(), HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
@@ -481,7 +477,7 @@ public class RaspberryPi extends AbstractMakerBoard {
double poeLabelDir = (version == RaspberryPiVersion.PI_5) ? -6.0d : 6.0d;
double poeX = boardX + new Size(61.5d, SizeUnit.mm).convertToPixels();
double poeY = boardY + new Size(poeLabelHoleY + poeLabelDir, SizeUnit.mm).convertToPixels();
g2d.setColor(Color.WHITE);
g2d.setColor(SILK_COLOR);
g2d.setFont(SILK_FONT_SMALL);
double poeTextOffset = (version == RaspberryPiVersion.PI_5) ?
-(PIN_SPACING.convertToPixels() + new Size(1.5d, SizeUnit.mm).convertToPixels()) :
@@ -491,14 +487,14 @@ public class RaspberryPi extends AbstractMakerBoard {
// "GPIO" silkscreen below the 40-pin header, centered on the header span, which shares its
// center line with the board title
g2d.setColor(Color.WHITE);
g2d.setColor(SILK_COLOR);
g2d.setFont(SILK_FONT_SMALL);
StringUtils.drawCenteredText(g2d, "GPIO", boardX + new Size(32.5d, SizeUnit.mm).convertToPixels(),
boardY + new Size(7.5d, SizeUnit.mm).convertToPixels(), HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
// Raspberry Pi Silkscreen text below 40-pin header
g2d.setColor(Color.WHITE);
g2d.setFont(RPI_TITLE_FONT);
g2d.setColor(SILK_COLOR);
g2d.setFont(SILK_FONT_TITLE);
String versionLabel = version.toString();
if (versionLabel.contains("(")) {
versionLabel = versionLabel.substring(0, versionLabel.indexOf("(")).trim();
@@ -575,8 +571,8 @@ public class RaspberryPi extends AbstractMakerBoard {
g2d.fillRect(width - 11, 9, 2, 2);
}
g2d.setColor(Color.WHITE);
g2d.setFont(new Font("SansSerif", Font.BOLD, 6));
g2d.setColor(SILK_COLOR);
g2d.setFont(ICON_FONT_LARGE);
StringUtils.drawCenteredText(g2d, "RPi", 14, 25, HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
}
}
@@ -21,9 +21,7 @@
*/
package org.diylc.components.micro;
import java.awt.Color;
import java.awt.Composite;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
@@ -81,11 +79,9 @@ public class RaspberryPiPico extends AbstractMakerBoard {
}
}
public static Color RPI_GREEN = Color.decode("#1B5E20");
public static Size BOARD_WIDTH = new Size(21.0d, SizeUnit.mm);
public static Size BOARD_LENGTH = new Size(51.0d, SizeUnit.mm);
public static Color PAD_COLOR = GOLD_COLOR;
public static Size PAD_SIZE = new Size(1.7d, SizeUnit.mm);
public static Size HOLE_SIZE = new Size(0.8d, SizeUnit.mm);
public static Size NOTCH_SIZE = new Size(0.9d, SizeUnit.mm);
@@ -310,7 +306,7 @@ public class RaspberryPiPico extends AbstractMakerBoard {
// the label does not fit next to the button unless it is turned to read bottom to top,
// the way the real board prints it
g2d.setColor(Color.WHITE);
g2d.setColor(SILK_COLOR);
g2d.setFont(SILK_FONT_SMALL);
double labelX = btnX - BOOTSEL_LABEL_OFFSET.convertToPixels();
double labelY = btnY + btnH / 2.0;
@@ -329,7 +325,7 @@ public class RaspberryPiPico extends AbstractMakerBoard {
MakerBoardPainter.drawChip(g2d, chipX, chipY, chipSize, chipSize, isV2() ? "RP2350" : "RP2040");
// Model name, in the gap the board leaves between the BOOTSEL button and the chip
g2d.setColor(Color.WHITE);
g2d.setColor(SILK_COLOR);
g2d.setFont(SILK_FONT);
StringUtils.drawCenteredText(g2d, getVersion().toString(), boardX + boardW / 2.0,
chipY - MODEL_LABEL_OFFSET.convertToPixels(), HorizontalAlignment.CENTER,
@@ -341,7 +337,7 @@ public class RaspberryPiPico extends AbstractMakerBoard {
double midDebugY = boardY + boardH - DEBUG_PAD_OFFSET_Y.convertToPixels();
// DEBUG silkscreen text above SWD pins
g2d.setColor(Color.WHITE);
g2d.setColor(SILK_COLOR);
g2d.setFont(SILK_FONT_SMALL);
StringUtils.drawCenteredText(g2d, "DEBUG", midDebugX, midDebugY - new Size(2.2d, SizeUnit.mm).convertToPixels(),
HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
@@ -372,7 +368,7 @@ public class RaspberryPiPico extends AbstractMakerBoard {
MakerBoardLogos.drawRaspberryPiLogo(g2d, logoX, logoY, logoSize);
// DEBUG silkscreen text above SWD pins
g2d.setColor(Color.WHITE);
g2d.setColor(SILK_COLOR);
g2d.setFont(SILK_FONT_SMALL);
StringUtils.drawCenteredText(g2d, "DEBUG", boardX + boardW / 2.0, boardY + new Size(47.8d, SizeUnit.mm).convertToPixels(),
HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
@@ -409,11 +405,6 @@ public class RaspberryPiPico extends AbstractMakerBoard {
return NOTCH_SIZE;
}
@Override
protected Color getCastellatedPadColor() {
return PAD_COLOR;
}
/**
* Helper to draw Raspberry Pi Pico's castellated solder pads along the left and right edges
* and the SWD round pads.
@@ -509,8 +500,8 @@ public class RaspberryPiPico extends AbstractMakerBoard {
g2d.setColor(IC_BODY_COLOR);
g2d.fillRect(11, 12, 10, 10);
g2d.setColor(Color.WHITE);
g2d.setFont(new Font("SansSerif", Font.BOLD, 5));
g2d.setColor(SILK_COLOR);
g2d.setFont(ICON_FONT);
StringUtils.drawCenteredText(g2d, "PICO", width / 2, height / 2 + 10, HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
}
}
@@ -21,9 +21,7 @@
*/
package org.diylc.components.micro;
import java.awt.Color;
import java.awt.Composite;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
@@ -63,14 +61,8 @@ public class RaspberryPiZero extends AbstractMakerBoard {
private static final long serialVersionUID = 1L;
public static Color RPI_GREEN = Color.decode("#1B5E20");
public static Size BOARD_WIDTH = new Size(65.0d, SizeUnit.mm);
public static Size BOARD_HEIGHT = new Size(30.0d, SizeUnit.mm);
public static Font RPI_TITLE_FONT = new Font("SansSerif", Font.BOLD, 20);
public static Color PAD_COLOR = GOLD_COLOR;
public static Size PAD_SIZE = new Size(0.065d, SizeUnit.in);
public static Size HOLE_SIZE = new Size(0.7d, SizeUnit.mm);
public static final String[] PIN_NAMES;
static {
@@ -309,8 +301,8 @@ public class RaspberryPiZero extends AbstractMakerBoard {
double labelCenterX = boardX + new Size(46.15d, SizeUnit.mm).convertToPixels();
double labelMaxWidth =
2 * (boardX + boardW - new Size(1.5d, SizeUnit.mm).convertToPixels() - labelCenterX);
g2d.setColor(Color.WHITE);
g2d.setFont(RPI_TITLE_FONT);
g2d.setColor(SILK_COLOR);
g2d.setFont(SILK_FONT_TITLE);
if (g2d.getFontMetrics().stringWidth(versionLabel) > labelMaxWidth) {
g2d.setFont(SILK_FONT_LARGE);
}
@@ -318,7 +310,7 @@ public class RaspberryPiZero extends AbstractMakerBoard {
boardY + new Size(17.5d, SizeUnit.mm).convertToPixels(), HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
// White silkscreen outline around GPIO pads
g2d.setColor(Color.WHITE);
g2d.setColor(SILK_COLOR);
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
double hdrBoxX = boardX + new Size(7.0d, SizeUnit.mm).convertToPixels();
double hdrBoxY = boardY + new Size(0.9d, SizeUnit.mm).convertToPixels();
@@ -327,7 +319,7 @@ public class RaspberryPiZero extends AbstractMakerBoard {
g2d.draw(new Rectangle2D.Double(hdrBoxX, hdrBoxY, hdrBoxW, hdrBoxH));
// Silkscreen "GPIO" label next to the top pins
g2d.setColor(Color.WHITE);
g2d.setColor(SILK_COLOR);
g2d.setFont(SILK_FONT_SMALL);
StringUtils.drawCenteredText(g2d, "GPIO", boardX + new Size(42.5d, SizeUnit.mm).convertToPixels(),
y + PIN_SPACING.convertToPixels(), HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
@@ -398,8 +390,8 @@ public class RaspberryPiZero extends AbstractMakerBoard {
g2d.fillRect(18, height - 7, 3, 3);
g2d.fillRect(23, height - 7, 3, 3);
g2d.setColor(Color.WHITE);
g2d.setFont(new Font("SansSerif", Font.BOLD, 5));
g2d.setColor(SILK_COLOR);
g2d.setFont(ICON_FONT);
StringUtils.drawCenteredText(g2d, "ZERO", width / 2 + 4, 21, HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
}
}
@@ -21,9 +21,7 @@
*/
package org.diylc.components.micro;
import java.awt.Color;
import java.awt.Composite;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
@@ -77,13 +75,6 @@ public class Teensy extends AbstractMakerBoard {
}
}
// Board color matches standard green PCB (like Pi Zero)
public static Color TEENSY_GREEN = Color.decode("#1B5E20");
public static Color SILK_COLOR = Color.WHITE;
public static Color PAD_COLOR = GOLD_COLOR;
public static Size HOLE_SIZE = new Size(0.7d, SizeUnit.mm);
// gap between the Ethernet header pads and the silkscreen box printed around them
public static Size ETH_BOX_MARGIN = new Size(1.2d, SizeUnit.mm);
@@ -564,8 +555,8 @@ public class Teensy extends AbstractMakerBoard {
g2d.setColor(USB_METAL_COLOR);
g2d.fillRect(12, 2, 8, 3);
g2d.setColor(Color.WHITE);
g2d.setFont(new Font("SansSerif", Font.BOLD, 5));
g2d.setColor(SILK_COLOR);
g2d.setFont(ICON_FONT);
StringUtils.drawCenteredText(g2d, "TEENSY", width / 2, height / 2 + 8,
HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
}
@@ -23,7 +23,6 @@ package org.diylc.components.micro;
import java.awt.Color;
import java.awt.Composite;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
@@ -51,8 +50,8 @@ import org.diylc.core.measures.Size;
import org.diylc.core.measures.SizeUnit;
import org.diylc.utils.Constants;
@ComponentDescriptor(name = "Wemos D1 Mini", category = "Controllers",
author = "Branislav Stojkovic", description = "Wemos D1 Mini ESP8266 Wi-Fi Development Board",
@ComponentDescriptor(name = "WeMos D1 Mini", category = "Controllers",
author = "Branislav Stojkovic", description = "WeMos D1 Mini ESP8266 Wi-Fi Development Board",
instanceNamePrefix = "MCU", zOrder = IDIYComponent.COMPONENT,
bomPolicy = BomPolicy.SHOW_ONLY_TYPE_NAME, keywordPolicy = KeywordPolicy.SHOW_TYPE_NAME,
enableCache = true)
@@ -60,14 +59,6 @@ public class WemosD1Mini extends AbstractMakerBoard {
private static final long serialVersionUID = 1L;
public static Color WEMOS_BLUE = Color.decode("#006699");
public static Color ANTENNA_COLOR = Color.decode("#DAA520");
public static Color ANTENNA_BG_COLOR = Color.decode("#1E1E1E");
public static Color BUTTON_BODY_COLOR = Color.decode("#383838");
public static Color BUTTON_BORDER_COLOR = Color.decode("#666666");
public static Color BUTTON_ACTUATOR_COLOR = Color.decode("#A0A0A0");
public static Color SILK_COLOR = Color.WHITE;
public static Size BOARD_WIDTH = new Size(1.0d, SizeUnit.in);
public static Size BOARD_LENGTH = new Size(1.34d, SizeUnit.in);
public static Size ROW_SPACING = new Size(0.9d, SizeUnit.in);
@@ -285,7 +276,7 @@ public class WemosD1Mini extends AbstractMakerBoard {
// Reset button label on the board next to the button
g2d.setColor(SILK_COLOR);
g2d.setFont(new Font("SansSerif", Font.BOLD, 9));
g2d.setFont(SILK_FONT_TINY);
double rstLabelX = boardX + rstCutoutW + new Size(0.4d, SizeUnit.mm).convertToPixels();
StringUtils.drawCenteredText(g2d, "RST", rstLabelX, btnY + btnH / 2.0,
HorizontalAlignment.LEFT, VerticalAlignment.CENTER);
@@ -297,7 +288,7 @@ public class WemosD1Mini extends AbstractMakerBoard {
HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
// Silkscreen: Pin labels
g2d.setFont(new Font("SansSerif", Font.BOLD, 9));
g2d.setFont(SILK_FONT_TINY);
double spacing = PIN_SPACING.convertToPixels();
double labelOffset = new Size(1.4d, SizeUnit.mm).convertToPixels();
for (int i = 0; i < 8; i++) {
@@ -376,8 +367,8 @@ public class WemosD1Mini extends AbstractMakerBoard {
g2d.fill(new RoundRectangle2D.Double(width / 2.0 - 3, height - 8, 6, 4, 1, 1));
// Text
g2d.setColor(Color.WHITE);
g2d.setFont(new Font("SansSerif", Font.BOLD, 5));
g2d.setColor(SILK_COLOR);
g2d.setFont(ICON_FONT);
StringUtils.drawCenteredText(g2d, "D1", width / 2.0, height / 2.0 + 9, HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
}
}