Package org.eclipse.dd.dc

Examples of org.eclipse.dd.dc.Bounds


    return null;
  }

  public static void moveChoreographyMessageLinks(ContainerShape choreographyContainer) {
    BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(choreographyContainer, BPMNShape.class);
    Bounds bounds = bpmnShape.getBounds();
    int x = (int) ((bounds.getX() + bounds.getWidth() / 2) - (ENV_W / 2));

    Map<AnchorLocation, BoundaryAnchor> boundaryAnchors = AnchorUtil.getBoundaryAnchors(choreographyContainer);
    BoundaryAnchor topBoundaryAnchor = boundaryAnchors.get(AnchorLocation.TOP);
    BoundaryAnchor bottomBoundaryAnchor = boundaryAnchors.get(AnchorLocation.BOTTOM);

    for (Connection connection : topBoundaryAnchor.anchor.getOutgoingConnections()) {
      EObject container = connection.getEnd().eContainer();
      if (container instanceof PropertyContainer) {
        String property = peService.getPropertyValue((PropertyContainer) container, MESSAGE_LINK);
        if (property != null && new Boolean(property)) {
          int y = (int) (bounds.getY() - ENVELOPE_HEIGHT_MODIFIER - ENV_H);
          gaService.setLocation(((ContainerShape) container).getGraphicsAlgorithm(), x, y);
          break;
        }
      }
    }

    for (Connection connection : bottomBoundaryAnchor.anchor.getOutgoingConnections()) {
      EObject container = connection.getEnd().eContainer();
      if (container instanceof PropertyContainer) {
        String property = peService.getPropertyValue((PropertyContainer) container, MESSAGE_LINK);
        if (property != null && new Boolean(property)) {
          int y = (int) (bounds.getY() + bounds.getHeight() + ENVELOPE_HEIGHT_MODIFIER);
          gaService.setLocation(((ContainerShape) container).getGraphicsAlgorithm(), x, y);
          break;
        }
      }
    }
View Full Code Here


        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

          BPMNDiagram bpmnDiagram = (BPMNDiagram) eObject;

          shape = BpmnDiFactory.eINSTANCE.createBPMNShape();
//          shape.setId(EcoreUtil.generateUUID());
          shape.setBpmnElement(elem);
          Bounds bounds = DcFactory.eINSTANCE.createBounds();
          if (elem instanceof Activity) {
            bounds.setHeight(gShape.getGraphicsAlgorithm().getHeight());
          } else {
            bounds.setHeight(gShape.getGraphicsAlgorithm().getHeight());
          }
          bounds.setWidth(gShape.getGraphicsAlgorithm().getWidth());
          bounds.setX(loc.getX());
          bounds.setY(loc.getY());
          shape.setBounds(bounds);

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

    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();
    IDimension size = Graphiti.getGaService().calculateSize(graphicsAlgorithm);
    bounds.setHeight(size.getHeight());
    bounds.setWidth(size.getWidth());

    if (element instanceof ContainerShape) {
      EList<Shape> children = ((ContainerShape) element).getChildren();
      for (Shape shape : children) {
        if (shape instanceof ContainerShape) {
View Full Code Here

        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

    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.dd.dc.Bounds

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.