Examples of BPMNEdge


Examples of org.eclipse.bpmn2.di.BPMNEdge

                                shape.setBounds(b);
                                plane.getPlaneElement().add(shape);
                            }
                        } 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));
                            }
                            edge.getWaypoint().add(point);
                            plane.getPlaneElement().add(edge);
                        }
                    }

                    def.getDiagrams().add(diagram);
View Full Code Here

Examples of org.eclipse.bpmn2.di.BPMNEdge

            if(dia instanceof BPMNShape) {
                BPMNShape shape = (BPMNShape) dia;
                updateShapeColors(shape);
            }
            if(dia instanceof BPMNEdge) {
                BPMNEdge edge = (BPMNEdge) dia;
                updateEdgeColors(edge);
            }
        }
    }
View Full Code Here

Examples of org.eclipse.bpmn2.di.BPMNEdge

          shape.setBounds(spb);
          plane.getPlaneElement().add(shape);
        }
      } 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

Examples of org.eclipse.bpmn2.di.BPMNEdge

                  BPMNShape shape = factory.createBPMNShape();
                  shape.setBpmnElement(flowElement);
                  shape.setBounds(b);
                  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);
                        }
                    }
                }
            // lanes
View Full Code Here

Examples of org.eclipse.bpmn2.di.BPMNEdge

            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case BpmnDiPackage.BPMN_EDGE: {
            BPMNEdge bpmnEdge = (BPMNEdge) theEObject;
            T result = caseBPMNEdge(bpmnEdge);
            if (result == null)
                result = caseLabeledEdge(bpmnEdge);
            if (result == null)
                result = caseEdge(bpmnEdge);
View Full Code Here

Examples of org.eclipse.bpmn2.di.BPMNEdge

        Collection<Point2D> intersections = gatewayRectangle.intersections(lastLine);
        Point2D intersection = intersections.iterator().next();
        graphicInfoList.add(createGraphicInfo(intersection.getX(), intersection.getY()));
      }
     
      BPMNEdge eggeTemp=BpmnDiFactory.eINSTANCE.createBPMNEdge();
      eggeTemp.getWaypoint().addAll(graphicInfoList);
      eggeTemp.setId(edgeId);
      BPMNShape sourceElement = BpmnModelUtil.getBpmnShape(bpmnModel, BpmnJsonConverterUtil.getElementId(sourceRefNode));
      BPMNShape targetElement = BpmnModelUtil.getBpmnShape(bpmnModel, BpmnJsonConverterUtil.getElementId(targetRefNode));
      eggeTemp.setSourceElement(sourceElement);
      eggeTemp.setTargetElement(targetElement);
      eggeTemp.setBpmnElement(BpmnModelUtil.getElement(bpmnModel,BpmnJsonConverterUtil.getElementIdFromEdgeId(edgeId),BaseElement.class));
      bpmnModel.getDiagrams().get(0).getPlane().getPlaneElement().add(eggeTemp);
    }
  }
View Full Code Here

Examples of org.eclipse.bpmn2.di.BPMNEdge

         
         
         
        }
        if (diagramElement instanceof BPMNEdge) {
          BPMNEdge bpmnEdge = (BPMNEdge) diagramElement;
         
          List<Point> pointList = bpmnEdge.getWaypoint();
          for (Point point : pointList) {
           
           
            if(point.getX()>maxX)
            {
              maxX=point.getX();
           
            }
            if(point.getY()>maxY)
            {
              maxY=point.getY();
            }
 
          }
          BaseElement bpmnElement=getBaseElement(bpmnEdge.getBpmnElement());
          if (bpmnElement instanceof SequenceFlow) {
            String sequenceFlowSVG = sequenceFlowToSVG(bpmnEdge);
            svg.addEdge(sequenceFlowSVG);
          }
          if (bpmnElement instanceof Association) {
View Full Code Here

Examples of org.eclipse.bpmn2.di.BPMNEdge

    ObjectNode dockNode = objectMapper.createObjectNode();
    dockNode.put(EDITOR_BOUNDS_X, BpmnModelUtil.getBpmnShape(model, sequenceFlow.getSourceRef().getId()).getBounds().getWidth() / 2.0);
    dockNode.put(EDITOR_BOUNDS_Y, BpmnModelUtil.getBpmnShape(model,sequenceFlow.getSourceRef().getId()).getBounds().getHeight() / 2.0);
    dockersArrayNode.add(dockNode);
   
    BPMNEdge bpmnEdge=BpmnModelUtil.getBpmnEdge(model, sequenceFlow.getId());
   
    if (bpmnEdge.getWaypoint().size() > 2) {
      for (int i = 1; i < bpmnEdge.getWaypoint().size() - 1; i++) {
        Point graphicInfo =  (bpmnEdge.getWaypoint().get(i));
        dockNode = objectMapper.createObjectNode();
        dockNode.put(EDITOR_BOUNDS_X, graphicInfo.getX());
        dockNode.put(EDITOR_BOUNDS_Y, graphicInfo.getY());
        dockersArrayNode.add(dockNode);
      }
View Full Code Here

Examples of org.eclipse.bpmn2.di.BPMNEdge

    elements.add(elem);
  }

  protected void createDIEdge(Connection connection, BaseElement conElement) {
    try {
      BPMNEdge edge = (BPMNEdge) ModelHandlerLocator.getModelHandler(getDiagram().eResource()).findDIElement(
          getDiagram(), conElement);
      createDIEdge(connection, conElement, edge);
    } catch (IOException e) {
      Activator.logError(e);
    }
View Full Code Here

Examples of org.eclipse.bpmn2.di.BPMNEdge

    @Override
    public void postReconnect(IReconnectionContext context) {
      super.postReconnect(context);

      BPMNEdge edge = BusinessObjectUtil.getFirstElementOfType(context.getConnection(), BPMNEdge.class);
      DiagramElement de = BusinessObjectUtil.getFirstElementOfType(context.getTargetPictogramElement(), DiagramElement.class);
      if (context.getReconnectType().equals(ReconnectionContext.RECONNECT_TARGET)) {
        edge.setTargetElement(de);
      }
      else {
        edge.setSourceElement(de);
      }
     
      BaseElement flow = BusinessObjectUtil.getFirstElementOfType(context.getConnection(), BaseElement.class);
      BaseElement be = BusinessObjectUtil.getFirstElementOfType(context.getTargetPictogramElement(), BaseElement.class);
      if (context.getReconnectType().equals(ReconnectionContext.RECONNECT_TARGET)) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.