Package org.eclipse.graphiti.mm.algorithms

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


        PictogramElement pictogramElement = context.getPictogramElement();
        if (pictogramElement instanceof ContainerShape) {
            ContainerShape cs = (ContainerShape) pictogramElement;
            for (Shape shape : cs.getChildren()) {
                if (shape.getGraphicsAlgorithm() instanceof MultiText) {
                  MultiText text = (MultiText) shape.getGraphicsAlgorithm();
                    pictogramValue = text.getValue();
                }
            }
        }
        // retrieve name from business model
View Full Code Here


    {
      // create shape for text
      Shape shape = peCreateService.createShape(containerShape, false);

      // create and set text graphics algorithm
      MultiText text = gaService.createDefaultMultiText(
          getDiagram(), shape, Utility.getLiteralValue(addedObj));
      text.setStyle(StyleUtil.getStyleForText(getDiagram()));
      text.setHorizontalAlignment(Orientation.ALIGNMENT_LEFT);
      text.setVerticalAlignment(Orientation.ALIGNMENT_TOP);
 
      gaService.setLocationAndSize(text, 0, 0, width, 20);

      // create link and wire it
      link(shape, addedObj);
View Full Code Here

    box.setFilled(false);
    box.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
    decorateBox(box);

    Shape textShape = peService.createShape(containerShape, false);
    MultiText text = gaService.createDefaultMultiText(getDiagram(), textShape, subprocess.getName());
    gaService.setLocationAndSize(text, 10, 10, 80, 80);
    text.setStyle(StyleUtil.getStyleForText(getDiagram()));
    text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
    text.setVerticalAlignment(Orientation.ALIGNMENT_TOP);
    text.getFont().setBold(true);
    link(textShape, subprocess);

    Polyline lineHorizontal = gaService.createPolyline(box, new int[] { 2, 10, 18, 10 });
    lineHorizontal.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
View Full Code Here

    line.setStyle(StyleUtil.getStyleForClass(getDiagram()));
    line.setLineWidth(2);
    gaService.setLocationAndSize(line, 0, 0, commentEdge, height);

    Shape textShape = peCreateService.createShape(containerShape, false);
    MultiText text = gaService.createDefaultMultiText(getDiagram(), textShape, annotation.getText());
    text.setStyle(StyleUtil.getStyleForText(getDiagram()));
    text.setVerticalAlignment(Orientation.ALIGNMENT_TOP);
    gaService.setLocationAndSize(text, 5, 5, width - 5, height - 5);

    createDIShape(containerShape, annotation);
    link(textShape, annotation);
View Full Code Here

  protected void hook(Activity activity, ContainerShape container, IAddContext context, int width, int height) {
    IPeService peService = Graphiti.getPeService();
    IGaService gaService = Graphiti.getGaService();

    Shape textShape = peService.createShape(container, false);
    MultiText text = gaService.createDefaultMultiText(getDiagram(), textShape, activity.getName());
    int padding = GraphicsUtil.TASK_IMAGE_SIZE;
    gaService.setLocationAndSize(text, 0, padding, width, height - padding);
    text.setStyle(StyleUtil.getStyleForText(getDiagram()));
    text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
    text.setVerticalAlignment(Orientation.ALIGNMENT_TOP);
    text.getFont().setBold(true);
    link(textShape, activity);
  }
View Full Code Here

   
    List<Shape> shapes = ((ContainerShape) context.getShape()).getChildren();
    for (Shape shape : shapes) {
      if(shape.getGraphicsAlgorithm() != null) {
        if(shape.getGraphicsAlgorithm() instanceof MultiText) {
          MultiText text = (MultiText) shape.getGraphicsAlgorithm();
          text.setHeight(height - 25);
          text.setWidth(width);
        } else if(shape.getGraphicsAlgorithm() instanceof Image) {
          Image image = (Image) shape.getGraphicsAlgorithm();
         
          if(bo instanceof CallActivity) {
           
            // calculate position for icon
            final int iconWidthAndHeight = 10;
            final int padding = 5;
            final int xPos = (context.getShape().getGraphicsAlgorithm().getWidth() / 2) - (iconWidthAndHeight / 2);
            final int yPos = context.getShape().getGraphicsAlgorithm().getHeight() - padding - iconWidthAndHeight;

            image.setX(xPos);
            image.setY(yPos);
           
          } else {
            int imageX = image.getX();
            if(imageX > 20) {
              image.setX(width - 20);
            }
          }
        } else if(shape.getGraphicsAlgorithm() instanceof Text) {
          Text text = (Text) shape.getGraphicsAlgorithm();
          text.setHeight(height - 25);
          text.setWidth(width);
        }
      }
    }
  }
