* @param link The control link
* @return The new figure or null on error
*/
public FlowConnection createFlowConnection(ControlLink link)
{
NodeSocket source = link.getSourceSocket();
NodeSocket target = link.getTargetSocket();
if (source == null)
{
System.err.println("Missing source socket for control link '" + link.getQualifier() + "'");
return null;
}
if (target == null)
{
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);