This commit is contained in:
Bane Stojkovic
2025-03-16 22:36:24 +01:00
parent 1c48d7c31f
commit 896a623c7c
4 changed files with 11 additions and 30 deletions
@@ -28,7 +28,7 @@ import java.awt.*;
*
* @author Branislav Stojkovic
*/
public interface ISwitch {
public interface ISwitch extends IContinuity {
Color[] POLE_COLORS = new Color[] {
Color.decode("#FFD1DC"), // Pastel Pink
@@ -74,4 +74,11 @@ public interface ISwitch {
default Boolean getHighlightConnectedTerminals() {
return false;
}
default boolean arePointsConnected(int index1, int index2) {
if (getSelectedPosition() == null) {
return false;
}
return arePointsConnected(index1, index2, getSelectedPosition());
}
}
@@ -66,8 +66,7 @@ import static org.diylc.utils.SwitchUtils.getConnectedTerminals;
zOrder = IDIYComponent.COMPONENT, instanceNamePrefix = "SW",
keywordPolicy = KeywordPolicy.SHOW_TAG, keywordTag = "Guitar Wiring Diagram",
transformer = Freeway3x3_03Transformer.class, enableCache = true)
public class Freeway3x3_03 extends AbstractTransparentComponent<Void> implements ISwitch,
IContinuity {
public class Freeway3x3_03 extends AbstractTransparentComponent<Void> implements ISwitch {
private static final Logger LOG = Logger.getLogger(Freeway3x3_03.class);
@@ -491,12 +490,4 @@ public class Freeway3x3_03 extends AbstractTransparentComponent<Void> implements
}
return false;
}
@Override
public boolean arePointsConnected(int index1, int index2) {
if (this.selectedPosition == null) {
return false;
}
return arePointsConnected(index1, index2, this.selectedPosition);
}
}
@@ -56,7 +56,7 @@ import static org.diylc.utils.SwitchUtils.getConnectedTerminals;
description = "Strat-style lever switch", zOrder = IDIYComponent.COMPONENT,
instanceNamePrefix = "SW", keywordPolicy = KeywordPolicy.SHOW_TAG,
keywordTag = "Guitar Wiring Diagram", transformer = AngledComponentTransformer.class)
public class LeverSwitch extends AbstractAngledComponent<LeverSwitch.LeverSwitchType> implements ISwitch, IContinuity {
public class LeverSwitch extends AbstractAngledComponent<LeverSwitch.LeverSwitchType> implements ISwitch {
private static final long serialVersionUID = 1L;
@@ -444,14 +444,6 @@ public class LeverSwitch extends AbstractAngledComponent<LeverSwitch.LeverSwitch
return false;
}
@Override
public boolean arePointsConnected(int index1, int index2) {
if (this.selectedPosition == null) {
return false;
}
return arePointsConnected(index1, index2, this.selectedPosition);
}
@Override
public boolean canPointMoveFreely(int pointIndex) {
return false;
@@ -60,8 +60,7 @@ import static org.diylc.utils.SwitchUtils.getConnectedTerminals;
author = "Branislav Stojkovic", description = "Several variations of Schaller Megaswitch",
zOrder = IDIYComponent.COMPONENT, instanceNamePrefix = "SW",
keywordPolicy = KeywordPolicy.SHOW_TAG, keywordTag = "Guitar Wiring Diagram", transformer = AngledComponentTransformer.class)
public class SchallerMegaSwitch extends AbstractAngledComponent<String> implements ISwitch,
IContinuity {
public class SchallerMegaSwitch extends AbstractAngledComponent<String> implements ISwitch {
private static final long serialVersionUID = 1L;
@@ -545,14 +544,6 @@ public class SchallerMegaSwitch extends AbstractAngledComponent<String> implemen
return false;
}
@Override
public boolean arePointsConnected(int index1, int index2) {
if (this.selectedPosition == null) {
return false;
}
return arePointsConnected(index1, index2, this.selectedPosition);
}
@Override
public String getControlPointNodeName(int index) {
if (type == MegaSwitchType.M) {