/** @see org.eclipse.draw2d.ConnectionRouter#invalidate(Connection) */ public void invalidate(Connection conn) { if (next() != null) next().invalidate(conn); if (conn.getSourceAnchor() == null || conn.getTargetAnchor() == null) return; HashKey connectionKey = new HashKey(conn); ArrayList connectionList = connections.get(connectionKey); int affected = connections.remove(connectionKey, conn); if (affected != -1) { for (int i = affected; i < connectionList.size(); i++) ((Connection) connectionList.get(i)).revalidate(); } else connections.removeValue(conn); }
/** @see org.eclipse.draw2d.ConnectionRouter#remove(Connection) */ public void remove(Connection conn) { if (conn.getSourceAnchor() == null || conn.getTargetAnchor() == null) return; HashKey connectionKey = new HashKey(conn); ArrayList connectionList = connections.get(connectionKey); if (connectionList != null) { int index = connections.remove(connectionKey, conn); for (int i = index + 1; i < connectionList.size(); i++) ((Connection) connectionList.get(i)).revalidate(); } if (next() != null) next().remove(conn); }
HashKey(Connection conn) { anchor1 = conn.getSourceAnchor(); anchor2 = conn.getTargetAnchor(); }