another trimmer type

This commit is contained in:
Branislav Stojkovic
2018-12-15 19:27:41 +01:00
parent 1b7f24bae4
commit ec7f195a2e
5 changed files with 38 additions and 7 deletions
Binary file not shown.
@@ -56,8 +56,9 @@ public class TrimmerPotentiometer extends AbstractPotentiometer {
private static final long serialVersionUID = 1L;
protected static Size FLAT_BODY_SIZE = new Size(9.5d, SizeUnit.mm);
protected static Size FLAT_LARGE_SIZE = new Size(13d, SizeUnit.mm);
protected static Size FLAT_LARGE_BODY_SIZE = new Size(13d, SizeUnit.mm);
protected static Size FLAT_SMALL_BODY_SIZE = new Size(5d, SizeUnit.mm);
protected static Size FLAT_SMALL2_BODY_SIZE = new Size(9.5d, SizeUnit.mm);
protected static Size FLAT_SHAFT_SIZE = new Size(4.5d, SizeUnit.mm);
protected static Size VERTICAL_BODY_LENGTH = new Size(9.5d, SizeUnit.mm);
protected static Size VERTICAL_BODY_WIDTH = new Size(4.5d, SizeUnit.mm);
@@ -101,6 +102,12 @@ public class TrimmerPotentiometer extends AbstractPotentiometer {
dx2 = 0;
dy2 = 2 * spacing;
break;
case FLAT_SMALL2:
dx1 = 4 * spacing;
dy1 = spacing;
dx2 = 0;
dy2 = 2 * spacing;
break;
case FLAT_LARGE:
dx1 = 4 * spacing;
dy1 = spacing;
@@ -142,6 +149,12 @@ public class TrimmerPotentiometer extends AbstractPotentiometer {
dx2 = -2 * spacing;
dy2 = 0;
break;
case FLAT_SMALL2:
dx1 = -spacing;
dy1 = 4 * spacing;
dx2 = -2 * spacing;
dy2 = 0;
break;
case FLAT_LARGE:
dx1 = -spacing;
dy1 = 4 * spacing;
@@ -183,6 +196,12 @@ public class TrimmerPotentiometer extends AbstractPotentiometer {
dx2 = 0;
dy2 = -2 * spacing;
break;
case FLAT_SMALL2:
dx1 = -4 * spacing;
dy1 = -spacing;
dx2 = 0;
dy2 = -2 * spacing;
break;
case FLAT_LARGE:
dx1 = -4 * spacing;
dy1 = -spacing;
@@ -224,6 +243,12 @@ public class TrimmerPotentiometer extends AbstractPotentiometer {
dx2 = 2 * spacing;
dy2 = 0;
break;
case FLAT_SMALL2:
dx1 = spacing;
dy1 = -4 * spacing;
dx2 = 2 * spacing;
dy2 = 0;
break;
case FLAT_LARGE:
dx1 = spacing;
dy1 = -4 * spacing;
@@ -284,10 +309,13 @@ public class TrimmerPotentiometer extends AbstractPotentiometer {
case FLAT_SMALL:
case FLAT_XSMALL:
case FLAT_XLARGE:
case FLAT_SMALL2:
if (getType() == TrimmerType.FLAT_XSMALL)
length = getClosestOdd(FLAT_SMALL_BODY_SIZE.convertToPixels());
else if (getType() == TrimmerType.FLAT_XLARGE)
length = getClosestOdd(FLAT_LARGE_SIZE.convertToPixels());
length = getClosestOdd(FLAT_LARGE_BODY_SIZE.convertToPixels());
else if (getType() == TrimmerType.FLAT_SMALL2)
length = getClosestOdd(FLAT_SMALL2_BODY_SIZE.convertToPixels());
else
length = getClosestOdd(FLAT_BODY_SIZE.convertToPixels());
width = length;
@@ -314,7 +342,10 @@ public class TrimmerPotentiometer extends AbstractPotentiometer {
width = p;
}
double edge = ROUNDED_EDGE.convertToPixels();
body[0] = new RoundRectangle2D.Double(centerX - length / 2, centerY - width / 2, length, width, edge, edge);
if (getType() == TrimmerType.FLAT_SMALL2)
body[0] = new Ellipse2D.Double(centerX - length / 2, centerY - width / 2, length, width);
else
body[0] = new RoundRectangle2D.Double(centerX - length / 2, centerY - width / 2, length, width, edge, edge);
}
return body;
}
@@ -500,9 +531,9 @@ public class TrimmerPotentiometer extends AbstractPotentiometer {
}
public static enum TrimmerType {
FLAT_SMALL("Horizontal Small 1"), FLAT_XSMALL("Horizontal Small 2"), FLAT_LARGE("Horizontal Medium"), FLAT_XLARGE(
"Horizontal Large"), VERTICAL_INLINE("Vertical Inline"), VERTICAL_OFFSET("Vertical Offset 1"), VERTICAL_OFFSET_BIG_GAP(
"Vertical Offset 2");
FLAT_SMALL("Horizontal Small 1"), FLAT_SMALL2("Horizontal Small 2"), FLAT_XSMALL("Horizontal Small 3"), FLAT_LARGE(
"Horizontal Medium"), FLAT_XLARGE("Horizontal Large"), VERTICAL_INLINE("Vertical Inline"), VERTICAL_OFFSET(
"Vertical Offset 1"), VERTICAL_OFFSET_BIG_GAP("Vertical Offset 2");
String label;
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1880,7 +1880,7 @@
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>NEW_FEATURE</changeType>
<description>Two new trimmer potentiometer types</description>
<description>Three new trimmer potentiometer types</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>IMPROVEMENT</changeType>