Package org.eclipse.graphiti.mm.pictograms

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


    IPeService peService = Graphiti.getPeService();
    IGaService gaService = Graphiti.getGaService();

    Participant participant = (Participant) BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
        Participant.class);
    ContainerShape containerShape = (ContainerShape) context.getPictogramElement();

    if (participant.getParticipantMultiplicity() != null) {
      Shape shape = peService.createShape(containerShape, false);
      peService.setPropertyValue(shape, MULTIPLICITY_MARKER, Boolean.toString(true));
      Rectangle invisibleRectangle = gaService.createInvisibleRectangle(shape);
      GraphicsAlgorithm parentGa = containerShape.getGraphicsAlgorithm();
      int x = (parentGa.getWidth() / 2) - 10;
      int y = parentGa.getHeight() - 20;
      gaService.setLocationAndSize(invisibleRectangle, x, y, 20, 20);

      Polyline line1 = gaService.createPolyline(invisibleRectangle, new int[] { 0, 0, 0, 20 });
View Full Code Here


    int width = GraphicsUtil.DATA_WIDTH;
    int height = GraphicsUtil.DATA_HEIGHT;
    int e = 10;
    int textArea = 15;
   
    ContainerShape container = peService.createContainerShape(context.getTargetContainer(), true);
    Rectangle invisibleRect = gaService.createInvisibleRectangle(container);
    gaService.setLocationAndSize(invisibleRect, context.getX(), context.getY(), width, height + textArea);

    Shape rectShape = peService.createShape(container, false);
    Polygon rect = gaService.createPolygon(rectShape, new int[] { 0, 0, width - e, 0, width, e, width, height, 0,
View Full Code Here

    IPeService peService = Graphiti.getPeService();

    int d = 2 * GraphicsUtil.GATEWAY_RADIUS;
    int p = GraphicsUtil.GATEWAY_TEXT_AREA;

    ContainerShape containerShape = peService.createContainerShape(context.getTargetContainer(), true);
    Rectangle rect = gaService.createInvisibleRectangle(containerShape);
    gaService.setLocationAndSize(rect, context.getX(), context.getY(), d, d + p);

    Shape gatewayShape = peService.createShape(containerShape, false);
    Polygon gateway = GraphicsUtil.createGateway(gatewayShape);
View Full Code Here

    return BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(), ChoreographyActivity.class) != null;
  }

  @Override
  public boolean layout(ILayoutContext context) {
    ContainerShape choreographyContainer = (ContainerShape) context.getPictogramElement();
    GraphicsAlgorithm parentGa = choreographyContainer.getGraphicsAlgorithm();

    int newWidth = parentGa.getWidth();
    int newHeight = parentGa.getHeight();

    for (Shape s : peService.getAllContainedShapes(choreographyContainer)) {
View Full Code Here

    Conversation c = (Conversation) context.getNewObject();

    int w = context.getWidth() > 0 ? context.getWidth() : 30;
    int h = context.getHeight() > 0 ? context.getHeight() : 30;

    ContainerShape containerShape = peService.createContainerShape(context.getTargetContainer(), true);
    Rectangle rect = gaService.createInvisibleRectangle(containerShape);
    gaService.setLocationAndSize(rect, context.getX(), context.getY(), w, h);

    int w_5th = w / 5;
    int[] xy = { w_5th, 0, w_5th * 4, 0, w, h / 2, w_5th * 4, h, w_5th, h, 0, h / 2 };
View Full Code Here

      sourceLane.setChildLaneSet(null);
    }
  }

  private Lane getTargetLane(ITargetContext context) {
    ContainerShape targetContainer = context.getTargetContainer();
    return (Lane) getBusinessObjectForPictogramElement(targetContainer);
  }
View Full Code Here

    ContainerShape targetContainer = context.getTargetContainer();
    return (Lane) getBusinessObjectForPictogramElement(targetContainer);
  }

  private Lane getSourceLane(IMoveShapeContext context) {
    ContainerShape sourceContainer = context.getSourceContainer();
    return (Lane) getBusinessObjectForPictogramElement(sourceContainer);
  }
View Full Code Here

  @Override
  public PictogramElement add(IAddContext context) {
    TextAnnotation annotation = (TextAnnotation) context.getNewObject();

    IPeCreateService peCreateService = Graphiti.getPeCreateService();
    ContainerShape containerShape = peCreateService.createContainerShape(context.getTargetContainer(), true);

    IGaService gaService = Graphiti.getGaService();

    int width = context.getWidth() > 0 ? context.getWidth() : 50;
    int height = context.getHeight() > 0 ? context.getHeight() : 100;
View Full Code Here

    IPeService peService = Graphiti.getPeService();
    Collection<PictogramElement> elements = peService.getAllContainedPictogramElements(diagram);
    for (PictogramElement e : elements) {
      BoundaryEvent boundaryEvent = BusinessObjectUtil.getFirstElementOfType(e, BoundaryEvent.class);
      if (boundaryEvent != null && activity.getBoundaryEventRefs().contains(boundaryEvent)) {
        ContainerShape container = (ContainerShape) e;
        doWorkInternal(container);
      }
    }
  }
View Full Code Here

  @Override
  public PictogramElement add(IAddContext context) {
    Event e = (Event) context.getNewObject();

    IPeService peService = Graphiti.getPeService();
    ContainerShape containerShape = peService.createContainerShape(context.getTargetContainer(), true);

    IGaService gaService = Graphiti.getGaService();

    Rectangle invisibleRect = gaService.createInvisibleRectangle(containerShape);
    gaService.setLocationAndSize(invisibleRect, context.getX(), context.getY(), EVENT_SIZE, EVENT_SIZE
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.