View Full Code Here

    // create link and wire it
    link(connection, addedSequenceFlow);

    // add dynamic text decorator for the reference name
    ConnectionDecorator textDecorator = peCreateService.createConnectionDecorator(connection, true, 0.5, true);
    MultiText text = gaService.createDefaultMultiText(getDiagram(), textDecorator);
    text.setStyle(StyleUtil.getStyleForTask((getDiagram())));
    text.setHorizontalAlignment(Orientation.ALIGNMENT_LEFT);
    text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);
    if (OSUtil.getOperatingSystem() == OSEnum.Mac) {
      text.setFont(gaService.manageFont(getDiagram(), text.getFont().getName(), 11));
    }
   
    if(addConContext.getProperty("org.activiti.designer.connectionlabel") != null) {
      GraphicInfo labelLocation = (GraphicInfo) addConContext.getProperty("org.activiti.designer.connectionlabel");
      gaService.setLocation(text, (int)labelLocation.getX(), (int)labelLocation.getY());
    } else {
      gaService.setLocation(text, 10, 0);
    }
   
    if (StringUtils.isNotEmpty(addedSequenceFlow.getName())) {
      TextUtil.setTextSize(addedSequenceFlow.getName(), text);
    }

    // set reference name in the text decorator
    text.setValue(addedSequenceFlow.getName());

    // add static graphical decorators (composition and navigable)
    ConnectionDecorator cd = peCreateService.createConnectionDecorator(connection, false, 1.0, true);
    createArrow(cd);
View Full Code Here

    {
      // create shape for text
      final Shape shape = peCreateService.createShape(containerShape, false);

      // create and set text graphics algorithm
      final MultiText text = gaService.createDefaultMultiText(getDiagram(), shape, addedTask.getName());
      text.setStyle(StyleUtil.getStyleForTask(getDiagram()));
      text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
      text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);
      if (OSUtil.getOperatingSystem() == OSEnum.Mac) {
        text.setFont(gaService.manageFont(getDiagram(), text.getFont().getName(), 11));
      }

      switch (baseShape) {
      case ACTIVITY:
        gaService.setLocationAndSize(text, 0, 20, width, height - 25);
View Full Code Here

          Text text = (Text) shape.getGraphicsAlgorithm();
          text.setValue(businessName);
          return true;
        }
        if (shape.getGraphicsAlgorithm() instanceof MultiText) {
          MultiText text = (MultiText) shape.getGraphicsAlgorithm();
          text.setValue(businessName);
          return true;
        }
      }
    }
View Full Code Here

    line.setStyle(StyleUtil.getStyleForTask(getDiagram()));
    line.setLineWidth(2);
    gaService.setLocationAndSize(line, 0, 0, commentEdge, height);
   
    final Shape textShape = peCreateService.createShape(containerShape, false);
    final MultiText text = gaService.createDefaultMultiText(getDiagram(), textShape, annotation.getText());
    text.setStyle(StyleUtil.getStyleForTask(getDiagram()));
    text.setVerticalAlignment(Orientation.ALIGNMENT_TOP);
    if (OSUtil.getOperatingSystem() == OSEnum.Mac) {
      text.setFont(gaService.manageFont(getDiagram(), text.getFont().getName(), 11));
    }
    gaService.setLocationAndSize(text, 5, 5, width - 5, height - 5);
   
    // link both, the container as well as the text shape so direct editing works together
    // with updating and property handling
View Full Code Here

TOP

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

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.