exists = false;
super.mouseReleased(canvas, g, e);
ArrayList<Wire> ws = new ArrayList<Wire>(2);
if (cur.getY() == start.getY() || cur.getX() == start.getX()) {
Wire w = Wire.create(cur, start);
w = checkForRepairs(canvas, w, w.getEnd0());
w = checkForRepairs(canvas, w, w.getEnd1());
if (performShortening(canvas, start, cur)) {
return;
}
if (w.getLength() > 0) {
ws.add(w);
}
} else {
Location m;
if (direction == HORIZONTAL) {
m = Location.create(cur.getX(), start.getY());
} else {
m = Location.create(start.getX(), cur.getY());
}
Wire w0 = Wire.create(start, m);
Wire w1 = Wire.create(m, cur);
w0 = checkForRepairs(canvas, w0, start);
w1 = checkForRepairs(canvas, w1, cur);
if (w0.getLength() > 0) {
ws.add(w0);
}
if (w1.getLength() > 0) {
ws.add(w1);
}
}
if (ws.size() > 0) {