Package org.eclipse.dd.dc

Examples of org.eclipse.dd.dc.Point


          }

          ILocation sourceLoc = Graphiti.getPeService().getLocationRelativeToDiagram(connection.getStart());
          ILocation targetLoc = Graphiti.getPeService().getLocationRelativeToDiagram(connection.getEnd());

          Point point = DcFactory.eINSTANCE.createPoint();
          point.setX(sourceLoc.getX());
          point.setY(sourceLoc.getY());
          edge.getWaypoint().add(point);

          point = DcFactory.eINSTANCE.createPoint();
          point.setX(targetLoc.getX());
          point.setY(targetLoc.getY());
          edge.getWaypoint().add(point);

          addShape(edge, bpmnDiagram);
          ModelUtil.setID(edge);
        }
View Full Code Here


      ModelHandler modelHandler = ModelHandlerLocator.getModelHandler(connection.getLink().getBusinessObjects()
          .get(0).eResource());

      EObject be = BusinessObjectUtil.getFirstElementOfType(connection, clazz);
      BPMNEdge edge = (BPMNEdge) modelHandler.findDIElement(diagram, (BaseElement) be);
      Point point = DcFactory.eINSTANCE.createPoint();

      List<Point> waypoint = edge.getWaypoint();
      waypoint.clear();

      GraphicsAlgorithm graphicsAlgorithm = connection.getStart().getGraphicsAlgorithm();
      // FIXME connections must create anchors!!!
      if (graphicsAlgorithm != null) {
        point.setX(graphicsAlgorithm.getX());
        point.setY(graphicsAlgorithm.getY());
      } else {
        point.setX(connection.getStart().getParent().getGraphicsAlgorithm().getX());
        point.setY(connection.getStart().getParent().getGraphicsAlgorithm().getY());
      }
      waypoint.add(point);

      if (connection instanceof FreeFormConnectionImpl) {
        FreeFormConnectionImpl freeForm = (FreeFormConnectionImpl) connection;
        EList<org.eclipse.graphiti.mm.algorithms.styles.Point> bendpoints = freeForm.getBendpoints();
        for (org.eclipse.graphiti.mm.algorithms.styles.Point bp : bendpoints) {
          addBendPoint(freeForm, point);
        }
      }

      point = DcFactory.eINSTANCE.createPoint();
      graphicsAlgorithm = connection.getEnd().getGraphicsAlgorithm();
      if (graphicsAlgorithm != null) {
        point.setX(graphicsAlgorithm.getX());
        point.setY(graphicsAlgorithm.getY());
      } else {
        point.setX(connection.getEnd().getParent().getGraphicsAlgorithm().getX());
        point.setY(connection.getEnd().getParent().getGraphicsAlgorithm().getY());
      }
      waypoint.add(point);

    } catch (IOException e) {
      Activator.logError(e);
View Full Code Here

    try {
      FreeFormConnection connection = context.getConnection();
      BaseElement element = (BaseElement) BusinessObjectUtil.getFirstElementOfType(connection, BaseElement.class);
      ModelHandler modelHandler = ModelHandlerLocator.getModelHandler(getDiagram().eResource());

      Point p = DcFactory.eINSTANCE.createPoint();
      p.setX(context.getX());
      p.setY(context.getY());

      BPMNEdge edge = (BPMNEdge) modelHandler.findDIElement(getDiagram(), element);
      int index = context.getBendpointIndex() + 1;
      edge.getWaypoint().add(index, p);
      if (index == 1) {
View Full Code Here

      FreeFormConnection connection = context.getConnection();
      BaseElement element = (BaseElement) BusinessObjectUtil.getFirstElementOfType(connection, BaseElement.class);
      ModelHandler modelHandler = ModelHandlerLocator.getModelHandler(getDiagram().eResource());
      BPMNEdge edge = (BPMNEdge) modelHandler.findDIElement(getDiagram(), element);
      int index = context.getBendpointIndex() + 1;
      Point p = edge.getWaypoint().get(index);
      p.setX(context.getX());
      p.setY(context.getY());
      if (index == 1) {
        AnchorUtil.reConnect((BPMNShape) edge.getSourceElement(), getDiagram());
      } else if (index == connection.getBendpoints().size()) {
        AnchorUtil.reConnect((BPMNShape) edge.getTargetElement(), getDiagram());
      }
View Full Code Here

TOP

Related Classes of org.eclipse.dd.dc.Point

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.