Package org.eclipse.gmf.runtime.notation

Examples of org.eclipse.gmf.runtime.notation.Edge


   * @generated
   */
  protected CommandResult doExecuteWithResult(
      IProgressMonitor progressMonitor, IAdaptable info) {
    assert null != edgeAdaptor : "Null child in OntoUMLReorientConnectionViewCommand"; //$NON-NLS-1$
    Edge edge = (Edge) getEdgeAdaptor().getAdapter(Edge.class);
    assert null != edge : "Null edge in OntoUMLReorientConnectionViewCommand"; //$NON-NLS-1$
    View tempView = edge.getSource();
    edge.setSource(edge.getTarget());
    edge.setTarget(tempView);
    return CommandResult.newOKCommandResult();
  }
View Full Code Here


  private Collection getLinksSourceByType(Collection edges, int visualID) {
    Collection result = new ArrayList();
    String type = OntoUML.diagram.part.OntoUMLVisualIDRegistry
        .getType(visualID);
    for (Iterator it = edges.iterator(); it.hasNext();) {
      Edge nextEdge = (Edge) it.next();
      View nextEdgeSource = nextEdge.getSource();
      if (type.equals(nextEdgeSource.getType())
          && isOwnView(nextEdgeSource)) {
        result.add(nextEdgeSource);
      }
    }
View Full Code Here

  private Collection getLinksTargetByType(Collection edges, int visualID) {
    Collection result = new ArrayList();
    String type = OntoUML.diagram.part.OntoUMLVisualIDRegistry
        .getType(visualID);
    for (Iterator it = edges.iterator(); it.hasNext();) {
      Edge nextEdge = (Edge) it.next();
      View nextEdgeTarget = nextEdge.getTarget();
      if (type.equals(nextEdgeTarget.getType())
          && isOwnView(nextEdgeTarget)) {
        result.add(nextEdgeTarget);
      }
    }
View Full Code Here

    Collection linkDescriptors = collectAllLinks(getDiagram(),
        domain2NotationMap);
    Collection existingLinks = new LinkedList(getDiagram().getEdges());
    for (Iterator linksIterator = existingLinks.iterator(); linksIterator
        .hasNext();) {
      Edge nextDiagramLink = (Edge) linksIterator.next();
      int diagramLinkVisualID = OntoUML.diagram.part.OntoUMLVisualIDRegistry
          .getVisualID(nextDiagramLink);
      if (diagramLinkVisualID == -1) {
        if (nextDiagramLink.getSource() != null
            && nextDiagramLink.getTarget() != null) {
          linksIterator.remove();
        }
        continue;
      }
      EObject diagramLinkObject = nextDiagramLink.getElement();
      EObject diagramLinkSrc = nextDiagramLink.getSource().getElement();
      EObject diagramLinkDst = nextDiagramLink.getTarget().getElement();
      for (Iterator LinkDescriptorsIterator = linkDescriptors.iterator(); LinkDescriptorsIterator
          .hasNext();) {
        OntoUML.diagram.part.OntoUMLLinkDescriptor nextLinkDescriptor = (OntoUML.diagram.part.OntoUMLLinkDescriptor) LinkDescriptorsIterator
            .next();
        if (diagramLinkObject == nextLinkDescriptor.getModelElement()
View Full Code Here

   * @generated
   */
  private Collection getLinksSourceByType(Collection edges, String type) {
    Collection result = new ArrayList();
    for (Iterator it = edges.iterator(); it.hasNext();) {
      Edge nextEdge = (Edge) it.next();
      View nextEdgeSource = nextEdge.getSource();
      if (type.equals(nextEdgeSource.getType())
          && isOwnView(nextEdgeSource)) {
        result.add(nextEdgeSource);
      }
    }
View Full Code Here

   * @generated
   */
  private Collection getLinksTargetByType(Collection edges, String type) {
    Collection result = new ArrayList();
    for (Iterator it = edges.iterator(); it.hasNext();) {
      Edge nextEdge = (Edge) it.next();
      View nextEdgeTarget = nextEdge.getTarget();
      if (type.equals(nextEdgeTarget.getType())
          && isOwnView(nextEdgeTarget)) {
        result.add(nextEdgeTarget);
      }
    }
View Full Code Here

    View view = (View) getHost().getModel();
    CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(
        getEditingDomain(), null);
    cmd.setTransactionNestingEnabled(false);
    for (Iterator<?> it = view.getTargetEdges().iterator(); it.hasNext();) {
      Edge incomingLink = (Edge) it.next();
      if (DispelVisualIDRegistry.getVisualID(incomingLink) == ConnectionExpressionEditPart.VISUAL_ID) {
        DestroyElementRequest r = new DestroyElementRequest(
            incomingLink.getElement(), false);
        cmd.add(new DestroyElementCommand(r));
        cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
        continue;
      }
    }
    for (Iterator<?> it = view.getSourceEdges().iterator(); it.hasNext();) {
      Edge outgoingLink = (Edge) it.next();
      if (DispelVisualIDRegistry.getVisualID(outgoingLink) == ConnectionExpressionEditPart.VISUAL_ID) {
        DestroyElementRequest r = new DestroyElementRequest(
            outgoingLink.getElement(), false);
        cmd.add(new DestroyElementCommand(r));
        cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
        continue;
      }
    }
View Full Code Here

    Collection<DispelLinkDescriptor> linkDescriptors = collectAllLinks(
        getDiagram(), domain2NotationMap);
    Collection existingLinks = new LinkedList(getDiagram().getEdges());
    for (Iterator linksIterator = existingLinks.iterator(); linksIterator
        .hasNext();) {
      Edge nextDiagramLink = (Edge) linksIterator.next();
      int diagramLinkVisualID = DispelVisualIDRegistry
          .getVisualID(nextDiagramLink);
      if (diagramLinkVisualID == -1) {
        if (nextDiagramLink.getSource() != null
            && nextDiagramLink.getTarget() != null) {
          linksIterator.remove();
        }
        continue;
      }
      EObject diagramLinkObject = nextDiagramLink.getElement();
      EObject diagramLinkSrc = nextDiagramLink.getSource().getElement();
      EObject diagramLinkDst = nextDiagramLink.getTarget().getElement();
      for (Iterator<DispelLinkDescriptor> linkDescriptorsIterator = linkDescriptors
          .iterator(); linkDescriptorsIterator.hasNext();) {
        DispelLinkDescriptor nextLinkDescriptor = linkDescriptorsIterator
            .next();
        if (diagramLinkObject == nextLinkDescriptor.getModelElement()
View Full Code Here

    View view = (View) getHost().getModel();
    CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(
        getEditingDomain(), null);
    cmd.setTransactionNestingEnabled(false);
    for (Iterator<?> it = view.getSourceEdges().iterator(); it.hasNext();) {
      Edge outgoingLink = (Edge) it.next();
      if (DispelVisualIDRegistry.getVisualID(outgoingLink) == MethodCall2EditPart.VISUAL_ID) {
        DestroyElementRequest r = new DestroyElementRequest(
            outgoingLink.getElement(), false);
        cmd.add(new DestroyElementCommand(r));
        cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
        continue;
      }
    }
View Full Code Here

          Node cnode = (Node) cit.next();
          switch (DispelVisualIDRegistry.getVisualID(cnode)) {
          case MethodCallEditPart.VISUAL_ID:
            for (Iterator<?> it = cnode.getTargetEdges().iterator(); it
                .hasNext();) {
              Edge incomingLink = (Edge) it.next();
              if (DispelVisualIDRegistry
                  .getVisualID(incomingLink) == ConnectionExpressionEditPart.VISUAL_ID) {
                DestroyElementRequest r = new DestroyElementRequest(
                    incomingLink.getElement(), false);
                cmd.add(new DestroyElementCommand(r));
                cmd.add(new DeleteCommand(getEditingDomain(),
                    incomingLink));
                continue;
              }
            }
            for (Iterator<?> it = cnode.getSourceEdges().iterator(); it
                .hasNext();) {
              Edge outgoingLink = (Edge) it.next();
              if (DispelVisualIDRegistry
                  .getVisualID(outgoingLink) == ConnectionExpressionEditPart.VISUAL_ID) {
                DestroyElementRequest r = new DestroyElementRequest(
                    outgoingLink.getElement(), false);
                cmd.add(new DestroyElementCommand(r));
                cmd.add(new DeleteCommand(getEditingDomain(),
                    outgoingLink));
                continue;
              }
View Full Code Here

TOP

Related Classes of org.eclipse.gmf.runtime.notation.Edge

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.