Package org.eclipse.graphiti.mm.pictograms

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


    Rectangle invisibleRect = gaService.createInvisibleRectangle(containerShape);
    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));
    Text text = gaService.createDefaultText(getDiagram(), textShape, e.getName());
    text.setStyle(StyleUtil.getStyleForText(getDiagram()));
    text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
    text.setVerticalAlignment(Orientation.ALIGNMENT_TOP);
View Full Code Here


      containerShape.setContainer(context.getTargetContainer());
    } else {
      gaService.setLocationAndSize(rect, context.getX(), context.getY(), width, height);
    }

    Shape textShape = peCreateService.createShape(containerShape, false);
    Text text = gaService.createText(textShape, lane.getName());
    text.setStyle(StyleUtil.getStyleForText(getDiagram()));
    text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);
    text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
    text.setAngle(-90);
View Full Code Here

    DIUtils.updateDIShape(containerShape);

    Iterator<Shape> iterator = containerShape.getChildren().iterator();
    while (iterator.hasNext()) {
      Shape shape = iterator.next();
      GraphicsAlgorithm shapeGa = shape.getGraphicsAlgorithm();
      IDimension size = gaService.calculateSize(shapeGa);
      if (containerWidth != size.getWidth() && shapeGa instanceof MultiText) {
        gaService.setWidth(shapeGa, containerWidth - 5);
        changed = true;
      }
View Full Code Here

    Activity activity = (Activity) getBusinessObjectForPictogramElement(context.getPictogramElement());

    ContainerShape markerContainer = null;
    Iterator<Shape> iterator = peService.getAllContainedShapes(container).iterator();
    while (iterator.hasNext()) {
      Shape shape = (Shape) iterator.next();
      String property = peService.getPropertyValue(shape, GraphicsUtil.ACTIVITY_MARKER_CONTAINER);
      if(property != null && new Boolean(property)) {
        markerContainer = (ContainerShape) shape;
        break;
      }
View Full Code Here

    BaseElement element = (BaseElement) BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
            BaseElement.class);

    String elementName = ModelUtil.getName(element);
    Shape textShape = getChildElementOfType(container, TEXT_ELEMENT, Boolean.toString(true), Shape.class);
    if (textShape!=null) {
      String name = ((Text) textShape.getGraphicsAlgorithm()).getValue();
 
      if (elementName != null) {
        return elementName.equals(name) ? Reason.createFalseReason() : Reason.createTrueReason();
      } else if (name != null) {
        return name.equals(elementName) ? Reason.createFalseReason() : Reason.createTrueReason();
View Full Code Here

  @Override
  public boolean update(IUpdateContext context) {
    PictogramElement container = (PictogramElement) context.getPictogramElement();
    BaseElement element = (BaseElement) BusinessObjectUtil.getFirstElementOfType(context.getPictogramElement(),
            BaseElement.class);
    Shape textShape = getChildElementOfType(container, TEXT_ELEMENT, Boolean.toString(true), Shape.class);
    if (textShape!=null) {
      ((AbstractText) textShape.getGraphicsAlgorithm()).setValue(ModelUtil.getName(element));
      layoutPictogramElement(context.getPictogramElement());
    }
    return true;
  }
View Full Code Here

  public static Shape getShape(ContainerShape container, String property, String expectedValue) {
    IPeService peService = Graphiti.getPeService();
    Iterator<Shape> iterator = peService.getAllContainedShapes(container).iterator();
    while (iterator.hasNext()) {
      Shape shape = iterator.next();
      String value = peService.getPropertyValue(shape, property);
      if (value != null && value.equals(expectedValue)) {
        return shape;
      }
    }
View Full Code Here

  @Override
  public void resizeShape(IResizeShapeContext context) {
    super.resizeShape(context);
    if (context.getPictogramElement() instanceof Shape) {
      Shape shape = (Shape) context.getPictogramElement();
      AnchorUtil.relocateFixPointAnchors(shape, context.getWidth(), context.getHeight());
      Object[] node = getAllBusinessObjectsForPictogramElement(context.getShape());
      for (Object object : node) {
        if (object instanceof BPMNShape) {
          BPMNShape s = (BPMNShape) object;
View Full Code Here

  protected Shape drawForBoundary(DecorationAlgorithm algorithm, ContainerShape shape) {
    return draw(shape);
  }

  private Shape draw(ContainerShape shape) {
    Shape timerShape = Graphiti.getPeService().createShape(shape, false);
    GraphicsUtil.createEventImage(timerShape, ImageProvider.IMG_20_TIMER);
    return timerShape;
  }
View Full Code Here

    return null; // NOT ALLOWED ACCORDING TO SPEC
  }

  @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

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.