Package org.eclipse.dd.dc

Examples of org.eclipse.dd.dc.DcFactory


                            }
                        } else if (flowElement instanceof SequenceFlow) {
                            SequenceFlow sequenceFlow = (SequenceFlow) flowElement;
                            BPMNEdge edge = diFactory.createBPMNEdge();
                            edge.setBpmnElement(flowElement);
                            DcFactory dcFactory = DcFactory.eINSTANCE;
                            Point point = dcFactory.createPoint();
                            if(sequenceFlow.getSourceRef() != null) {
                                Bounds sourceBounds = _bounds.get(sequenceFlow.getSourceRef().getId());
                                point.setX(sourceBounds.getX() + (sourceBounds.getWidth()/2));
                                point.setY(sourceBounds.getY() + (sourceBounds.getHeight()/2));
                            }
                            edge.getWaypoint().add(point);
//                List<Point> dockers = _dockers.get(sequenceFlow.getId());
//                for (int i = 1; i < dockers.size() - 1; i++) {
//                  edge.getWaypoint().add(dockers.get(i));
//                }
                            point = dcFactory.createPoint();
                            if(sequenceFlow.getTargetRef() != null) {
                                Bounds targetBounds = _bounds.get(sequenceFlow.getTargetRef().getId());
                                point.setX(targetBounds.getX() + (targetBounds.getWidth()/2));
                                point.setY(targetBounds.getY() + (targetBounds.getHeight()/2));
                            }
View Full Code Here


        }
      } else if (subProcessFlowElement instanceof SequenceFlow) {
        SequenceFlow sequenceFlow = (SequenceFlow) subProcessFlowElement;
        BPMNEdge edge = factory.createBPMNEdge();
        edge.setBpmnElement(subProcessFlowElement);
        DcFactory dcFactory = DcFactory.eINSTANCE;
        Point point = dcFactory.createPoint();
        if(sequenceFlow.getSourceRef() != null) {
          Bounds sourceBounds = _bounds.get(sequenceFlow.getSourceRef().getId());
          point.setX(sourceBounds.getX() + (sourceBounds.getWidth()/2));
          point.setY(sourceBounds.getY() + (sourceBounds.getHeight()/2));
        }
        edge.getWaypoint().add(point);
        List<Point> dockers = _dockers.get(sequenceFlow.getId());
        for (int i = 1; i < dockers.size() - 1; i++) {
          edge.getWaypoint().add(dockers.get(i));
        }
        point = dcFactory.createPoint();
        if(sequenceFlow.getTargetRef() != null) {
          Bounds targetBounds = _bounds.get(sequenceFlow.getTargetRef().getId());
          point.setX(targetBounds.getX() + (targetBounds.getWidth()/2));
          point.setY(targetBounds.getY() + (targetBounds.getHeight()/2));
        }
        edge.getWaypoint().add(point);
        plane.getPlaneElement().add(edge);
      }
    }
    for (Artifact artifact : sp.getArtifacts()) {
            if (artifact instanceof TextAnnotation || artifact instanceof Group) {
              Bounds ba = _bounds.get(artifact.getId());
              if (ba != null) {
                BPMNShape shape = factory.createBPMNShape();
                shape.setBpmnElement(artifact);
                shape.setBounds(ba);
                plane.getPlaneElement().add(shape);
              }
            }
            if (artifact instanceof Association){
                Association association = (Association)artifact;
                BPMNEdge edge = factory.createBPMNEdge();
                edge.setBpmnElement(association);
                DcFactory dcFactory = DcFactory.eINSTANCE;
                Point point = dcFactory.createPoint();
                Bounds sourceBounds = _bounds.get(association.getSourceRef().getId());
                point.setX(sourceBounds.getX() + (sourceBounds.getWidth()/2));
                point.setY(sourceBounds.getY() + (sourceBounds.getHeight()/2));
                edge.getWaypoint().add(point);
                List<Point> dockers = _dockers.get(association.getId());
                for (int i = 1; i < dockers.size() - 1; i++) {
                        edge.getWaypoint().add(dockers.get(i));
                }
                point = dcFactory.createPoint();
                Bounds targetBounds = _bounds.get(association.getTargetRef().getId());
                point.setX(targetBounds.getX() + (targetBounds.getWidth()/2));
                point.setY(targetBounds.getY() + (targetBounds.getHeight()/2));
                edge.getWaypoint().add(point);
                plane.getPlaneElement().add(edge);
View Full Code Here

                  plane.getPlaneElement().add(shape);
                  if(flowElement instanceof BoundaryEvent) {
                    BPMNEdge edge = factory.createBPMNEdge();
                    edge.setBpmnElement(flowElement);
                    List<Point> dockers = _dockers.get(flowElement.getId());
                    DcFactory dcFactory = DcFactory.eINSTANCE;
                    Point addedDocker = dcFactory.createPoint();
                    for (int i = 0; i < dockers.size(); i++) {
                      edge.getWaypoint().add(dockers.get(i));
                      if(i == 0) {
                        addedDocker.setX(dockers.get(i).getX());
                        addedDocker.setY(dockers.get(i).getY());
                      }
                    }
                    if(dockers.size() == 1) {
                      edge.getWaypoint().add(addedDocker);
                    }
                    plane.getPlaneElement().add(edge);
                  }
                }
                // check if its a subprocess
                if(flowElement instanceof SubProcess) {
                  createSubProcessDiagram(plane, flowElement, factory);
                }
              } else if(flowElement instanceof DataObject) {
                Bounds b = _bounds.get(flowElement.getId());
                if (b != null) {
                  BPMNShape shape = factory.createBPMNShape();
                  shape.setBpmnElement(flowElement);
                  shape.setBounds(b);
                  plane.getPlaneElement().add(shape);
                }
              }
              else if (flowElement instanceof SequenceFlow) {
                SequenceFlow sequenceFlow = (SequenceFlow) flowElement;
                BPMNEdge edge = factory.createBPMNEdge();
              edge.setBpmnElement(flowElement);
              DcFactory dcFactory = DcFactory.eINSTANCE;
              Point point = dcFactory.createPoint();
              if(sequenceFlow.getSourceRef() != null) {
                Bounds sourceBounds = _bounds.get(sequenceFlow.getSourceRef().getId());
                point.setX(sourceBounds.getX() + (sourceBounds.getWidth()/2));
                point.setY(sourceBounds.getY() + (sourceBounds.getHeight()/2));
              }
              edge.getWaypoint().add(point);
              List<Point> dockers = _dockers.get(sequenceFlow.getId());
              for (int i = 1; i < dockers.size() - 1; i++) {
                edge.getWaypoint().add(dockers.get(i));
              }
              point = dcFactory.createPoint();
              if(sequenceFlow.getTargetRef() != null) {
                Bounds targetBounds = _bounds.get(sequenceFlow.getTargetRef().getId());
                point.setX(targetBounds.getX() + (targetBounds.getWidth()/2));
                point.setY(targetBounds.getY() + (targetBounds.getHeight()/2));
              }
              edge.getWaypoint().add(point);
              plane.getPlaneElement().add(edge);
              }
            }
            // artifacts
                if (process.getArtifacts() != null){
                    for (Artifact artifact : process.getArtifacts()) {
                        if (artifact instanceof TextAnnotation || artifact instanceof Group) {
                          Bounds b = _bounds.get(artifact.getId());
                          if (b != null) {
                            BPMNShape shape = factory.createBPMNShape();
                            shape.setBpmnElement(artifact);
                            shape.setBounds(b);
                            plane.getPlaneElement().add(shape);
                          }
                        }
                        if (artifact instanceof Association){
                            Association association = (Association)artifact;
                            BPMNEdge edge = factory.createBPMNEdge();
                            edge.setBpmnElement(association);
                            DcFactory dcFactory = DcFactory.eINSTANCE;
                            Point point = dcFactory.createPoint();
                            Bounds sourceBounds = _bounds.get(association.getSourceRef().getId());
                            point.setX(sourceBounds.getX() + (sourceBounds.getWidth()/2));
                            point.setY(sourceBounds.getY() + (sourceBounds.getHeight()/2));
                            edge.getWaypoint().add(point);
                            List<Point> dockers = _dockers.get(association.getId());
                            for (int i = 1; i < dockers.size() - 1; i++) {
                                    edge.getWaypoint().add(dockers.get(i));
                            }
                            point = dcFactory.createPoint();
                            Bounds targetBounds = _bounds.get(association.getTargetRef().getId());
                            point.setX(targetBounds.getX()); // TODO check
                            point.setY(targetBounds.getY() + (targetBounds.getHeight()/2));
                            edge.getWaypoint().add(point);
                            plane.getPlaneElement().add(edge);
View Full Code Here

     * <!-- end-user-doc -->
     * @generated
     */
    public static DcFactory init() {
        try {
            DcFactory theDcFactory = (DcFactory) EPackage.Registry.INSTANCE
                    .getEFactory("http://www.omg.org/spec/DD/20100524/DC-XMI");
            if (theDcFactory != null) {
                return theDcFactory;
            }
        } catch (Exception exception) {
View Full Code Here

TOP

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

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.