mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
Improve "Expand Selection" feature to use the same algorithm as netlists
for better precision<
This commit is contained in:
@@ -29,7 +29,7 @@ import java.awt.Rectangle;
|
||||
import java.awt.Shape;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
|
||||
|
||||
import org.diylc.appframework.miscutils.ConfigurationManager;
|
||||
import org.diylc.common.Display;
|
||||
import org.diylc.common.HorizontalAlignment;
|
||||
@@ -334,6 +334,13 @@ public abstract class Abstract3LegSymbol extends AbstractComponent<String> {
|
||||
body[i] = rotate.createTransformedShape(body[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getControlPointNodeName(int index) {
|
||||
if (index >= 3)
|
||||
return null;
|
||||
return Integer.toString(index + 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -623,7 +623,7 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
|
||||
|
||||
@Override
|
||||
public String getInternalLinkName(int index1, int index2) {
|
||||
if ((index1 == 0 && index2 == getControlPointCount() - 1) || (index2 == 0 && index1 == getControlPointCount() - 1))
|
||||
if ((index1 == 0 && index2 == 1) || (index2 == 0 && index1 == 1))
|
||||
return getName();
|
||||
return null;
|
||||
}
|
||||
@@ -650,6 +650,13 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
|
||||
public void setMoveLabel(boolean moveLabel) {
|
||||
this.moveLabel = moveLabel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getControlPointNodeName(int index) {
|
||||
if (index >= 2)
|
||||
return null;
|
||||
return Integer.toString(index + 1);
|
||||
}
|
||||
|
||||
public enum LabelOriantation {
|
||||
Directional, Horizontal
|
||||
|
||||
@@ -167,4 +167,9 @@ public class CopperTrace extends AbstractLeadedComponent<Void> {
|
||||
public String getControlPointNodeName(int index) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean getMoveLabel() {
|
||||
// override to disable edit
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,5 +162,10 @@ public class Jumper extends AbstractLeadedComponent<Void> implements IContinuity
|
||||
@Override
|
||||
public boolean arePointsConnected(int index1, int index2) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean getMoveLabel() {
|
||||
// override to disable edit
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
+7
@@ -201,4 +201,11 @@ public abstract class AbstractTransistorPackage extends AbstractTransparentCompo
|
||||
public boolean canPointMoveFreely(int pointIndex) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getControlPointNodeName(int index) {
|
||||
if (index >= 3)
|
||||
return null;
|
||||
return Integer.toString(index + 1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user