Shape s = ss.element;
// For each connection ends, look up for a gate
if (ss instanceof ConnectionPathSelection){
Connection connection = ((ConnectionPathSelection)ss).getConnection();
Path connectionPath = connection.getPath();
Point firstEnd = connectionPath.getNode(0); // first end
GatedComponent gc = getGateComponentAt(firstEnd);
if (gc != null){
_currentTrackedComponent.add(gc);
}
Gate gate = getGateAt(firstEnd);
if (gate != null){
_currentTrackedGates.add(new TrackedGate(connection, true, gate));
}
Point lastEnd = connectionPath.getNode(connectionPath.getNodeNumber()-1); // first end
gc = getGateComponentAt(lastEnd);
if (gc != null){
_currentTrackedComponent.add(gc);
}