{
System.err.println("Missing target socket for control link '" + link.getQualifier() + "'");
return null;
}
SocketFigure sourceFigure = (SocketFigure) source.getRepresentation();
if (sourceFigure == null)
{
System.err.println("Control link source socket '" + source.getQualifier() + "' has no figure representation.");
return null;
}
SocketFigure targetFigure = (SocketFigure) target.getRepresentation();
if (targetFigure == null)
{
System.err.println("Control link target socket '" + target.getQualifier() + "' has no figure representation.");
return null;
}
Connector start = sourceFigure.connectorAt(0, 0);
Connector end = targetFigure.connectorAt(0, 0);
link.unlink();
FlowConnection flow = new FlowConnection(link, this);
flow.connectStart(start);