Standardize dark phenolic color

This commit is contained in:
Bane Stojkovic
2022-10-11 16:00:09 +02:00
parent 1ecafb7811
commit 770eb87a74
14 changed files with 27 additions and 27 deletions
@@ -49,7 +49,7 @@ public class MarshallPerfBoard extends AbstractBoard {
private static final long serialVersionUID = 1L;
public static Color BOARD_COLOR = Color.decode("#CD8500");
public static Color BOARD_COLOR = PHENOLIC_DARK_COLOR;
public static Color BORDER_COLOR = BOARD_COLOR.darker();
public static Size SPACING = new Size(3 / 8d, SizeUnit.in);
public static Size HOLE_SIZE = new Size(1 / 8d, SizeUnit.in);
@@ -57,7 +57,7 @@ public class TagStrip extends AbstractTransparentComponent<String> implements IC
private static final long serialVersionUID = 1L;
public static Color BOARD_COLOR = Color.decode("#CD8500");
public static Color BOARD_COLOR = PHENOLIC_DARK_COLOR;
public static Color TERMINAL_COLOR = Color.lightGray;
public static Color TERMINAL_BORDER_COLOR = TERMINAL_COLOR.darker();
public static int EDGE_RADIUS = 2;
@@ -57,7 +57,7 @@ public class TerminalStrip extends AbstractTransparentComponent<String> implemen
private static final long serialVersionUID = 1L;
public static Color BOARD_COLOR = Color.decode("#CD8500");
public static Color BOARD_COLOR = PHENOLIC_DARK_COLOR;
public static Color TERMINAL_COLOR = Color.lightGray;
public static Color TERMINAL_BORDER_COLOR = TERMINAL_COLOR.darker();
public static int EDGE_RADIUS = 2;
@@ -66,7 +66,7 @@ public class OpenJack1_4 extends AbstractMultiPartComponent<String> {
private static final long serialVersionUID = 1L;
private static Color BASE_COLOR = Color.lightGray;
private static Color WAFER_COLOR = Color.decode("#CD8500");
private static Color WAFER_COLOR = PHENOLIC_DARK_COLOR;
private static Size OUTER_DIAMETER = new Size(0.75d, SizeUnit.in);
private static Size INNER_DIAMETER = new Size(0.25d, SizeUnit.in);
@@ -66,7 +66,7 @@ public class OpenJack1_8 extends AbstractMultiPartComponent<String> {
private static final long serialVersionUID = 1L;
private static Color BASE_COLOR = Color.lightGray;
private static Color WAFER_COLOR = Color.decode("#CD8500");
private static Color WAFER_COLOR = PHENOLIC_DARK_COLOR;
private static Size OUTER_DIAMETER = new Size(0.375d, SizeUnit.in);
private static Size INNER_DIAMETER = new Size(0.125d, SizeUnit.in);
@@ -58,7 +58,7 @@ public class PilotLampHolder extends AbstractMultiPartComponent<String> {
private static final long serialVersionUID = 1L;
private static Color BASE_COLOR = Color.lightGray;
private static Color WAFER_COLOR = Color.decode("#CD8500");
private static Color WAFER_COLOR = PHENOLIC_DARK_COLOR;
private static final double SLEEVE_THETA = Math.PI * 0.29444444444;
@@ -61,7 +61,6 @@ public class PlasticDCJack extends AbstractMultiPartComponent<String> {
private static Size SPACING = new Size(0.1d, SizeUnit.in);
private static Size DIAMETER = new Size(0.5d, SizeUnit.in);
private static Color BODY_COLOR = Color.decode("#666666");
private static Color PHENOLIC_COLOR = Color.decode("#CD8500");
private static Color BORDER_COLOR = Color.black;
private static Color MARKING_COLOR = Color.lightGray;
@@ -142,7 +141,7 @@ public class PlasticDCJack extends AbstractMultiPartComponent<String> {
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : BODY_COLOR);
g2d.fill(body[0]);
if (!outlineMode) {
g2d.setColor(PHENOLIC_COLOR);
g2d.setColor(PHENOLIC_DARK_COLOR);
g2d.fill(body[1]);
}
g2d.setComposite(oldComposite);
@@ -163,7 +162,7 @@ public class PlasticDCJack extends AbstractMultiPartComponent<String> {
g2d.setColor(finalBorderColor);
g2d.draw(body[0]);
if (!outlineMode) {
g2d.setColor(PHENOLIC_COLOR.darker());
g2d.setColor(PHENOLIC_DARK_COLOR.darker());
g2d.draw(body[1]);
g2d.setColor(METAL_COLOR);
@@ -200,9 +199,9 @@ public class PlasticDCJack extends AbstractMultiPartComponent<String> {
g2d.setColor(BORDER_COLOR);
g2d.drawOval((width - diameter) / 2, (height - diameter) / 2, diameter, diameter);
int rectWidth = getClosestOdd(((width - 2 * margin) / Math.sqrt(2)) - margin / 2);
g2d.setColor(PHENOLIC_COLOR);
g2d.setColor(PHENOLIC_DARK_COLOR);
g2d.fillRect((width - rectWidth) / 2, (height - rectWidth) / 2, rectWidth, rectWidth);
g2d.setColor(PHENOLIC_COLOR.darker());
g2d.setColor(PHENOLIC_DARK_COLOR.darker());
g2d.drawRect((width - rectWidth) / 2, (height - rectWidth) / 2, rectWidth, rectWidth);
int lugWidth = 4 * 32 / width;
g2d.setColor(METAL_COLOR);
@@ -210,7 +209,7 @@ public class PlasticDCJack extends AbstractMultiPartComponent<String> {
g2d.drawLine(width * 2 / 3, (height - lugWidth) / 2, width * 2 / 3, (height + lugWidth) / 2);
g2d.fillOval((width - lugWidth) / 2, height * 2 / 3 - lugWidth / 2, lugWidth, lugWidth);
g2d.fillRect(width / 2 - lugWidth * 3 / 2, height * 2 / 3 - lugWidth / 2, lugWidth * 3 / 2, lugWidth);
g2d.setColor(PHENOLIC_COLOR);
g2d.setColor(PHENOLIC_DARK_COLOR);
g2d.fillOval((width - margin) / 2, height * 2 / 3 - margin / 2, margin, margin);
}
@@ -78,7 +78,7 @@ public class RotarySelectorSwitch extends AbstractMultiPartComponent<String> {
private Orientation orientation = Orientation.DEFAULT;
private boolean showLabels = true;
private RotaryPositionCount positionCount = RotaryPositionCount.THREE;
private SwitchTiming timing = SwitchTiming.SHORTING;
private SwitchTiming timing;
public RotarySelectorSwitch() {
super();
@@ -57,7 +57,7 @@ import org.diylc.utils.Constants;
instanceNamePrefix = "SW", description = "Sealed plastic rotary switch in several different switching configurations",
zOrder = IDIYComponent.COMPONENT, keywordPolicy = KeywordPolicy.SHOW_VALUE, enableCache = true,
transformer = AngledComponentTransformer.class)
public class RotarySwitchSealed extends AbstractAngledComponent<RotarySwitchType> implements ISwitch {
public class RotarySwitchSealed extends AbstractAngledComponent<RotarySwitchSealedType> implements ISwitch {
private static final int OUTER_ANGLE_OFFSET = 15;
private static final int INNER_ANGLE_OFFSET = 30;
@@ -76,10 +76,10 @@ public class RotarySwitchSealed extends AbstractAngledComponent<RotarySwitchType
private static Size PIN_WIDTH = new Size(0.08d, SizeUnit.in);
private static Size PIN_THICKNESS = new Size(0.02d, SizeUnit.in);
private RotarySwitchType configuration = RotarySwitchType._4P3T;
private RotarySwitchSealedType configuration = RotarySwitchSealedType._4P3T;
private Color color = BODY_COLOR;
private Mount mount = Mount.CHASSIS;
private SwitchTiming timing = SwitchTiming.NON_SHORTING;
private SwitchTiming timing;
private Color labelColor = LABEL_COLOR;
private Point2D[] controlPoints = new Point2D[] {new Point2D.Double(0, 0)};
@@ -91,11 +91,11 @@ public class RotarySwitchSealed extends AbstractAngledComponent<RotarySwitchType
}
@EditableProperty(name = "Type")
public RotarySwitchType getValue() {
public RotarySwitchSealedType getValue() {
return configuration;
}
public void setValue(RotarySwitchType configuration) {
public void setValue(RotarySwitchSealedType configuration) {
this.configuration = configuration;
updateControlPoints();
// Reset body shape
@@ -21,7 +21,7 @@
*/
package org.diylc.components.electromechanical;
public enum RotarySwitchType {
public enum RotarySwitchSealedType {
_1P12T("1P12T", 1, 12), _2P6T("2P6T", 2, 6), _3P4T("3P4T", 3, 4), _4P3T("4P3T", 4, 3);
private String name;
@@ -29,7 +29,7 @@ public enum RotarySwitchType {
private int poleCount;
private RotarySwitchType(String name, int poleCount, int positionCount) {
private RotarySwitchSealedType(String name, int poleCount, int positionCount) {
this.name = name;
this.poleCount = poleCount;
this.positionCount = positionCount;
@@ -64,7 +64,7 @@ public class SlideSwitch extends AbstractTransparentComponent<SlideSwitchType> i
private static Size LUG_THICKNESS = new Size(0.1d, SizeUnit.in);
private static Size HOLE_DIAMETER = new Size(3d, SizeUnit.mm);
private static Color BODY_COLOR = Color.decode("#CD8500");
private static Color BODY_COLOR = PHENOLIC_DARK_COLOR;
private static Color BORDER_COLOR = Color.gray;
public static Color TERMINAL_COLOR = METAL_COLOR;
public static Color LABEL_COLOR = Color.white;
@@ -57,7 +57,7 @@ public class LPSwitch extends AbstractTransparentComponent<String> implements IS
private static final long serialVersionUID = 1L;
private static Color BASE_COLOR = Color.lightGray;
private static Color WAFER_COLOR = Color.decode("#CD8500");
private static Color WAFER_COLOR = PHENOLIC_DARK_COLOR;
private static Size LENGTH = new Size(1.3d, SizeUnit.in);
private static Size BASE_LENGTH = new Size(18d, SizeUnit.mm);
@@ -1,7 +1,7 @@
package org.diylc.netlist;
import org.diylc.components.electromechanical.RotarySwitchSealed;
import org.diylc.components.electromechanical.RotarySwitchType;
import org.diylc.components.electromechanical.RotarySwitchSealedType;
import org.junit.Test;
public abstract class RotarySwitchTests extends AbstractSwitchTests {
@@ -13,7 +13,7 @@ public abstract class RotarySwitchTests extends AbstractSwitchTests {
String[] validCombinations = new String[] {"0,1,13", "1,2,13", "2,3,13", "3,4,13", "4,5,13", "5,6,13", "6,7,13", "7,8,13",
"8,9,13", "9,10,13", "10,11,13", "11,12,13"};
sw.setValue(RotarySwitchType._1P12T);
sw.setValue(RotarySwitchSealedType._1P12T);
testSwitch(sw, validCombinations);
}
@@ -25,7 +25,7 @@ public abstract class RotarySwitchTests extends AbstractSwitchTests {
"0,1,13", "1,2,13", "2,3,13", "3,4,13", "4,5,13", "5,6,13",
"0,7,14", "1,8,14", "2,9,14", "3,10,14", "4,11,14", "5,12,14"};
sw.setValue(RotarySwitchType.DP6T);
sw.setValue(RotarySwitchSealedType.DP6T);
testSwitch(sw, validCombinations);
}
@@ -38,7 +38,7 @@ public abstract class RotarySwitchTests extends AbstractSwitchTests {
"0,5,14", "1,6,14", "2,7,14", "3,8,14",
"0,9,15", "1,10,15", "2,11,15", "3,12,15"};
sw.setValue(RotarySwitchType._3P4T);
sw.setValue(RotarySwitchSealedType._3P4T);
testSwitch(sw, validCombinations);
}
@@ -52,7 +52,7 @@ public abstract class RotarySwitchTests extends AbstractSwitchTests {
"0,7,15", "1,8,15", "2,9,15",
"0,10,16", "1,11,16", "2,12,16",};
sw.setValue(RotarySwitchType._4P3T);
sw.setValue(RotarySwitchSealedType._4P3T);
testSwitch(sw, validCombinations);
}
}