Exemplo n.º 1
0
  /**
   *
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   *
   * @generated NOT
   */
  public void removeConnection(IDiagramModelConnection connection) {
    if (connection == null) {
      throw new IllegalArgumentException();
    }

    if (connection.getSource() == this) {
      getSourceConnections().remove(connection);
    }

    if (connection.getTarget() == this) {
      getTargetConnections().remove(connection);
    }
  }
Exemplo n.º 2
0
  /**
   *
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   *
   * @generated NOT
   */
  public void addConnection(IDiagramModelConnection connection) {
    if (connection == null) {
      throw new IllegalArgumentException("Connection was null"); // $NON-NLS-1$
    }

    // This used to be "if/else if". This way it is possible for source == target (recursive)
    if (connection.getSource() == this) {
      getSourceConnections().add(connection);
    }

    if (connection.getTarget() == this) {
      getTargetConnections().add(connection);
    }
  }