Package org.eclipse.graphiti.mm.pictograms

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


    return true;
  }

  @Override
  protected void postMoveShape(IMoveShapeContext context) {
    ContainerShape containerShape = (ContainerShape) context.getPictogramElement();

    Object property = context.getProperty("activity.move");
    if (property != null && (Boolean) property) {
      IGaService gaService = Graphiti.getGaService();
      GraphicsAlgorithm ga = containerShape.getGraphicsAlgorithm();
      gaService.setLocation(ga, ga.getX() + context.getDeltaX(), ga.getY() + context.getDeltaY());
    } else {
      BoundaryEvent event = BusinessObjectUtil.getFirstElementOfType(containerShape, BoundaryEvent.class);
      PictogramElement activityContainer = BusinessObjectUtil.getFirstBaseElementFromDiagram(getDiagram(),
          event.getAttachedToRef());
View Full Code Here


  }

  @Override
  public PictogramElement add(IAddContext context) {
    final Event addedEvent = (Event) context.getNewObject();
    final ContainerShape parent = context.getTargetContainer();

    // CONTAINER SHAPE WITH CIRCLE
    final IPeCreateService peCreateService = Graphiti.getPeCreateService();
    final ContainerShape containerShape = peCreateService.createContainerShape(parent, true);

    // check whether the context has a size (e.g. from a create feature)
    // otherwise define a default size for the shape
    final int width = context.getWidth() <= 0 ? 35 : context.getWidth();
    final int height = context.getHeight() <= 0 ? 35 : context.getHeight();
View Full Code Here

   
    association.setId(getNextId());
    association.setSourceRef(sourceBo.getId());
    association.setTargetRef(targetBo.getId());
   
    final ContainerShape targetContainer = (ContainerShape) context.getSourcePictogramElement();
    final ContainerShape parentContainer = targetContainer.getContainer();
   
    if (parentContainer instanceof Diagram) {
      final Bpmn2MemoryModel model = ModelHandler.getModel(EcoreUtil.getURI(getDiagram()));
      if (model.getBpmnModel().getPools().size() > 0) {
        String poolRef = model.getBpmnModel().getPools().get(0).getId();
View Full Code Here

      sequenceFlow.setName(String.format("to %s", target.getName()));
    } else {
      sequenceFlow.setName("");
    }

    ContainerShape targetContainer = null;
    if (source instanceof BoundaryEvent) {
      BoundaryEvent boundaryEvent = (BoundaryEvent) source;
      if (boundaryEvent.getAttachedToRef() != null) {
        Activity attachedActivity = boundaryEvent.getAttachedToRef();
        targetContainer = (ContainerShape) getFeatureProvider().getPictogramElementForBusinessObject(attachedActivity);
      }
    } else {
      targetContainer = (ContainerShape) context.getSourcePictogramElement();
    }
     
    ContainerShape parentContainer = targetContainer.getContainer();
    if (parentContainer instanceof Diagram) {
      ModelHandler.getModel(EcoreUtil.getURI(getDiagram())).getBpmnModel().getMainProcess().addFlowElement(sequenceFlow);

    } else {
      Object parentObject = getBusinessObjectForPictogramElement(parentContainer);
View Full Code Here

  @Override
  public PictogramElement add(IAddContext context) {

    final SubProcess addedSubProcess = (SubProcess) context.getNewObject();
    final ContainerShape parent = context.getTargetContainer();

    // CONTAINER SHAPE WITH ROUNDED RECTANGLE
    final IPeCreateService peCreateService = Graphiti.getPeCreateService();
    final ContainerShape containerShape = peCreateService.createContainerShape(parent, true);

    // EList<Property> props = containerShape.getProperties();

    // check whether the context has a size (e.g. from a create feature)
    // otherwise define a default size for the shape
View Full Code Here

      }
     
      if(found == false) {
       
        FlowNode sourceFlowNode = (FlowNode) model.getBpmnModel().getFlowElement(flow.getSourceRef());
        ContainerShape sourceElement = (ContainerShape) getFeatureProvider().getPictogramElementForBusinessObject(sourceFlowNode);
        ContainerShape oldParentContainer = sourceElement.getContainer();
        ContainerShape newParentContainer = ((ContainerShape) context.getTargetPictogramElement()).getContainer();
       
        if (oldParentContainer != newParentContainer) {
         
          if (oldParentContainer instanceof Diagram) {
            ModelHandler.getModel(EcoreUtil.getURI(getDiagram())).getBpmnModel().getMainProcess().removeFlowElement(flow.getId());
View Full Code Here

    return bo instanceof TextAnnotation;
  }

  @Override
  public boolean layout(ILayoutContext context) {
    final ContainerShape containerShape = (ContainerShape) context.getPictogramElement();
    final GraphicsAlgorithm ga = containerShape.getGraphicsAlgorithm();
    final IGaService gaService = Graphiti.getGaService();
   
    boolean changed = false;
   
    if (ga.getWidth() < 100) {
      // we deny anything smaller than 100 pixels width
      ga.setWidth(100);
     
      changed = true;
    }
   
    if (ga.getHeight() < 50) {
      // we deny anything smaller than 50 pixels height
      ga.setHeight(50);
     
      changed = true;
    }
   
    int containerWidth = ga.getWidth();
    int containerHeight = ga.getHeight();
   
    for (final Shape shape : containerShape.getChildren()) {
      final GraphicsAlgorithm shapeGa = shape.getGraphicsAlgorithm();
      final IDimension size = gaService.calculateSize(shapeGa);
     
      if (containerWidth != size.getWidth() && shapeGa instanceof MultiText) {
        gaService.setWidth(shapeGa, containerWidth - 5);
View Full Code Here

  }

  @Override
  public PictogramElement add(IAddContext context) {
    final Event addedEvent = (Event) context.getNewObject();
    final ContainerShape parent = context.getTargetContainer();

    // CONTAINER SHAPE WITH CIRCLE
    final IPeCreateService peCreateService = Graphiti.getPeCreateService();
    final ContainerShape containerShape = peCreateService.createContainerShape(parent, true);

    // check whether the context has a size (e.g. from a create feature)
    // otherwise define a default size for the shape
    final int width = context.getWidth() <= 0 ? 35 : context.getWidth();
    final int height = context.getHeight() <= 0 ? 35 : context.getHeight();
View Full Code Here

  }

  @Override
  public PictogramElement add(IAddContext context) {
    final Event addedEvent = (Event) context.getNewObject();
    final ContainerShape parent = context.getTargetContainer();

    // CONTAINER SHAPE WITH CIRCLE
    final IPeCreateService peCreateService = Graphiti.getPeCreateService();
    final ContainerShape containerShape = peCreateService.createContainerShape(parent, true);

    // check whether the context has a size (e.g. from a create feature)
    // otherwise define a default size for the shape
    final int width = context.getWidth() <= 0 ? 35 : context.getWidth();
    final int height = context.getHeight() <= 0 ? 35 : context.getHeight();
View Full Code Here

  }

  @Override
  public PictogramElement add(IAddContext context) {
    final Gateway addedGateway = (Gateway) context.getNewObject();
    final ContainerShape parent = context.getTargetContainer();

    // CONTAINER SHAPE WITH CIRCLE
    final IPeCreateService peCreateService = Graphiti.getPeCreateService();
    final ContainerShape containerShape = peCreateService.createContainerShape(parent, true);

    // check whether the context has a size (e.g. from a create feature)
    // otherwise define a default size for the shape
    final int width = context.getWidth() <= 0 ? 40 : context.getWidth();
    final int height = context.getHeight() <= 0 ? 40 : context.getHeight();
View Full Code Here

TOP

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

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.