public ConnectionAnchor getConnectionAnchor(String terminal) {
return connectionAnchors.get(terminal);
}
public ConnectionAnchor getConnectionAnchorAt(Point p) {
ConnectionAnchor closest = null;
long min = Long.MAX_VALUE;
Collection<FixedConnectionAnchor> coll = connectionAnchors.values();
Iterator<FixedConnectionAnchor> iter = coll.iterator();
while (iter.hasNext()) {
ConnectionAnchor anchor = iter.next();
Point p2 = anchor.getLocation(null);
long d = p.getDistance2(p2);
if (d < min) {
min = d;
closest = anchor;
}