mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-13 02:32:09 +10:00
Include 'Potentiometer (Miniature)' and 'Trimmer Potentiometer' in Guitar Wiring Analyzer
This commit is contained in:
+11
@@ -99,4 +99,15 @@ public abstract class AbstractPotentiometer extends AbstractLabeledComponent<Res
|
||||
public void setOrientation(Orientation orientation) {
|
||||
this.orientation = orientation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInternalLinkName(int index1, int index2) {
|
||||
if (index1 > index2)
|
||||
return getInternalLinkName(index2, index1);
|
||||
|
||||
if (index2 - index1 == 1)
|
||||
return getControlPointNodeName(index1) + "-" + getControlPointNodeName(index2);
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
+6
-1
@@ -78,7 +78,7 @@ public class MiniaturePotentiometer extends AbstractPotentiometer {
|
||||
}
|
||||
|
||||
protected void updateControlPoints() {
|
||||
int spacing = getClosestOdd(PIN_SPACING.convertToPixels());
|
||||
int spacing = (int) PIN_SPACING.convertToPixels();
|
||||
int dx1 = 0;
|
||||
int dy1 = 0;
|
||||
int dx2 = 0;
|
||||
@@ -530,6 +530,11 @@ public class MiniaturePotentiometer extends AbstractPotentiometer {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getControlPointNodeName(int index) {
|
||||
return Integer.toString(3 - index);
|
||||
}
|
||||
|
||||
public static enum MiniatureType {
|
||||
RIGHT_ANGLED("Right-Angled"), VERTICAL("Vertical");
|
||||
|
||||
|
||||
-11
@@ -771,17 +771,6 @@ public class PotentiometerPanel extends AbstractPotentiometer implements ILayere
|
||||
}
|
||||
return Integer.toString(3 - index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInternalLinkName(int index1, int index2) {
|
||||
if (index1 > index2)
|
||||
return getInternalLinkName(index2, index1);
|
||||
|
||||
if (index2 - index1 == 1)
|
||||
return getControlPointNodeName(index1) + "-" + getControlPointNodeName(index2);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Rectangle2D getCachingBounds() {
|
||||
|
||||
Reference in New Issue
Block a user