Revert "Rollback Include layer id in continuity areas"

This reverts commit 0f2e581a02.
This commit is contained in:
Bane Stojkovic
2022-11-22 18:15:53 +01:00
parent 0f2e581a02
commit ec5e1ae233
38 changed files with 73 additions and 109 deletions
@@ -27,9 +27,5 @@ public enum PCBLayer {
public String toString() {
return name().substring(1);
};
public int getId() {
return Integer.parseInt(toString());
}
};
}
@@ -42,10 +42,9 @@ public interface IDrawingObserver {
/**
* Notifies the observer that it should start tracking conductive continuity areas.
*
* @param layerId id of the layer
* @param positive designates if the area should be additive or subtractive
*/
void startTrackingContinuityArea(int layerId, boolean positive);
void startTrackingContinuityArea(boolean positive);
/**
* Notifies the observer that it should stop tracking conductive continuity areas.
@@ -32,17 +32,15 @@ public class ComponentArea implements Serializable {
private Area outlineArea;
private Collection<Area> continuityPositiveAreas;
private Collection<Area> continuityNegativeAreas;
private int layerId;
public ComponentArea() {
}
public ComponentArea(Area outlineArea, Collection<Area> continuityPositiveAreas, Collection<Area> continuityNegativeAreas, int layerId) {
public ComponentArea(Area outlineArea, Collection<Area> continuityPositiveAreas, Collection<Area> continuityNegativeAreas) {
super();
this.outlineArea = outlineArea;
this.continuityPositiveAreas = continuityPositiveAreas;
this.continuityNegativeAreas = continuityNegativeAreas;
this.layerId = layerId;
}
public Area getOutlineArea() {
@@ -56,8 +54,4 @@ public class ComponentArea implements Serializable {
public Collection<Area> getContinuityNegativeAreas() {
return continuityNegativeAreas;
}
public int getLayerId() {
return layerId;
}
}
@@ -134,7 +134,7 @@ public class DrawingCache {
stats.getSecond().add(componentEnd - componentStart);
// copy over tracking area from the cache, regardless if we rendered or not
g2d.merge(value.getCurrentArea(), value.getContinuityPositiveAreas(), value.getContinuityNegativeAreas(), value.getLayerId());
g2d.merge(value.getCurrentArea(), value.getContinuityPositiveAreas(), value.getContinuityNegativeAreas());
} else {
// no caching, just draw as usual
component.draw(g2d, componentState, outlineMode, project, g2d);
@@ -264,7 +264,7 @@ public class DrawingCache {
// add to the cache
value = new CacheValue(component, image, wrapper.getCurrentArea(), wrapper.getContinuityPositiveAreas(),
wrapper.getContinuityNegativeAreas(), wrapper.getLayerId(), componentState, outlineMode, zoom, dx, dy, rect);
wrapper.getContinuityNegativeAreas(), componentState, outlineMode, zoom, dx, dy, rect);
imageCache.put(component, new SoftReference<DrawingCache.CacheValue>(value));
}
@@ -283,13 +283,11 @@ public class DrawingCache {
int dx;
int dy;
Rectangle2D cacheBounds;
int layerId;
public CacheValue(IDIYComponent<?> component, BufferedImage image, Area currentArea,
Map<String, Area> continuityPositiveAreas, Map<String, Area> continuityNegativeAreas, int layerId,
Map<String, Area> continuityPositiveAreas, Map<String, Area> continuityNegativeAreas,
ComponentState state, boolean outlineMode, double zoom, int dx, int dy, Rectangle2D cacheBounds) {
super();
this.layerId = layerId;
this.cacheBounds = cacheBounds;
// take a copy of the component, so we can check if it changed in the meantime
try {
@@ -326,10 +324,6 @@ public class DrawingCache {
public Map<String, Area> getContinuityNegativeAreas() {
return continuityNegativeAreas;
}
public int getLayerId() {
return layerId;
}
public ComponentState getState() {
return state;
@@ -684,22 +684,23 @@ public class DrawingManager {
messageDispatcher.dispatchMessage(EventType.REPAINT);
}
public void findContinuityAreaAtPoint(Point2D p) {
public void findContinuityAreaAtPoint(Project project, Point2D p) {
if (continuityGraphCache == null)
continuityGraphCache = getContinuityGraph();
continuityGraphCache = getContinuityGraph(project);
currentContinuityAreas = continuityGraphCache.findAreasFor(p);
}
public List<Area> getContinuityAreas() {
public List<Area> getContinuityAreas(Project project) {
// Find all individual continuity areas for all components
List<Area> preliminaryAreas = new ArrayList<Area>();
List<Boolean> checkBreakout = new ArrayList<Boolean>();
for (ComponentArea a : this.componentAreaMap.values()) {
for (IDIYComponent<?> c : project.getComponents()) {
ComponentArea a = getComponentArea(c);
if (a == null || a.getOutlineArea() == null)
continue;
Collection<Area> positiveAreas = a.getContinuityPositiveAreas();
if (positiveAreas != null)
for (Area a1 : positiveAreas) {
@@ -732,9 +733,9 @@ public class DrawingManager {
return areas;
}
public ContinuityGraph getContinuityGraph() {
public ContinuityGraph getContinuityGraph(Project project) {
Set<Connection> connections = new HashSet<Connection>();
for (IDIYComponent<?> c : this.componentAreaMap.keySet()) {
for (IDIYComponent<?> c : project.getComponents()) {
if (c instanceof IContinuity) {
for (int i = 0; i < c.getControlPointCount() - 1; i++)
for (int j = i + 1; j < c.getControlPointCount(); j++)
@@ -743,13 +744,13 @@ public class DrawingManager {
}
}
List<Area> areas = getContinuityAreas();
List<Area> areas = getContinuityAreas(project);
return NetlistBuilder.buildContinuityGraph(areas, connections);
}
public List<Area> getContinuityAreaProximity(float threshold) {
List<Area> continuityAreas = getContinuityAreas();
public List<Area> getContinuityAreaProximity(Project project, float threshold) {
List<Area> continuityAreas = getContinuityAreas(project);
Stroke s = ObjectCache.getInstance().fetchBasicStroke(threshold - 1); // value eyeballed for
// approx good results
List<Area> expanded = continuityAreas.parallelStream()
@@ -82,7 +82,6 @@ class G2DWrapper extends Graphics2D implements IDrawingObserver {
private boolean drawingComponent = false;
private boolean trackingAllowed = true;
private int layerId;
private boolean trackingContinuityAllowed = false;
private boolean trackingContinuityPositive = true;
@@ -104,7 +103,7 @@ class G2DWrapper extends Graphics2D implements IDrawingObserver {
private String continuityMarker;
private Shape lastShape;
private double zoom;
private double zoom;
/**
* Creates a wrapper around specified {@link Graphics2D} object.
@@ -134,7 +133,6 @@ class G2DWrapper extends Graphics2D implements IDrawingObserver {
currentArea = new Area();
continuityPositiveAreas = new HashMap<String, Area>();
continuityNegativeAreas = new HashMap<String, Area>();
layerId = 0;
// trackingStacks.clear();
continuityMarker = null;
originalStroke = canvasGraphics.getStroke();
@@ -161,8 +159,7 @@ class G2DWrapper extends Graphics2D implements IDrawingObserver {
canvasGraphics.setComposite(originalComposite);
canvasGraphics.setFont(originalFont);
// Map<String, Integer> sorted = sortByComparator(trackingStacks, false);
return new ComponentArea(currentArea, new ArrayList<Area>(continuityPositiveAreas.values()),
new ArrayList<Area>(continuityNegativeAreas.values()), layerId);
return new ComponentArea(currentArea, new ArrayList<Area>(continuityPositiveAreas.values()), new ArrayList<Area>(continuityNegativeAreas.values()));
}
// start - used for caching
@@ -179,18 +176,12 @@ class G2DWrapper extends Graphics2D implements IDrawingObserver {
return continuityNegativeAreas;
}
public int getLayerId() {
return layerId;
}
// end - used for caching
public void merge(Area currentArea, Map<String, Area> continuityPositiveAreas,
Map<String, Area> continuityNegativeAreas, int layerId) {
public void merge(Area currentArea, Map<String, Area> continuityPositiveAreas, Map<String, Area> continuityNegativeAreas) {
this.currentArea = currentArea;
this.continuityPositiveAreas = continuityPositiveAreas;
this.continuityNegativeAreas = continuityNegativeAreas;
this.layerId = layerId;
}
@Override
@@ -204,8 +195,7 @@ class G2DWrapper extends Graphics2D implements IDrawingObserver {
}
@Override
public void startTrackingContinuityArea(int layerId, boolean positive) {
this.layerId = layerId;
public void startTrackingContinuityArea(boolean positive) {
this.trackingContinuityAllowed = true;
this.trackingContinuityPositive = positive;
}
@@ -680,7 +680,7 @@ public class Presenter implements IPlugInPort {
projectFileManager.notifyFileChange();
}
} else if (configManager.readBoolean(HIGHLIGHT_CONTINUITY_AREA, false) || altDown) {
drawingManager.findContinuityAreaAtPoint(scaledPoint);
drawingManager.findContinuityAreaAtPoint(currentProject, scaledPoint);
messageDispatcher.dispatchMessage(EventType.REPAINT);
} else {
List<IDIYComponent<?>> newSelection = new ArrayList<IDIYComponent<?>>(selectedComponents);
@@ -2809,7 +2809,7 @@ public class Presenter implements IPlugInPort {
@Override
public List<Netlist> extractNetlists(boolean includeSwitches) throws NetlistException {
List<Area> continuityAreas = drawingManager.getContinuityAreas();
List<Area> continuityAreas = drawingManager.getContinuityAreas(currentProject);
return NetlistBuilder.extractNetlists(includeSwitches, currentProject, continuityAreas);
}
@@ -2874,12 +2874,11 @@ public class Presenter implements IPlugInPort {
ComponentArea componentArea = drawingManager.getComponentArea(c);
areas.put(c, componentArea);
}
return new Snapshot(currentProject.clone(), new HashSet<IDIYComponent<?>>(selectedComponents), areas,
new HashSet<Area>(drawingManager.getContinuityAreas()));
return new Snapshot(currentProject.clone(), new HashSet<IDIYComponent<?>>(selectedComponents), areas, new HashSet<Area>(drawingManager.getContinuityAreas(currentProject)));
}
@Override
public List<Area> checkContinuityAreaProximity(Size threshold) {
return drawingManager.getContinuityAreaProximity((float)threshold.convertToPixels());
return drawingManager.getContinuityAreaProximity(this.currentProject, (float)threshold.convertToPixels());
}
}
Binary file not shown.
@@ -110,14 +110,10 @@ public abstract class AbstractLeadedComponent<T> extends AbstractLabeledComponen
points[1] = new Point2D.Double(targetSize / 2, 0);
}
protected boolean isCopperArea() {
protected boolean IsCopperArea() {
return false;
}
protected int getLayerId() {
return 0;
}
protected Point2D[] getPoints() {
// convert old points to new
if (points.length == 2) {
@@ -153,7 +149,7 @@ public abstract class AbstractLeadedComponent<T> extends AbstractLabeledComponen
Shape shape = getBodyShape();
// If there's no body, just draw the line connecting the ending points.
if (shape == null) {
drawLead(g2d, componentState, drawingObserver, isCopperArea());
drawLead(g2d, componentState, drawingObserver, IsCopperArea());
return;
}
@@ -419,7 +415,7 @@ public abstract class AbstractLeadedComponent<T> extends AbstractLabeledComponen
private void drawLead(Graphics2D g2d, ComponentState componentState, IDrawingObserver observer, boolean isCopperArea) {
if (isCopperArea)
observer.startTrackingContinuityArea(getLayerId(), true);
observer.startTrackingContinuityArea(true);
float thickness = getLeadThickness();
@@ -195,7 +195,7 @@ public class Breadboard extends AbstractProtoBoard {
}
// draw transparent connections just to designate connections
drawingObserver.startTrackingContinuityArea(1, true);
drawingObserver.startTrackingContinuityArea(true);
Composite oldComposite = g2d.getComposite();
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.0f));
@@ -380,7 +380,7 @@ public class EurorackStripboard extends AbstractProtoBoard {
int padX = (int) (x0 + (segment.x + i) * spacing);
int padY = (int) (y0 + (segment.y + j) * spacing);
drawingObserver.startTrackingContinuityArea(1, true);
drawingObserver.startTrackingContinuityArea(true);
drawingObserver.setContinuityMarker(segment.label);
g2d.setColor(padColor);
@@ -432,7 +432,7 @@ public class EurorackStripboard extends AbstractProtoBoard {
int padX = (int) (x0 + potPad.x * spacing);
int padY = (int) (y0 + (potPad.y + 8 * i) * spacing);
drawingObserver.startTrackingContinuityArea(1, true);
drawingObserver.startTrackingContinuityArea(true);
drawingObserver.setContinuityMarker(potPad.label + i);
g2d.setColor(padColor);
@@ -483,7 +483,7 @@ public class EurorackStripboard extends AbstractProtoBoard {
int padX = (int) (x0 + potPad.x * spacing);
int padY = (int) (y0 + potPad.y * spacing);
drawingObserver.startTrackingContinuityArea(1, true);
drawingObserver.startTrackingContinuityArea(true);
drawingObserver.setContinuityMarker(potPad.label);
g2d.setColor(padColor);
@@ -513,7 +513,7 @@ public class EurorackStripboard extends AbstractProtoBoard {
int padX = (int) (x0 + (6.5 + i) * spacing);
int padY = (int) (y0 + (36 + j) * spacing);
drawingObserver.startTrackingContinuityArea(1, true);
drawingObserver.startTrackingContinuityArea(true);
drawingObserver.setContinuityMarker(connectorLabels[i]);
g2d.setColor(padColor);
@@ -543,7 +543,7 @@ public class EurorackStripboard extends AbstractProtoBoard {
int padX = (int) (x0 + (17) * spacing);
int padY = (int) (y0 + 35.5 * spacing);
drawingObserver.startTrackingContinuityArea(1, true);
drawingObserver.startTrackingContinuityArea(true);
drawingObserver.setContinuityMarker("GND");
g2d.setColor(padColor);
@@ -140,7 +140,7 @@ public class ProtoBoard extends AbstractProtoBoard {
g2d.setColor(traceColor);
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(padSize / 4));
drawingObserver.startTrackingContinuityArea(1, true);
drawingObserver.startTrackingContinuityArea(true);
// draw segment connectors
for (int y = 0; y < ROW_COUNT; y++) {
@@ -223,7 +223,7 @@ public class ProtoBoard extends AbstractProtoBoard {
// draw top mini pad traces
g2d.setColor(traceColor);
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(padSize / 4));
drawingObserver.startTrackingContinuityArea(1, true);
drawingObserver.startTrackingContinuityArea(true);
g2d.drawLine((int) (point.getX() + (1 + SEGMENTS_SUM[3] + 0.5) * spacing), (int) (point.getY() + 1 * spacing),
(int) (point.getX() + (1 + SEGMENTS_SUM[3] + 0.5) * spacing), (int) (point.getY() + 3.5 * spacing));
g2d.drawLine((int) (point.getX() + (1 + SEGMENTS_SUM[3] + 1.5) * spacing + miniPadSize / 2), (int) (point.getY() + 1 * spacing),
@@ -255,7 +255,7 @@ public class ProtoBoard extends AbstractProtoBoard {
int padX = (int) (point.getX() + (xOffset + x) * spacing);
int padY = (int) (point.getY() + (yOffset + y) * spacing);
drawingObserver.startTrackingContinuityArea(1, true);
drawingObserver.startTrackingContinuityArea(true);
drawingObserver.setContinuityMarker("SEGMENT=" + segment + ";ROW=" + y);
g2d.setColor(padColor);
@@ -295,7 +295,7 @@ public class ProtoBoard extends AbstractProtoBoard {
g2d.drawRect((int) (point.getX() + (1 + SEGMENTS_SUM[3]) * spacing), (int) (point.getY() + (yOffset - 2 + y * (ROW_COUNT + 2)) * spacing),
(int)(3 * spacing), (int)spacing);
drawingObserver.startTrackingContinuityArea(1, true);
drawingObserver.startTrackingContinuityArea(true);
for (int x = 0; x < 3; x++) {
int padX = (int) (point.getX() + (1 + SEGMENTS_SUM[3] + 0.5 + x) * spacing);
@@ -344,7 +344,7 @@ public class ProtoBoard extends AbstractProtoBoard {
g2d.setColor(traceColor);
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(padSize / 4));
drawingObserver.startTrackingContinuityArea(1, true);
drawingObserver.startTrackingContinuityArea(true);
// Draw two horizontal traces in the top-right section
g2d.drawLine((int) (point.getX() + width - 4 * spacing), (int) (point.getY() + 0.5 * spacing), (int) (point.getX() + width - (2) * spacing), (int) (point.getY() + 0.5 * spacing));
@@ -403,7 +403,7 @@ public class ProtoBoard extends AbstractProtoBoard {
for (int i = 0; i < padXs.length; i++) {
int padX = padXs[i];
drawingObserver.startTrackingContinuityArea(1, true);
drawingObserver.startTrackingContinuityArea(true);
if (i == 0 || i == 2 || i == 5) {
switch (y) {
@@ -473,7 +473,7 @@ public class ProtoBoard extends AbstractProtoBoard {
for (int y = 0; y < ROW_COUNT; y++) {
g2d.setColor(padColor);
drawingObserver.startTrackingContinuityArea(1, true);
drawingObserver.startTrackingContinuityArea(true);
// top row
g2d.fillRect((int) (point.getX() + (1 + SEGMENTS_SUM[3] + 0.5) * spacing) + 1, (int) (point.getY() + (yOffset + y - 0.5d) * spacing + 2), miniPadSize, miniPadSize);
@@ -492,7 +492,7 @@ public class ProtoBoard extends AbstractProtoBoard {
g2d.setColor(undersidePadColor);
drawingObserver.startTrackingContinuityArea(1, true);
drawingObserver.startTrackingContinuityArea(true);
// bottom row
@@ -302,7 +302,7 @@ public class TagStrip extends AbstractTransparentComponent<String> implements IC
g2d.draw(mainArea);
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : TERMINAL_COLOR);
drawingObserver.startTrackingContinuityArea(1, true);
drawingObserver.startTrackingContinuityArea(true);
for (int i = 1; i < body.length; i++)
g2d.fill(body[i]);
drawingObserver.stopTrackingContinuityArea();
@@ -379,7 +379,7 @@ public class TerminalStrip extends AbstractTransparentComponent<String> implemen
g2d.draw(mainArea);
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : TERMINAL_COLOR);
drawingObserver.startTrackingContinuityArea(1, true);
drawingObserver.startTrackingContinuityArea(true);
for (int i = 1; i < body.length; i++)
g2d.fill(body[i]);
drawingObserver.stopTrackingContinuityArea();
@@ -84,7 +84,7 @@ public class TriPadBoard extends AbstractVeroBoard {
}
g2d.setColor(stripColor);
drawingObserver.startTrackingContinuityArea(1, true);
drawingObserver.startTrackingContinuityArea(true);
g2d.fillRect((int)(x + spacing - stripSize / 2), (int)(y - stripSize / 2), (int)(spacing * (spacesToDraw - 1) + stripSize),
stripSize);
drawingObserver.stopTrackingContinuityArea();
@@ -122,7 +122,7 @@ public class TriPadBoard extends AbstractVeroBoard {
}
g2d.setColor(stripColor);
drawingObserver.startTrackingContinuityArea(1, true);
drawingObserver.startTrackingContinuityArea(true);
g2d.fillRect((int)(x - stripSize / 2), (int)(y + spacing - stripSize / 2), stripSize, (int)(spacing * (spacesToDraw - 1)
+ stripSize));
drawingObserver.stopTrackingContinuityArea();
@@ -73,7 +73,7 @@ public class VeroBoard extends AbstractVeroBoard {
x = firstPoint.getX();
y += spacing;
g2d.setColor(stripColor);
drawingObserver.startTrackingContinuityArea(1, true);
drawingObserver.startTrackingContinuityArea(true);
g2d.fillRect((int)(x + spacing / 2), (int)(y - stripSize / 2), (int)(finalSecondPoint.getX() - spacing - x), stripSize);
drawingObserver.stopTrackingContinuityArea();
g2d.setColor(stripColor.darker());
@@ -91,7 +91,7 @@ public class VeroBoard extends AbstractVeroBoard {
x += spacing;
y = firstPoint.getY();
g2d.setColor(stripColor);
drawingObserver.startTrackingContinuityArea(1, true);
drawingObserver.startTrackingContinuityArea(true);
g2d.fillRect((int)(x - stripSize / 2), (int)(y + spacing / 2), stripSize, (int)(finalSecondPoint.getY() - spacing - y));
drawingObserver.stopTrackingContinuityArea();
g2d.setColor(stripColor.darker());
@@ -158,15 +158,10 @@ public class CopperTrace extends AbstractLeadedComponent<Void> {
}
@Override
protected boolean isCopperArea() {
protected boolean IsCopperArea() {
return true;
}
@Override
protected int getLayerId() {
return getLayer().getId();
}
@Override
public String getControlPointNodeName(int index) {
return null;
@@ -63,7 +63,7 @@ public class CurvedTrace extends AbstractCurvedComponent<Void> {
componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING ? SELECTION_COLOR
: color;
g2d.setColor(curveColor);
drawingObserver.startTrackingContinuityArea(getLayer().getId(), true);
drawingObserver.startTrackingContinuityArea(true);
g2d.draw(curve);
drawingObserver.stopTrackingContinuityArea();
}
@@ -72,7 +72,7 @@ public class Eyelet extends AbstractComponent<String> {
int holeDiameter = getClosestOdd((int) holeSize.convertToPixels());
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1f));
g2d.setColor(color);
drawingObserver.startTrackingContinuityArea(1, true);
drawingObserver.startTrackingContinuityArea(true);
g2d.fillOval((int)(point.getX() - diameter / 2), (int)(point.getY() - diameter / 2), diameter, diameter);
drawingObserver.stopTrackingContinuityArea();
g2d.setColor(componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING ? SELECTION_COLOR
@@ -73,7 +73,7 @@ public class GroundFill extends AbstractComponent<Void> {
xPoints[i] = (int)controlPoints[i].getX();
yPoints[i] = (int)controlPoints[i].getY();
}
drawingObserver.startTrackingContinuityArea(getLayer().getId(), true);
drawingObserver.startTrackingContinuityArea(true);
g2d.fillPolygon(xPoints, yPoints, controlPoints.length);
drawingObserver.stopTrackingContinuityArea();
// Do not track any changes that follow because the whole board has been
@@ -69,7 +69,7 @@ public class SolderPad extends AbstractComponent<Void> {
double holeDiameter = getHoleSize().convertToPixels();
g2d.setColor(componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING ? SELECTION_COLOR
: color);
drawingObserver.startTrackingContinuityArea(getLayer().getId(), true);
drawingObserver.startTrackingContinuityArea(true);
if (type == Type.ROUND) {
g2d.fill(new Ellipse2D.Double(point.getX() - diameter / 2, point.getY() - diameter / 2, diameter, diameter));
} else if (type == Type.OVAL_HORIZONTAL) {
@@ -84,7 +84,7 @@ public class TraceCut extends AbstractComponent<Void> {
int holeSpacing = getClosestOdd(getHoleSpacing().convertToPixels());
g2d.setColor(componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING ? SELECTION_COLOR
: getBoardColor());
drawingObserver.startTrackingContinuityArea(1, false);
drawingObserver.startTrackingContinuityArea(false);
if (getOrientation() == OrientationHV.VERTICAL)
g2d.fillRect((int)(point.getX() - holeSpacing / 2 - cutWidth / 2), (int)(point.getY() - size / 2 - 1), cutWidth, size + 2);
else
@@ -93,7 +93,7 @@ public class TraceCut extends AbstractComponent<Void> {
} else {
g2d.setColor(componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING ? SELECTION_COLOR
: getBoardColor());
drawingObserver.startTrackingContinuityArea(1, false);
drawingObserver.startTrackingContinuityArea(false);
g2d.fillRoundRect((int)(point.getX() - size / 2), (int)(point.getY() - size / 2), size, size, size, size);
drawingObserver.stopTrackingContinuityArea();
@@ -70,7 +70,7 @@ public class Turret extends AbstractComponent<String> {
int holeDiameter = getClosestOdd((int) holeSize.convertToPixels());
g2d.setColor(color);
g2d.setStroke(ObjectCache.getInstance().fetchZoomableStroke(1f));
drawingObserver.startTrackingContinuityArea(1, true);
drawingObserver.startTrackingContinuityArea(true);
g2d.fillOval((int)(point.getX() - diameter / 2), (int)(point.getY() - diameter / 2), diameter, diameter);
drawingObserver.stopTrackingContinuityArea();
g2d.setColor(componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING ? SELECTION_COLOR
@@ -127,7 +127,7 @@ public class OpenJack1_4 extends AbstractMultiPartComponent<String> {
}
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : BASE_COLOR);
drawingObserver.startTrackingContinuityArea(hashCode(), true);
drawingObserver.startTrackingContinuityArea(true);
g2d.fill(body[1]);
g2d.fill(body[2]);
if (body[3] != null)
@@ -127,7 +127,7 @@ public class OpenJack1_8 extends AbstractMultiPartComponent<String> {
}
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : BASE_COLOR);
drawingObserver.startTrackingContinuityArea(hashCode(), true);
drawingObserver.startTrackingContinuityArea(true);
g2d.fill(body[1]);
g2d.fill(body[2]);
if (body[3] != null)
@@ -123,7 +123,7 @@ public class PilotLampHolder extends AbstractMultiPartComponent<String> {
}
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : BASE_COLOR);
drawingObserver.startTrackingContinuityArea(hashCode(), true);
drawingObserver.startTrackingContinuityArea(true);
g2d.fill(body[3]);
g2d.fill(body[4]);
@@ -114,7 +114,7 @@ public class RCAJack extends AbstractMultiPartComponent<String> {
}
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : BASE_COLOR);
drawingObserver.startTrackingContinuityArea(hashCode(), true);
drawingObserver.startTrackingContinuityArea(true);
g2d.fill(body[1]);
g2d.fill(body[2]);
drawingObserver.stopTrackingContinuityArea();
@@ -121,7 +121,7 @@ public class RotarySelectorSwitch extends AbstractMultiPartComponent<String> {
}
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : TERMINAL_COLOR);
drawingObserver.startTrackingContinuityArea(hashCode(), true);
drawingObserver.startTrackingContinuityArea(true);
for (int i = 2; i < body.length; i++)
g2d.fill(body[i]);
drawingObserver.stopTrackingContinuityArea();
@@ -350,7 +350,7 @@ public class RotarySwitchOpen extends AbstractAngledComponent<RotarySwitchOpenTy
// Draw outer pins
if (configuration.getNeedsSecondLevel()) {
drawingObserver.startTrackingContinuityArea(hashCode(), true);
drawingObserver.startTrackingContinuityArea(true);
for (int i = secondLevelStart; i < body.length; i++) {
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : pinColor);
g2d.fill(body[i]);
@@ -373,7 +373,7 @@ public class RotarySwitchOpen extends AbstractAngledComponent<RotarySwitchOpenTy
// Draw pins
for (int i = 1; i <= secondLevelStart; i++) {
drawingObserver.startTrackingContinuityArea(hashCode(), true);
drawingObserver.startTrackingContinuityArea(true);
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : pinColor);
g2d.fill(body[i]);
drawingObserver.stopTrackingContinuityArea();
@@ -216,7 +216,7 @@ public class RotarySwitchSealed extends AbstractAngledComponent<RotarySwitchSeal
}
g2d.setColor(pinColor);
if (getMount() == Mount.CHASSIS)
drawingObserver.startTrackingContinuityArea(hashCode(), true);
drawingObserver.startTrackingContinuityArea(true);
g2d.fill(pinShape);
drawingObserver.stopTrackingContinuityArea();
g2d.setColor(pinColor.darker());
@@ -76,7 +76,7 @@ public class SwitchLatchingSymbol
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke((float) (terminalSize / 4)));
drawingObserver.startTrackingContinuityArea(hashCode(), true);
drawingObserver.startTrackingContinuityArea(true);
for (int i = 0; i < controlPoints.length; i++) {
Ellipse2D.Double terminal = new Ellipse2D.Double(controlPoints[i].getX() - terminalSize / 2,
@@ -191,7 +191,7 @@ public class S1Switch extends AbstractTransparentComponent<Void> implements ISwi
g2d.drawOval((int)(p.getX() - padDiameter / 2), (int)(p.getY() - padDiameter / 2), padDiameter, padDiameter);
} else {
g2d.setColor(PAD_COLOR);
drawingObserver.startTrackingContinuityArea(hashCode(), true);
drawingObserver.startTrackingContinuityArea(true);
g2d.fillOval((int)(p.getX() - padDiameter / 2), (int)(p.getY() - padDiameter / 2), padDiameter, padDiameter);
drawingObserver.stopTrackingContinuityArea();
g2d.setColor(PAD_COLOR.darker());
@@ -93,7 +93,7 @@ public class CommonNode extends AbstractComponent<String> implements ICommonNode
}
g2d.setColor(bgColor);
drawingObserver.startTrackingContinuityArea(text.hashCode(), true);
drawingObserver.startTrackingContinuityArea(true);
g2d.fill(rect);
drawingObserver.stopTrackingContinuityArea();
drawingObserver.stopTracking();
@@ -279,11 +279,11 @@ public class PotentiometerPanel extends AbstractPotentiometer {
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha / MAX_ALPHA));
}
if (!outlineMode) {
// if (i == 3)
// drawingObserver.startTrackingContinuityArea(true);
if (i == 3)
drawingObserver.startTrackingContinuityArea(true);
g2d.fill(shape);
// if (i == 3)
// drawingObserver.stopTrackingContinuityArea();
if (i == 3)
drawingObserver.stopTrackingContinuityArea();
}
g2d.setComposite(oldComposite);
Color finalBorderColor;
@@ -248,7 +248,7 @@ public class Jumbo4PinTubeSocket extends AbstractAngledComponent<String> {
Shape terminalShape = body[1];
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : getTerminalColor());
drawingObserver.startTrackingContinuityArea(hashCode(), true);
drawingObserver.startTrackingContinuityArea(true);
g2d.fill(terminalShape);
drawingObserver.stopTrackingContinuityArea();
@@ -287,7 +287,7 @@ public class TubeSocket extends AbstractAngledComponent<String> {
}
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : PIN_COLOR);
if (getMount() == Mount.CHASSIS)
drawingObserver.startTrackingContinuityArea(hashCode(), true);
drawingObserver.startTrackingContinuityArea(true);
g2d.fill(pinShape);
drawingObserver.stopTrackingContinuityArea();
if (!outlineMode) {
Binary file not shown.
Binary file not shown.