/**
  * Adds a new relationship given the connection. It will use the content provider to determine the
  * source and destination nodes.
  *
  * @param connection The connection data object.
  */
 public void addRelationship(Object connection) {
   IStylingGraphModelFactory modelFactory = getFactory();
   if (connectionsMap.get(connection) == null) {
     if (modelFactory.getContentProvider() instanceof IGraphContentProvider) {
       IGraphContentProvider content = ((IGraphContentProvider) modelFactory.getContentProvider());
       Object source = content.getSource(connection);
       Object dest = content.getDestination(connection);
       // create the new relationship
       modelFactory.createConnection(getGraphControl(), connection, source, dest);
     } else {
       throw new UnsupportedOperationException();
     }
   }
 }
 /**
  * Creates a new relationship between the source node and the destination node. If either node
  * doesn't exist then it will be created.
  *
  * @param connection The connection data object.
  * @param srcNode The source node data object.
  * @param destNode The destination node data object.
  */
 public void addRelationship(Object connection, Object srcNode, Object destNode) {
   // create the new relationship
   IStylingGraphModelFactory modelFactory = getFactory();
   modelFactory.createConnection(getGraphControl(), connection, srcNode, destNode);
 }