 
     return  unless targetId
 
-    log "Connect #{sourceId} to #{targetId}"
     source = @getDia sourceId
     target = @getDia targetId
     target.joint = @guessJoint target, source  unless target.joint

        return no  unless restrictions
        return no  if source.joint in restrictions
      [source, target] = [target, source]
    return yes

  updateScene:->


            joint = conn.dia.joints[conn.joint]
            if joint not in @activeJoints
              joint.showDeleteButton()
              joint.on 'DeleteRequested', @bound 'disconnect'
              @activeJoints.push joint

  handleLineRequest:(joint)->
    @_trackJoint = joint

  findTargetConnection:(dia, joint)->
    isEqual = (connection)=>
      (dia is connection.dia) and (joint is connection.joint)
    activeDia = @activeDias.first
    for conn in @connections
      if ((isEqual conn.source) or (isEqual conn.target)) and \
         ((conn.source.dia is activeDia) or (conn.target.dia is activeDia))
        return conn

  # Needs refactoring ~ GG
  disconnect:(dia, joint)->
    return  if @activeDias.length isnt 1

    connectionsToDelete = @findTargetConnection dia, joint
    @connections = (c for c in @connections when c isnt connectionsToDelete)
    @highlightLines @activeDias

  disconnectAllConnections:(dia)->

    newConnections = []
    for connection in @connections
