Examples of BPMNShape


Examples of org.eclipse.bpmn2.di.BPMNShape

                    diagram.setPlane(plane);
                    for (FlowElement flowElement: process.getFlowElements()) {
                        if (flowElement instanceof FlowNode) {
                            Bounds b = _bounds.get(flowElement.getId());
                            if (b != null) {
                                BPMNShape shape = diFactory.createBPMNShape();
                                shape.setBpmnElement(flowElement);
                                shape.setBounds(b);
                                plane.getPlaneElement().add(shape);
                            }
                        } else if (flowElement instanceof SequenceFlow) {
                            SequenceFlow sequenceFlow = (SequenceFlow) flowElement;
                            BPMNEdge edge = diFactory.createBPMNEdge();
View Full Code Here

Examples of org.eclipse.bpmn2.di.BPMNShape

                  }
            }
          }
        }
       
        BPMNShape shape = (BPMNShape) findDiagramElement(plane, node);
        Bounds bounds = shape.getBounds();
        correctEventNodeSize(shape);
        generator.writeObjectFieldStart("bounds");
        generator.writeObjectFieldStart("lowerRight");
        generator.writeObjectField("x", bounds.getX() + bounds.getWidth() - xOffset);
        generator.writeObjectField("y", bounds.getY() + bounds.getHeight() - yOffset);
View Full Code Here

Examples of org.eclipse.bpmn2.di.BPMNShape

    public void revisitDI(Definitions def) {
        BPMNPlane plane = def.getDiagrams().get(0).getPlane();
        List<DiagramElement> diagramElements = plane.getPlaneElement();
        for(DiagramElement dia : diagramElements) {
            if(dia instanceof BPMNShape) {
                BPMNShape shape = (BPMNShape) dia;
                updateShapeBounds(def, plane, shape.getBpmnElement());
            }
            // TODO Edges
            //else if(dia instanceof BPMNEdge) {
                //BPMNEdge edge = (BPMNEdge) dia;
                //updateEdgeBounds(def, plane, edge.getBpmnElement());
View Full Code Here

Examples of org.eclipse.bpmn2.di.BPMNShape

    public void revisitDIColors(Definitions def) {
        BPMNPlane plane = def.getDiagrams().get(0).getPlane();
        List<DiagramElement> diagramElements = plane.getPlaneElement();
        for(DiagramElement dia : diagramElements) {
            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.BPMNShape

    private Bounds getBoundsForShape(BPMNPlane plane, BaseElement ele) {
        List<DiagramElement> diagramElements = plane.getPlaneElement();
        for(DiagramElement dia : diagramElements) {
            if(dia instanceof BPMNShape) {
                BPMNShape shape = (BPMNShape) dia;
                if(shape.getBpmnElement().getId().equals(ele.getId())) {
                    return shape.getBounds();
                }
            }
        }
        return null;
    }
View Full Code Here

Examples of org.eclipse.bpmn2.di.BPMNShape

    SubProcess sp = (SubProcess) flowElement;
    for(FlowElement subProcessFlowElement : sp.getFlowElements()) {
      if(subProcessFlowElement instanceof SubProcess) {
        Bounds spb = _bounds.get(subProcessFlowElement.getId());
        if (spb != null) {
          BPMNShape shape = factory.createBPMNShape();
          shape.setBpmnElement(subProcessFlowElement);
          shape.setBounds(spb);
          plane.getPlaneElement().add(shape);
        }
        createSubProcessDiagram(plane, subProcessFlowElement, factory);
      } else if (subProcessFlowElement instanceof FlowNode) {
        Bounds spb = _bounds.get(subProcessFlowElement.getId());
        if (spb != null) {
          BPMNShape shape = factory.createBPMNShape();
          shape.setBpmnElement(subProcessFlowElement);
          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;
View Full Code Here

Examples of org.eclipse.bpmn2.di.BPMNShape

          // first process flowNodes
            for (FlowElement flowElement: process.getFlowElements()) {
              if (flowElement instanceof FlowNode) {
                Bounds b = _bounds.get(flowElement.getId());
                if (b != null) {
                  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
            if(process.getLaneSets() != null && process.getLaneSets().size() > 0) {
              for(LaneSet ls : process.getLaneSets()) {
                for(Lane lane : ls.getLanes()) {
                  Bounds b = _bounds.get(lane.getId());
                    if (b != null) {
                      BPMNShape shape = factory.createBPMNShape();
                      shape.setBpmnElement(lane);
                      shape.setBounds(b);
                      plane.getPlaneElement().add(shape);
                    }
                }
              }
            }
View Full Code Here

Examples of org.eclipse.bpmn2.di.BPMNShape

            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case BpmnDiPackage.BPMN_SHAPE: {
            BPMNShape bpmnShape = (BPMNShape) theEObject;
            T result = caseBPMNShape(bpmnShape);
            if (result == null)
                result = caseLabeledShape(bpmnShape);
            if (result == null)
                result = caseShape(bpmnShape);
View Full Code Here

Examples of org.eclipse.bpmn2.di.BPMNShape

     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setChoreographyActivityShape(BPMNShape newChoreographyActivityShape) {
        BPMNShape oldChoreographyActivityShape = choreographyActivityShape;
        choreographyActivityShape = newChoreographyActivityShape;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET,
                    BpmnDiPackage.BPMN_SHAPE__CHOREOGRAPHY_ACTIVITY_SHAPE,
                    oldChoreographyActivityShape, choreographyActivityShape));
View Full Code Here

Examples of org.eclipse.bpmn2.di.BPMNShape

    List<BPMNDiagram> BPMNDiagramList = definitions.getDiagrams();
    Map<String,List<String>> tmpMap = new HashMap<String,List<String>>();
    for (BPMNDiagram bpmnDiagram : BPMNDiagramList) {
      for (DiagramElement diagramElement : bpmnDiagram.getPlane().getPlaneElement()) {
        if (diagramElement instanceof BPMNShape) {
          BPMNShape bpmnShape = (BPMNShape) diagramElement;
          Map<String, Object>  positionMap=new HashMap<String, Object>();
          BaseElement bpmnElement=getBaseElement(bpmnShape.getBpmnElement());
          if(bpmnElement==null){
            continue;
          }
          //判断如果是折叠起来的子流程,则将其所有的子元素的坐标替换成父元素的
          if(bpmnElement instanceof SubProcess){
            if(bpmnShape.isIsExpanded() == false){
              List<String> excludeNodeIds = null;
              excludeNodeIds = getExcluesElement((SubProcess)bpmnElement);
              tmpMap.put(bpmnElement.getId(), excludeNodeIds);
            }
          }
          float x=bpmnShape.getBounds().getX();
          float y=bpmnShape.getBounds().getY();
          float height=bpmnShape.getBounds().getHeight();
          float width=bpmnShape.getBounds().getWidth();
          //height,width,x,y
          positionMap.put("x",x);
          positionMap.put("y",y);
          positionMap.put("height",height);
          positionMap.put("width",width);
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.