Package org.eclipse.graphiti.datatypes

Examples of org.eclipse.graphiti.datatypes.ILocation


    context.setY(mY);

    if (pe instanceof Shape && !(pe instanceof Diagram)) {
      GraphicsAlgorithm ga = pe.getGraphicsAlgorithm();
      if (ga != null) {
        ILocation relLocation = Graphiti.getPeService().getLocationRelativeToDiagram((Shape) pe);
        int x = relLocation.getX();
        int y = relLocation.getY();
        int width = ga.getWidth();
        int height = ga.getHeight();

        if (mX > x && mX < x + width && mY > y && mY < y + height) {
          int relativeX = mX - x;
View Full Code Here


    Bounds bounds = bpmnShape.getBounds();
    int w = (int) bounds.getWidth();
    int h = (int) bounds.getHeight();

    ILocation parentLoc = peService.getLocationRelativeToDiagram(parent);
    int y = (int) bounds.getY() - parentLoc.getY();

    Diagram diagram = peService.getDiagramForPictogramElement(parent);
    RoundedRectangle band = gaService.createRoundedRectangle(bandShape, R, R);
    band.setForeground(gaService.manageColor(diagram, StyleUtil.CLASS_FOREGROUND));
    band.setBackground(initiating ? gaService.manageColor(diagram, IColorConstant.WHITE) : gaService.manageColor(
View Full Code Here

    Bounds bounds = bpmnShape.getBounds();
    int w = (int) bounds.getWidth();
    int h = (int) bounds.getHeight();

    ILocation parentLoc = peService.getLocationRelativeToDiagram(parent);
    int y = (int) bounds.getY() - parentLoc.getY();

    Diagram diagram = peService.getDiagramForPictogramElement(parent);
    Rectangle band = gaService.createRectangle(bandShape);
    band.setForeground(gaService.manageColor(diagram, StyleUtil.CLASS_FOREGROUND));
    band.setBackground(initiating ? gaService.manageColor(diagram, IColorConstant.WHITE) : gaService.manageColor(
View Full Code Here

      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

      Activator.logError(e);
    }
  }

  protected void createDIShape(Shape gShape, BaseElement elem, BPMNShape shape) {
    ILocation loc = Graphiti.getLayoutService().getLocationRelativeToDiagram(gShape);
    if (shape == null) {
      EList<EObject> businessObjects = Graphiti.getLinkService().getLinkForPictogramElement(getDiagram())
          .getBusinessObjects();
      for (EObject eObject : businessObjects) {
        if (eObject instanceof BPMNDiagram) {
          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

                ((SequenceFlow) conElement).getSourceRef()));
            edge.setTargetElement(modelHandler.findDIElement(getDiagram(),
                ((SequenceFlow) conElement).getTargetRef()));
          }

          ILocation sourceLoc = Graphiti.getPeService().getLocationRelativeToDiagram(connection.getStart());
          ILocation targetLoc = Graphiti.getPeService().getLocationRelativeToDiagram(connection.getEnd());

          Point point = DcFactory.eINSTANCE.createPoint();
          point.setX(sourceLoc.getX());
          point.setY(sourceLoc.getY());
          edge.getWaypoint().add(point);

          point = DcFactory.eINSTANCE.createPoint();
          point.setX(targetLoc.getX());
          point.setY(targetLoc.getY());
          edge.getWaypoint().add(point);

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

        if (context.getWidth() == -1 || context.getHeight() == -1) {
          gaService.setLocationAndSize(rect, 15, ga.getWidth() - 1, ga.getHeight() - 15, height);
          // gaService.setLocationAndSize(rect, context.getX(), context.getY(), width, height);
        } else {
          ILayoutService layoutService = Graphiti.getLayoutService();
          ILocation loc = layoutService.getLocationRelativeToDiagram(containerShape);
          int x = context.getX() - loc.getX();
          int y = context.getY() - loc.getY();
          gaService.setLocationAndSize(rect, x - 15, y, ga.getWidth() - 15, height);
        }
      }
      containerShape.setContainer(context.getTargetContainer());
    } else {
View Full Code Here

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

    return map;
  }

  public static Point getCenterPoint(Shape s) {
    GraphicsAlgorithm ga = s.getGraphicsAlgorithm();
    ILocation loc = peService.getLocationRelativeToDiagram(s);
    return gaService.createPoint(loc.getX() + (ga.getWidth() / 2), loc.getY() + (ga.getHeight() / 2));
  }
View Full Code Here

    ContainerShape target = (ContainerShape) Graphiti.getLinkService()
        .getPictogramElements(diagram, edge.getTargetElement()).get(0);
    Connection connection = (Connection) Graphiti.getLinkService().getPictogramElements(diagram, edge).get(0);
    Tuple<FixPointAnchor, FixPointAnchor> anchors = getSourceAndTargetBoundaryAnchors(source, target, connection);

    ILocation loc = peService.getLocationRelativeToDiagram(anchors.getFirst());
    org.eclipse.dd.dc.Point p = edge.getWaypoint().get(0);
    p.setX(loc.getX());
    p.setY(loc.getY());

    loc = peService.getLocationRelativeToDiagram(anchors.getSecond());
    p = edge.getWaypoint().get(edge.getWaypoint().size() - 1);
    p.setX(loc.getX());
    p.setY(loc.getY());

    relocateConnection(source.getAnchors(), anchors, target);
    deleteEmptyAdHocAnchors(source);
    deleteEmptyAdHocAnchors(target);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.graphiti.datatypes.ILocation

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.