Package org.eclipse.bpmn2.di

Examples of org.eclipse.bpmn2.di.BPMNShape


      Participant participant = BusinessObjectUtil.getFirstElementOfType(s, Participant.class);
      if (participant != null) {
        ContainerShape container = (ContainerShape) s;
        GraphicsAlgorithm ga = container.getGraphicsAlgorithm();

        BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(s, BPMNShape.class);
        ILocation loc = Graphiti.getLayoutService().getLocationRelativeToDiagram(context.getShape());

        Bounds bounds = bpmnShape.getBounds();
        bounds.setX(loc.getX() + ga.getX());
        bounds.setY(loc.getY() + ga.getY());
      }
    }
    ChoreographyUtil.moveChoreographyMessageLinks((ContainerShape) context.getPictogramElement());
View Full Code Here


    }

    List<Participant> participants = choreography.getParticipantRefs();
    List<BPMNShape> shapes = mh.getAll(BPMNShape.class);
    List<BPMNShape> filteredShapes = new ArrayList<BPMNShape>();
    BPMNShape choreoBpmnShape = null;

    for (BPMNShape shape : shapes) {
      if (shape.getBpmnElement().equals(choreography)) {
        choreoBpmnShape = shape;
        break;
      }
    }

    for (BPMNShape shape : shapes) {
      if (participants.contains(shape.getBpmnElement())
          && choreoBpmnShape.equals(shape.getChoreographyActivityShape())) {
        filteredShapes.add(shape);
      }
    }

    for (BPMNShape bpmnShape : filteredShapes) {
View Full Code Here

          List<ContainerShape> affectedBands = anchor.locationType == AnchorLocation.BOTTOM ? topAndBottomBands
              .getFirst() : topAndBottomBands.getSecond();

          for (ContainerShape bottomBand : affectedBands) {
            BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(bottomBand, BPMNShape.class);
            bpmnShape.setIsMessageVisible(false);
          }

          break;
        }
      }
View Full Code Here

      sources.add(message.getSourceRef());
    }

    for (ContainerShape band : ChoreographyUtil.getParticipantBandContainerShapes(choreographyContainer)) {
      Participant participant = BusinessObjectUtil.getFirstElementOfType(band, Participant.class);
      BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(band, BPMNShape.class);
      if (!sources.contains(participant) && bpmnShape.isIsMessageVisible()) {
        bpmnShape.setIsMessageVisible(false);
        peService.setPropertyValue(context.getPictogramElement(), MESSAGE_VISIBLE, Boolean.toString(false));
      } else if (sources.contains(participant) && !bpmnShape.isIsMessageVisible()) {
        bpmnShape.setIsMessageVisible(true);
        peService.setPropertyValue(context.getPictogramElement(), MESSAGE_VISIBLE, Boolean.toString(true));
      }
    }

    ChoreographyUtil.drawMessageLinks(choreographyContainer);
View Full Code Here

    super(fp);
  }

  protected void createDIShape(Shape gShape, BaseElement elem) {
    try {
      BPMNShape shape = (BPMNShape) ModelHandlerLocator.getModelHandler(getDiagram().eResource()).findDIElement(
          getDiagram(), elem);
      createDIShape(gShape, elem, shape);
    } catch (IOException e) {
      Activator.logError(e);
    }
View Full Code Here

    PictogramElement foundElem = null;

    IPeService peService = Graphiti.getPeService();
    Collection<PictogramElement> elements = peService.getAllContainedPictogramElements(diagram);
    for (PictogramElement pe : elements) {
      BPMNShape s = getFirstElementOfType(pe, BPMNShape.class);
      if (s != null && s.equals(bpmnShape)) {
        foundElem = pe;
        break;
      }
    }
View Full Code Here

      Shape shape = (Shape) context.getPictogramElement();
      AnchorUtil.relocateFixPointAnchors(shape, context.getWidth(), context.getHeight());
      Object[] node = getAllBusinessObjectsForPictogramElement(context.getShape());
      for (Object object : node) {
        if (object instanceof BPMNShape) {
          BPMNShape s = (BPMNShape) object;
          AnchorUtil.reConnect(s, getDiagram());
        }
      }
    }
    DIUtils.updateDIShape(context.getPictogramElement());
View Full Code Here

    PictogramLink link = element.getLink();
    if (link == null) {
      return;
    }

    BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(element, BPMNShape.class);
    if (bpmnShape == null) {
      return;
    }

    ILocation loc = Graphiti.getLayoutService().getLocationRelativeToDiagram((Shape) element);
    Bounds bounds = bpmnShape.getBounds();

    bounds.setX(loc.getX());
    bounds.setY(loc.getY());

    GraphicsAlgorithm graphicsAlgorithm = element.getGraphicsAlgorithm();
View Full Code Here

  public static BPMNShape createDIShape(Shape shape, BaseElement elem, int x, int y, int w, int h,
      IFeatureProvider fp, Diagram diagram) {

    EList<EObject> businessObjects = Graphiti.getLinkService().getLinkForPictogramElement(diagram)
        .getBusinessObjects();
    BPMNShape bpmnShape = null;

    for (EObject eObject : businessObjects) {
      if (eObject instanceof BPMNDiagram) {
        BPMNDiagram bpmnDiagram = (BPMNDiagram) eObject;

        bpmnShape = BpmnDiFactory.eINSTANCE.createBPMNShape();
//        bpmnShape.setId(EcoreUtil.generateUUID());
        bpmnShape.setBpmnElement(elem);
        Bounds bounds = DcFactory.eINSTANCE.createBounds();
        bounds.setX(x);
        bounds.setY(y);
        bounds.setWidth(w);
        bounds.setHeight(h);
        bpmnShape.setBounds(bounds);

        List<DiagramElement> elements = bpmnDiagram.getPlane().getPlaneElement();
        elements.add(bpmnShape);
        ModelUtil.setID(shape);
View Full Code Here

            activityLoc.getY(), activityGa.getWidth(), activityGa.getHeight());
    return pos.isLegalPosition();
  }

  public static PositionOnLine getPositionOnLineUsingBPMNShape(Shape eventShape, Shape activityShape) {
    BPMNShape event = BusinessObjectUtil.getFirstElementOfType(eventShape, BPMNShape.class);
    Bounds eventBounds = event.getBounds();
    BPMNShape activity = BusinessObjectUtil.getFirstElementOfType(activityShape, BPMNShape.class);
    Bounds activityBounds = activity.getBounds();

    return getPositionOnLine((int) eventBounds.getX(), (int) eventBounds.getY(), (int) eventBounds.getWidth(),
            (int) eventBounds.getHeight(), (int) activityBounds.getX(), (int) activityBounds.getY(),
            (int) activityBounds.getWidth(), (int) activityBounds.getHeight());
  }
View Full Code Here

TOP

Related Classes of org.eclipse.bpmn2.di.BPMNShape

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.