Package org.eclipse.graphiti.mm.pictograms

Examples of org.eclipse.graphiti.mm.pictograms.Shape


    }

    // SHAPE WITH TEXT
    {
      // create shape for text
      final Shape shape = peCreateService.createShape(containerShape, false);

      // create and set text graphics algorithm
      final Text text = gaService.createDefaultText(getDiagram(), shape, addedSubProcess.getName());
      text.setStyle(StyleUtil.getStyleForEvent(getDiagram()));
      text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
View Full Code Here


      // create link and wire it
      link(containerShape, addedEvent);
    }

    {
      final Shape shape = peCreateService.createShape(containerShape, false);
      final Image image = gaService.createImage(shape, PluginImage.IMG_THROW_SIGNAL.getImageKey());
      image.setWidth(20);
      image.setHeight(20);
      gaService.setLocationAndSize(image, (width - 20) / 2, (height - 20) / 2, 20, 20);
    }
View Full Code Here

    return true;
  }

  @Override
  protected void postMoveShape(IMoveShapeContext context) {
    final Shape shape = context.getShape();

    // get the gateway itself to determine its boundary events
    final Gateway gateway = (Gateway) getBusinessObjectForPictogramElement(shape);
   
    Bpmn2MemoryModel model = ModelHandler.getModel(EcoreUtil.getURI(getDiagram()));
View Full Code Here

    }
  }
 
  @Override
  public void preDelete(IDeleteContext context) {
    Shape laneShape = (Shape) context.getPictogramElement();
   
    laneHeight = laneShape.getGraphicsAlgorithm().getHeight();
    laneY = laneShape.getGraphicsAlgorithm().getY();
  }
View Full Code Here

        if (poolRemoveFeature != null) {
          poolRemoveFeature.remove(poolRc);
        }
       
      } else {
        Shape poolShape = (Shape) getFeatureProvider().getPictogramElementForBusinessObject(parentPool);
        ResizeShapeContext resizeContext = new ResizeShapeContext(poolShape);
        resizeContext.setSize(poolShape.getGraphicsAlgorithm().getWidth(), poolShape.getGraphicsAlgorithm().getHeight() - laneHeight);
        resizeContext.setLocation(poolShape.getGraphicsAlgorithm().getX(), poolShape.getGraphicsAlgorithm().getY());
        resizeContext.setDirection(ResizeShapeContext.DIRECTION_NORTH);
        resizeContext.putProperty("org.activiti.designer.lane.create", true);
        getFeatureProvider().getResizeShapeFeature(resizeContext).execute(resizeContext);
      }
     
      for (Lane otherLane : lane.getParentProcess().getLanes()) {
        if(otherLane.equals(lane)) continue;
       
        Shape otherLaneShape = (Shape) getFeatureProvider().getPictogramElementForBusinessObject(otherLane);
        if(otherLaneShape.getGraphicsAlgorithm().getY() > laneY) {
          otherLaneShape.getGraphicsAlgorithm().setY(otherLaneShape.getGraphicsAlgorithm().getY() - laneHeight);
        }
      }
     
      List<FlowElement> toDeleteElements = new ArrayList<FlowElement>();
      for (String flowRef : lane.getFlowReferences()) {
View Full Code Here

      // create link and wire it
      link(containerShape, addedGateway);
    }

    {
      final Shape shape = peCreateService.createShape(containerShape, false);
      final Image image = gaService.createImage(shape, PluginImage.IMG_GATEWAY_EVENT.getImageKey());
      image.setWidth(IMAGE_SIZE);
      image.setHeight(IMAGE_SIZE);

      gaService.setLocationAndSize(image, (width - IMAGE_SIZE) / 2, (height - IMAGE_SIZE) / 2, IMAGE_SIZE, IMAGE_SIZE);
View Full Code Here

    return true;
  }

  @Override
  public void execute(ICustomContext context) {
    Shape element = (Shape) context.getProperty("org.activiti.designer.changetype.pictogram");
    GraphicsAlgorithm elementGraphics = element.getGraphicsAlgorithm();
    int x = elementGraphics.getX();
    int y = elementGraphics.getY();
   
    CreateContext taskContext = new CreateContext();
    ContainerShape targetContainer = (ContainerShape) element.getContainer();
    taskContext.setTargetContainer(targetContainer);
    taskContext.setLocation(x, y);
    taskContext.setHeight(elementGraphics.getHeight());
    taskContext.setWidth(elementGraphics.getWidth());
   
View Full Code Here

    }

    // SHAPE WITH TEXT
    {
      // create shape for text
      final Shape shape = peCreateService.createShape(containerShape, false);

      // create and set text graphics algorithm
      final MultiText text = gaService.createDefaultMultiText(getDiagram(), shape, addedTask.getName());
      text.setStyle(StyleUtil.getStyleForTask(getDiagram()));
      text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
      text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);
      if (OSUtil.getOperatingSystem() == OSEnum.Mac) {
        text.setFont(gaService.manageFont(getDiagram(), text.getFont().getName(), 11));
      }

      switch (baseShape) {
      case ACTIVITY:
        gaService.setLocationAndSize(text, 0, 20, width, height - 25);
        break;
      case GATEWAY:
        gaService.setLocationAndSize(text, 0, height + 5, width, 40);
        break;
      case EVENT:
        gaService.setLocationAndSize(text, 0, height + 5, width, 40);
        break;
      }

      // create link and wire it
      link(shape, addedTask);

      // provide information to support direct-editing directly
      // after object creation (must be activated additionally)
      final IDirectEditingInfo directEditingInfo = getFeatureProvider().getDirectEditingInfo();
      // set container shape for direct editing after object creation
      directEditingInfo.setMainPictogramElement(containerShape);
      // set shape and graphics algorithm where the editor for
      // direct editing shall be opened after object creation
      directEditingInfo.setPictogramElement(shape);
      directEditingInfo.setGraphicsAlgorithm(text);
    }

    {
      final Shape shape = peCreateService.createShape(containerShape, false);
      final Image image = gaService.createImage(shape, getIcon(addedTask));

      switch (baseShape) {
      case ACTIVITY:
        gaService.setLocationAndSize(image, 5, 5, IMAGE_SIZE, IMAGE_SIZE);
View Full Code Here

    }

    // SHAPE WITH TEXT
    {
      // create shape for text
      final Shape shape = peCreateService.createShape(containerShape, false);

      // create and set text graphics algorithm
      final Text text = gaService.createDefaultText(getDiagram(), shape, addedSubProcess.getName());
      text.setStyle(StyleUtil.getStyleForEvent(getDiagram()));
      text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
View Full Code Here

    return true;
  }

  @Override
  protected void postMoveShape(IMoveShapeContext context) {
    final Shape shape = context.getShape();

    // get the event itself to determine its boundary events
    final Event event = (Event) getBusinessObjectForPictogramElement(shape);
   
    Bpmn2MemoryModel model = ModelHandler.getModel(EcoreUtil.getURI(getDiagram()));
View Full Code Here

TOP

Related Classes of org.eclipse.graphiti.mm.pictograms.Shape

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.