Package org.eclipse.graphiti.mm.algorithms

Examples of org.eclipse.graphiti.mm.algorithms.Ellipse


    gaService.setLocationAndSize(invisibleRect, context.getX(), context.getY(), EVENT_SIZE, EVENT_SIZE
            + EVENT_TEXT_AREA);

    Shape ellipseShape = peService.createShape(containerShape, false);
    peService.setPropertyValue(ellipseShape, EVENT_ELEMENT, EVENT_CIRCLE);
    Ellipse ellipse = createEventShape(ellipseShape);
    StyleUtil.applyBGStyle(ellipse, this);
    decorateEllipse(ellipse);

    Shape textShape = peService.createShape(containerShape, false);
    peService.setPropertyValue(textShape, UpdateBaseElementNameFeature.TEXT_ELEMENT, Boolean.toString(true));
View Full Code Here


    boolean importing = prop != null && (Boolean) prop;
    ContainerShape target = importing ? context.getTargetContainer() : (ContainerShape) context
            .getTargetContainer().eContainer();

    ContainerShape containerShape = peService.createContainerShape(target, true);
    Ellipse ellipse = gaService.createEllipse(containerShape);
    StyleUtil.applyBGStyle(ellipse, this);

    if (importing) { // if loading from DI then place according to context
      gaService.setLocationAndSize(ellipse, context.getX(), context.getY(), EVENT_SIZE, EVENT_SIZE);
    } else { // otherwise place it in the center of shape for user to adjust it
      GraphicsAlgorithm ga = context.getTargetContainer().getGraphicsAlgorithm();
      int x = ga.getX() + context.getX() - (EVENT_SIZE / 2);
      int y = ga.getY() + context.getY() - (EVENT_SIZE / 2);
      gaService.setLocationAndSize(ellipse, x, y, EVENT_SIZE, EVENT_SIZE);
    }

    Ellipse circle = GraphicsUtil.createIntermediateEventCircle(ellipse);
    circle.setStyle(StyleUtil.getStyleForClass(getDiagram()));
    createDIShape(containerShape, event);

    ChopboxAnchor anchor = peService.createChopboxAnchor(containerShape);
    anchor.setReferencedGraphicsAlgorithm(ellipse);
    AnchorUtil.addFixedPointAnchors(containerShape, ellipse);
View Full Code Here

  }

  @Override
  protected Shape drawForEnd(DecorationAlgorithm algorithm, ContainerShape shape) {
    Shape terminateShape = Graphiti.getPeService().createShape(shape, false);
    Ellipse ellispe = GraphicsUtil.createEventTerminate(terminateShape);
    ellispe.setForeground(algorithm.manageColor(StyleUtil.CLASS_FOREGROUND));
    ellispe.setBackground(algorithm.manageColor(StyleUtil.CLASS_FOREGROUND));
    return terminateShape;
  }
View Full Code Here

  @Override
  public IAddFeature getAddFeature(IFeatureProvider fp) {
    return new AddEventFeature(fp) {
      @Override
      protected void decorateEllipse(Ellipse e) {
        Ellipse circle = GraphicsUtil.createIntermediateEventCircle(e);
        circle.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
      }
    };
  }
View Full Code Here

  @Override
  public IAddFeature getAddFeature(IFeatureProvider fp) {
    return new AddEventFeature(fp) {
      @Override
      protected void decorateEllipse(Ellipse e) {
        Ellipse circle = GraphicsUtil.createIntermediateEventCircle(e);
        circle.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
      }
    };
  }
