Package org.eclipse.graphiti.mm.pictograms

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


    @Override
    public IReason updateNeeded(IUpdateContext context) {
      IFeatureProvider featureProvider = getDiagramEditor().getDiagramTypeProvider().getFeatureProvider();

      ContainerShape gatewayShape = (ContainerShape) context.getPictogramElement();
      for (Anchor anchor : gatewayShape.getAnchors()) {
        for (Connection connection : anchor.getIncomingConnections() ) {
          IUpdateContext updateCtx = new UpdateContext(connection);
          IUpdateFeature updateFeature = featureProvider.getUpdateFeature(updateCtx);
          if (updateFeature != null) {
            IReason ret = updateFeature.updateNeeded(updateCtx);
View Full Code Here


    @Override
    public boolean update(IUpdateContext context) {
      IFeatureProvider featureProvider = getDiagramEditor().getDiagramTypeProvider().getFeatureProvider();

      ContainerShape gatewayShape = (ContainerShape) context.getPictogramElement();
      for (Anchor anchor : gatewayShape.getAnchors()) {
        for (Connection connection : anchor.getIncomingConnections() ) {
          IUpdateContext updateCtx = new UpdateContext(connection);
          IUpdateFeature updateFeature = featureProvider.getUpdateFeature(updateCtx);
          if (updateFeature != null) {
            updateFeature.update(updateCtx);
View Full Code Here

    }

    @Override
    public IReason updateNeeded(IUpdateContext context) {
      IPeService peService = Graphiti.getPeService();
      ContainerShape container = (ContainerShape) context.getPictogramElement();
      DataObject data = (DataObject) getBusinessObjectForPictogramElement(container);
      boolean isCollection = Boolean.parseBoolean(peService.getPropertyValue(container,
          Properties.COLLECTION_PROPERTY));
      return data.isIsCollection() != isCollection ? Reason.createTrueReason() : Reason.createFalseReason();
    }
View Full Code Here

    }

    @Override
    public boolean update(IUpdateContext context) {
      IPeService peService = Graphiti.getPeService();
      ContainerShape container = (ContainerShape) context.getPictogramElement();
      DataObject data = (DataObject) getBusinessObjectForPictogramElement(container);

      boolean drawCollectionMarker = data.isIsCollection();

      Iterator<Shape> iterator = peService.getAllContainedShapes(container).iterator();
View Full Code Here

        ChoreographyActivity.class);

    BPMNDiagram dia = BusinessObjectUtil.getFirstElementOfType(diagram, BPMNDiagram.class);
    List<DiagramElement> diElements = dia.getPlane().getPlaneElement();
    for (int i = 0; i < currentParticipantContainers.size(); i++) {
      ContainerShape container = currentParticipantContainers.get(i);
      for (Connection c : peService.getOutgoingConnections(container)) {
        EObject parent = c.getEnd().eContainer();
        if (parent instanceof PictogramElement) {
          peService.deletePictogramElement((PictogramElement) parent);
        }
      }
      BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(container, BPMNShape.class);
      diElements.remove(bpmnShape);
      peService.deletePictogramElement(container);
    }

    GraphicsAlgorithm ga = choreographyContainer.getGraphicsAlgorithm();
    IDimension size = gaService.calculateSize(ga);

    List<ContainerShape> newContainers = new ArrayList<ContainerShape>();
    int y = 0;
    boolean first = true;

    List<InteractionNode> sources = new ArrayList<InteractionNode>();
    if (choreography instanceof ChoreographyTask) {
      for (MessageFlow message : ((ChoreographyTask) choreography).getMessageFlowRef()) {
        sources.add(message.getSourceRef());
      }
    }

    Iterator<Participant> iterator = newParticipants.iterator();
    while (iterator.hasNext()) {
      Participant participant = iterator.next();

      ContainerShape bandShape = peService.createContainerShape(choreographyContainer, true);

      ParticipantBandKind bandKind = getNewParticipantBandKind(choreography, participant, first,
          !iterator.hasNext());

      boolean multiple = participant.getParticipantMultiplicity() != null
View Full Code Here

    Polyline connectionLine = gaService.createPolyline(connection);
    connectionLine.setForeground(gaService.manageColor(diagram, StyleUtil.CLASS_FOREGROUND));
    connectionLine.setLineStyle(LineStyle.DOT);
    connectionLine.setLineWidth(2);

    ContainerShape envelope = peService.createContainerShape(diagram, true);
    Rectangle invisibleRectangle = gaService.createInvisibleRectangle(envelope);
    gaService.setLocation(invisibleRectangle, x, y);
    gaService.setSize(invisibleRectangle, ENV_W + 50, ENV_H);

    Shape envelopeShape = peService.createShape(envelope, false);
View Full Code Here

      }
    }

    Iterator<ContainerShape> iterator = bandContainers.iterator();
    while (iterator.hasNext()) {
      ContainerShape bandContainer = iterator.next();
      BPMNShape bpmnShape = BusinessObjectUtil.getFirstElementOfType(bandContainer, BPMNShape.class);
      if (bpmnShape.isIsMessageVisible()) {
        shapesWithVisileMessages.add(bandContainer);
      }
    }
View Full Code Here

    }
    return filled;
  }

  private static void setMessageLabel(String label, PictogramElement message) {
    ContainerShape containerShape = (ContainerShape) message;
    Iterator<Shape> iterator = peService.getAllContainedShapes(containerShape).iterator();
    while (iterator.hasNext()) {
      Shape shape = iterator.next();
      if (shape.getGraphicsAlgorithm() instanceof Text) {
        Text text = (Text) shape.getGraphicsAlgorithm();
        text.setValue(label);
        IDimension size = GraphitiUi.getUiLayoutService().calculateTextSize(label, text.getFont());
        gaService.setSize(containerShape.getGraphicsAlgorithm(), ENV_W + size.getWidth() + 3, ENV_H);
        gaService.setSize(text, size.getWidth(), size.getHeight());
        break;
      }
    }
  }
View Full Code Here

        int width = context.getWidth() > 0 ? context.getWidth() : 30;
        int height = context.getHeight() > 0 ? context.getHeight() : 20;
        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);

        Envelope envelope = GraphicsUtil.createEnvelope(invisibleRect, 0, 0, width, height);
        envelope.rect.setFilled(true);
View Full Code Here

    IPeService peService = Graphiti.getPeService();

    int width = context.getWidth() > 0 ? context.getWidth() : getWidth();
    int height = context.getHeight() > 0 ? context.getHeight() : getHeight();

    ContainerShape containerShape = peService.createContainerShape(context.getTargetContainer(), true);
    Rectangle invisibleRect = gaService.createInvisibleRectangle(containerShape);
    gaService.setLocationAndSize(invisibleRect, context.getX(), context.getY(), width, height);

    Shape rectShape = peService.createShape(containerShape, false);
    RoundedRectangle rect = gaService.createRoundedRectangle(rectShape, 5, 5);
    StyleUtil.applyBGStyle(rect, this);
    gaService.setLocationAndSize(rect, 0, 0, width, height);
    link(rectShape, activity);
    decorateActivityRectangle(rect);
    peService.setPropertyValue(rectShape, "activity", Boolean.toString(true));

    ContainerShape markerContainer = peService.createContainerShape(containerShape, false);
    Rectangle markerInvisibleRect = gaService.createInvisibleRectangle(markerContainer);
    int h = 10;
    int y = height - h - 3 - getMarkerContainerOffset();
    gaService.setLocationAndSize(markerInvisibleRect, 0, y, invisibleRect.getWidth(), h);
    peService.setPropertyValue(markerContainer, GraphicsUtil.ACTIVITY_MARKER_CONTAINER, Boolean.toString(true));
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.