mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-07 12:24:58 +10:00
Take phenolic color down to main component class
This commit is contained in:
@@ -46,8 +46,7 @@ public abstract class AbstractBoard extends AbstractTransparentComponent<String>
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static Color BOARD_COLOR = Color.decode("#F8EBB3");
|
||||
public static Color BORDER_COLOR = BOARD_COLOR.darker();
|
||||
public static Color BORDER_COLOR = PHENOLIC_COLOR.darker();
|
||||
public static Color COORDINATE_COLOR = Color.gray.brighter();
|
||||
public static float COORDINATE_FONT_SIZE = 9f;
|
||||
public static Size DEFAULT_WIDTH = new Size(1.5d, SizeUnit.in);
|
||||
@@ -61,7 +60,7 @@ public abstract class AbstractBoard extends AbstractTransparentComponent<String>
|
||||
protected Point2D.Double firstPoint = new Point2D.Double();
|
||||
protected Point2D.Double secondPoint = new Point2D.Double();
|
||||
|
||||
protected Color boardColor = BOARD_COLOR;
|
||||
protected Color boardColor = PHENOLIC_COLOR;
|
||||
protected Color borderColor = BORDER_COLOR;
|
||||
protected Color coordinateColor = COORDINATE_COLOR;
|
||||
protected Boolean drawCoordinates = null;
|
||||
|
||||
@@ -9,9 +9,7 @@ import org.diylc.core.measures.SizeUnit;
|
||||
|
||||
public abstract class AbstractVeroBoard extends AbstractBoard {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static Color BORDER_COLOR = BOARD_COLOR.darker();
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static Size SPACING = new Size(0.1d, SizeUnit.in);
|
||||
public static Size STRIP_SIZE = new Size(0.07d, SizeUnit.in);
|
||||
|
||||
@@ -49,7 +49,7 @@ public class BlankBoard extends AbstractBoard {
|
||||
@Override
|
||||
public void drawIcon(Graphics2D g2d, int width, int height) {
|
||||
int factor = 32 / width;
|
||||
g2d.setColor(BOARD_COLOR);
|
||||
g2d.setColor(PHENOLIC_COLOR);
|
||||
g2d.fillRect(2 / factor, 2 / factor, width - 4 / factor, height - 4 / factor);
|
||||
g2d.setColor(BORDER_COLOR);
|
||||
g2d.drawRect(2 / factor, 2 / factor, width - 4 / factor, height - 4 / factor);
|
||||
|
||||
@@ -124,7 +124,7 @@ public class PerfBoard extends AbstractBoard {
|
||||
@Override
|
||||
public void drawIcon(Graphics2D g2d, int width, int height) {
|
||||
int factor = 32 / width;
|
||||
g2d.setColor(BOARD_COLOR);
|
||||
g2d.setColor(PHENOLIC_COLOR);
|
||||
g2d.fillRect(2 / factor, 2 / factor, width - 4 / factor, height - 4 / factor);
|
||||
g2d.setColor(BORDER_COLOR);
|
||||
g2d.drawRect(2 / factor, 2 / factor, width - 4 / factor, height - 4 / factor);
|
||||
|
||||
@@ -153,7 +153,7 @@ public class TriPadBoard extends AbstractVeroBoard {
|
||||
|
||||
@Override
|
||||
public void drawIcon(Graphics2D g2d, int width, int height) {
|
||||
g2d.setColor(BOARD_COLOR);
|
||||
g2d.setColor(PHENOLIC_COLOR);
|
||||
g2d.fillRect(0, 0, width, height);
|
||||
|
||||
final int horizontalSpacing = width / 5;
|
||||
|
||||
@@ -120,7 +120,7 @@ public class VeroBoard extends AbstractVeroBoard {
|
||||
@Override
|
||||
public void drawIcon(Graphics2D g2d, int width, int height) {
|
||||
int factor = 32 / width;
|
||||
g2d.setColor(BOARD_COLOR);
|
||||
g2d.setColor(PHENOLIC_COLOR);
|
||||
g2d.fillRect(0, 2 / factor, width - 1, height - 4 / factor);
|
||||
g2d.setColor(BORDER_COLOR);
|
||||
g2d.drawRect(0, 2 / factor, width - 1, height - 4 / factor);
|
||||
|
||||
@@ -64,7 +64,7 @@ public class TraceCut extends AbstractComponent<Void> {
|
||||
private Color fillColor = FILL_COLOR;
|
||||
@Deprecated
|
||||
private Color borderColor = BORDER_COLOR;
|
||||
private Color boardColor = AbstractBoard.BOARD_COLOR;
|
||||
private Color boardColor = AbstractBoard.PHENOLIC_COLOR;
|
||||
private Boolean cutBetweenHoles = false;
|
||||
private OrientationHV orientation = OrientationHV.VERTICAL;
|
||||
private Size holeSpacing = VeroBoard.SPACING;
|
||||
@@ -108,7 +108,7 @@ public class TraceCut extends AbstractComponent<Void> {
|
||||
@Override
|
||||
public void drawIcon(Graphics2D g2d, int width, int height) {
|
||||
int factor = 32 / width;
|
||||
g2d.setColor(AbstractBoard.BOARD_COLOR);
|
||||
g2d.setColor(AbstractBoard.PHENOLIC_COLOR);
|
||||
g2d.fillRect(0, 2 / factor, width - 1, height - 4 / factor);
|
||||
g2d.setColor(AbstractBoard.BORDER_COLOR);
|
||||
g2d.drawRect(0, 2 / factor, width - 1, height - 4 / factor);
|
||||
@@ -117,7 +117,7 @@ public class TraceCut extends AbstractComponent<Void> {
|
||||
g2d.setColor(COPPER_COLOR.darker());
|
||||
g2d.drawRect(1 / factor, width / 3, width - 2 / factor, getClosestOdd(width / 3) + 1);
|
||||
|
||||
g2d.setColor(AbstractBoard.BOARD_COLOR);
|
||||
g2d.setColor(AbstractBoard.PHENOLIC_COLOR);
|
||||
g2d.fillRoundRect(width / 3, width / 3, getClosestOdd(width / 3) + 2, getClosestOdd(width / 3) + 2, width / 3,
|
||||
width / 3);
|
||||
|
||||
@@ -205,7 +205,7 @@ public class TraceCut extends AbstractComponent<Void> {
|
||||
@EditableProperty(name = "Board")
|
||||
public Color getBoardColor() {
|
||||
if (boardColor == null) {
|
||||
boardColor = AbstractBoard.BOARD_COLOR;
|
||||
boardColor = AbstractBoard.PHENOLIC_COLOR;
|
||||
}
|
||||
return boardColor;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class Loadline extends AbstractBoard {
|
||||
@Override
|
||||
public void drawIcon(Graphics2D g2d, int width, int height) {
|
||||
int factor = 32 / width;
|
||||
g2d.setColor(BOARD_COLOR);
|
||||
g2d.setColor(PHENOLIC_COLOR);
|
||||
g2d.fillRect(2 / factor, 2 / factor, width - 4 / factor, height - 4 / factor);
|
||||
g2d.setColor(BORDER_COLOR);
|
||||
g2d.drawRect(2 / factor, 2 / factor, width - 4 / factor, height - 4 / factor);
|
||||
|
||||
Reference in New Issue
Block a user