View Full Code Here

        polyline.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
        polyline.setBackground(manageColor(IColorConstant.WHITE));
        polyline.setFilled(true);
        polyline.setLineWidth(1);

        Ellipse ellipse = gaService.createEllipse(startDecorator);
        ellipse.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
        ellipse.setBackground(manageColor(IColorConstant.WHITE));
        ellipse.setFilled(true);
        ellipse.setLineWidth(1);
        gaService.setSize(ellipse, 10, 10);
      }

      @Override
      protected Class<? extends BaseElement> getBoClass() {
View Full Code Here

    public boolean update(IUpdateContext context) {
      IPeService peService = Graphiti.getPeService();
      ContainerShape container = (ContainerShape) context.getPictogramElement();
      StartEvent event = (StartEvent) getBusinessObjectForPictogramElement(container);

      Ellipse ellipse = (Ellipse) peService.getAllContainedShapes(container).iterator().next()
          .getGraphicsAlgorithm();
      LineStyle style = event.isIsInterrupting() ? LineStyle.SOLID : LineStyle.DASH;
      ellipse.setLineStyle(style);

      peService.setPropertyValue(container, INTERRUPTING, Boolean.toString(event.isIsInterrupting()));
      return true;
    }
View Full Code Here

    BoundaryEvent event = (BoundaryEvent) getBusinessObjectForPictogramElement(context.getPictogramElement());

    Graphiti.getPeService().setPropertyValue(context.getPictogramElement(), BOUNDARY_EVENT_CANCEL,
            Boolean.toString(event.isCancelActivity()));

    Ellipse ellipse = (Ellipse) context.getPictogramElement().getGraphicsAlgorithm();
    Ellipse innerEllipse = (Ellipse) ellipse.getGraphicsAlgorithmChildren().get(0);
    LineStyle lineStyle = event.isCancelActivity() ? LineStyle.SOLID : LineStyle.DASH;

    ellipse.setLineStyle(lineStyle);
    innerEllipse.setLineStyle(lineStyle);

    return true;
  }
View Full Code Here

    final int width = context.getWidth() <= 0 ? 35 : context.getWidth();
    final int height = context.getHeight() <= 0 ? 35 : context.getHeight();

    final IGaService gaService = Graphiti.getGaService();

    Ellipse circle;
    {
      final Ellipse invisibleCircle = gaService.createEllipse(containerShape);
      invisibleCircle.setFilled(false);
      invisibleCircle.setLineVisible(false);
      gaService.setLocationAndSize(invisibleCircle, context.getX(), context.getY(), width, height);

      // create and set visible circle inside invisible circle
      circle = gaService.createEllipse(invisibleCircle);
      circle.setParentGraphicsAlgorithm(invisibleCircle);
      circle.setStyle(StyleUtil.getStyleForEvent(getDiagram()));
      gaService.setLocationAndSize(circle, 0, 0, width, height);

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

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

    // add a chopbox anchor to the shape
    peCreateService.createChopboxAnchor(containerShape);
    if (!(addedEvent instanceof EndEvent)) {

      // create an additional box relative anchor at middle-right
      final BoxRelativeAnchor boxAnchor = peCreateService.createBoxRelativeAnchor(containerShape);
      boxAnchor.setRelativeWidth(1.0);
      boxAnchor.setRelativeHeight(0.51);
      boxAnchor.setReferencedGraphicsAlgorithm(circle);
      final Ellipse ellipse = ActivitiUiUtil.createInvisibleEllipse(boxAnchor, gaService);
      gaService.setLocationAndSize(ellipse, 0, 0, 0, 0);
    }
    layoutPictogramElement(containerShape);

    return containerShape;
View Full Code Here

    final BoxRelativeAnchor boxAnchor = peCreateService.createBoxRelativeAnchor(containerShape);
    boxAnchor.setRelativeWidth(1.0);
    boxAnchor.setRelativeHeight(0.51);
    boxAnchor.setReferencedGraphicsAlgorithm(roundedRectangle);
    final Ellipse ellipse = ActivitiUiUtil.createInvisibleEllipse(boxAnchor, gaService);
    gaService.setLocationAndSize(ellipse, 0, 0, 0, 0);
    layoutPictogramElement(containerShape);

    return containerShape;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.graphiti.mm.algorithms.Ellipse

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.