Package org.eclipse.graphiti.features.context.impl

Examples of org.eclipse.graphiti.features.context.impl.MoveShapeContext


    new AbstractBoundaryEventOperation() {
      @Override
      protected void doWorkInternal(ContainerShape container) {
        GraphicsAlgorithm ga = container.getGraphicsAlgorithm();

        MoveShapeContext newContext = new MoveShapeContext(container);
        newContext.setDeltaX(context.getDeltaX());
        newContext.setDeltaY(context.getDeltaY());
        newContext.setSourceContainer(context.getSourceContainer());
        newContext.setTargetContainer(context.getTargetContainer());
        newContext.setTargetConnection(context.getTargetConnection());
        newContext.setLocation(ga.getX(), ga.getY());
        newContext.putProperty(ACTIVITY_MOVE_PROPERTY, true);

        IMoveShapeFeature moveFeature = getFeatureProvider().getMoveShapeFeature(newContext);
        if (moveFeature.canMoveShape(newContext)) {
          moveFeature.moveShape(newContext);
        }
View Full Code Here


      ContainerShape parentContainer = (ContainerShape) context.getPictogramElement().eContainer();

      IPeService peService = Graphiti.getPeService();

      ILocation loc = peService.getLocationRelativeToDiagram(taskContainer);
      MoveShapeContext c = (MoveShapeContext) context;
      int eventX = loc.getX() + context.getX();
      int eventY = loc.getY() + context.getY();

      if (!(parentContainer instanceof Diagram)) {
        loc = peService.getLocationRelativeToDiagram(parentContainer);
        eventX = eventX - loc.getX();
        eventY = eventY - loc.getY();
      }

      c.setLocation(eventX, eventY);
      c.setTargetContainer(parentContainer);
    }
  }
View Full Code Here

          x < (parentX + parentWidth - EVENT_MIN_OVERLAP) &&
          (y + EVENT_MAX_OVERLAP) > parentY &&
          y < (parentY + parentHeight - EVENT_MIN_OVERLAP)) {
       
        if(translateNecessary) {
          MoveShapeContext moveContext = ((MoveShapeContext) context);
          moveContext.setX(x);
          moveContext.setY(y);
          moveContext.setDeltaX(0);
          moveContext.setDeltaY(0);
          moveContext.setTargetContainer(context.getSourceContainer());
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.graphiti.features.context.impl.MoveShapeContext

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.