Package org.eclipse.graphiti.mm.algorithms

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


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

    ContainerShape choreographyContainer = peService.createContainerShape(context.getTargetContainer(), true);
    RoundedRectangle containerRect = gaService.createRoundedRectangle(choreographyContainer, R, R);
    gaService.setLocationAndSize(containerRect, context.getX(), context.getY(), width, height);
    StyleUtil.applyBGStyle(containerRect, this);
    decorateContainerRect(containerRect);

    Object importProperty = context.getProperty(DIImport.IMPORT_PROPERTY);
View Full Code Here


    Rectangle invisibleRect = gaService.createInvisibleRectangle(containerShape);

    gaService.setLocationAndSize(invisibleRect, context.getX(), context.getY(), width, height + 18);

    Shape rectShape = peService.createShape(containerShape, false);
    RoundedRectangle rect = gaService.createRoundedRectangle(rectShape, 5, 5);
       
    StyleUtil.applyBGStyle(rect, this);   

    gaService.setLocationAndSize(rect, 0, 0, width, height);
    decorateRect(rect);
View Full Code Here

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

        ContainerShape container = peService.createContainerShape(context.getTargetContainer(), true);
        RoundedRectangle rect = gaService.createRoundedRectangle(container, 5, 5);
        rect.setFilled(false);
        rect.setLineWidth(2);
        rect.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
        rect.setLineStyle(LineStyle.DASHDOT);
        gaService.setLocationAndSize(rect, context.getX(), context.getY(), width, height);

        peService.createChopboxAnchor(container);
        AnchorUtil.addFixedPointAnchors(container, rect);
View Full Code Here

    // otherwise define a default size for the shape
    final int width = context.getWidth() <= 0 ? 205 : context.getWidth();
    final int height = context.getHeight() <= 0 ? 205 : context.getHeight();

    final IGaService gaService = Graphiti.getGaService();
    RoundedRectangle roundedRectangle; // need to access it later
    {
      // create invisible outer rectangle expanded by
      // the width needed for the anchor
      final Rectangle invisibleRectangle = gaService.createInvisibleRectangle(containerShape);
      gaService.setLocationAndSize(invisibleRectangle, context.getX(), context.getY(), width, height);

      // create and set visible rectangle inside invisible rectangle
      roundedRectangle = gaService.createRoundedRectangle(invisibleRectangle, 5, 5);
      roundedRectangle.setParentGraphicsAlgorithm(invisibleRectangle);
      roundedRectangle.setBackground(gaService.manageColor(getDiagram(), IColorConstant.WHITE));
      roundedRectangle.setLineStyle(LineStyle.DOT);
      gaService.setLocationAndSize(roundedRectangle, 0, 0, width, height);

      // create link and wire it
      link(containerShape, addedSubProcess);
    }
View Full Code Here

    // otherwise define a default size for the shape
    final int width = context.getWidth() <= 0 ? 205 : context.getWidth();
    final int height = context.getHeight() <= 0 ? 205 : context.getHeight();

    final IGaService gaService = Graphiti.getGaService();
    RoundedRectangle roundedRectangle; // need to access it later
    {
      // create invisible outer rectangle expanded by
      // the width needed for the anchor
      final Rectangle invisibleRectangle = gaService.createInvisibleRectangle(containerShape);
      gaService.setLocationAndSize(invisibleRectangle, context.getX(), context.getY(), width, height);

      // create and set visible rectangle inside invisible rectangle
      roundedRectangle = gaService.createRoundedRectangle(invisibleRectangle, 5, 5);
      roundedRectangle.setParentGraphicsAlgorithm(invisibleRectangle);
      roundedRectangle.setStyle(StyleUtil.getStyleForEvent(getDiagram()));
      gaService.setLocationAndSize(roundedRectangle, 0, 0, width, height);

      // create link and wire it
      link(containerShape, addedSubProcess);
    }
View Full Code Here

      // check whether the context has a size (e.g. from a create feature)
      // otherwise define a default size for the shape
      width = context.getWidth() <= 0 ? 105 : context.getWidth();
      height = context.getHeight() <= 0 ? 55 : context.getHeight();

      RoundedRectangle roundedRectangle; // need to access it later
      {
        // create invisible outer rectangle expanded by
        // the width needed for the anchor
        final Rectangle invisibleRectangle = gaService.createInvisibleRectangle(containerShape);
        gaService.setLocationAndSize(invisibleRectangle, context.getX(), context.getY(), width, height);

        // create and set visible rectangle inside invisible rectangle
        roundedRectangle = gaService.createRoundedRectangle(invisibleRectangle, 20, 20);
        algorithm = roundedRectangle;
        roundedRectangle.setParentGraphicsAlgorithm(invisibleRectangle);
        roundedRectangle.setStyle(StyleUtil.getStyleForTask(getDiagram()));
        gaService.setLocationAndSize(roundedRectangle, 0, 0, width, height);

        // create link and wire it
        link(containerShape, addedTask);
      }
View Full Code Here

    // check whether the context has a size (e.g. from a create feature)
    // otherwise define a default size for the shape
    width = context.getWidth() <= 0 ? 105 : context.getWidth();
    height = context.getHeight() <= 0 ? 55 : context.getHeight();

    RoundedRectangle roundedRectangle; // need to access it later
    {
      // create invisible outer rectangle expanded by
      // the width needed for the anchor
      final Rectangle invisibleRectangle = gaService.createInvisibleRectangle(containerShape);
      gaService.setLocationAndSize(invisibleRectangle, context.getX(), context.getY(), width, height);

      // create and set visible rectangle inside invisible rectangle
      roundedRectangle = gaService.createRoundedRectangle(invisibleRectangle, 20, 20);
      algorithm = roundedRectangle;
      roundedRectangle.setParentGraphicsAlgorithm(invisibleRectangle);
      roundedRectangle.setStyle(StyleUtil.getStyleForTask(getDiagram()));
      gaService.setLocationAndSize(roundedRectangle, 0, 0, width, height);

      // create link and wire it
      link(containerShape, addedTask);
    }
View Full Code Here

    // otherwise define a default size for the shape
    final int width = context.getWidth() <= 0 ? 105 : context.getWidth();
    final int height = context.getHeight() <= 0 ? 55 : context.getHeight();

    final IGaService gaService = Graphiti.getGaService();
    RoundedRectangle roundedRectangle; // need to access it later
    {
      // create invisible outer rectangle expanded by
      // the width needed for the anchor
      final Rectangle invisibleRectangle = gaService.createInvisibleRectangle(containerShape);
      gaService.setLocationAndSize(invisibleRectangle, context.getX(), context.getY(), width, height);

      // create and set visible rectangle inside invisible rectangle
      roundedRectangle = gaService.createRoundedRectangle(invisibleRectangle, 5, 5);
      roundedRectangle.setParentGraphicsAlgorithm(invisibleRectangle);
      roundedRectangle.setStyle(StyleUtil.getStyleForTask(getDiagram()));
      roundedRectangle.setLineWidth(3);
      gaService.setLocationAndSize(roundedRectangle, 0, 0, width, height);

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

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

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

      gaService.setLocationAndSize(text, 0, 20, width, 30);

      // create link and wire it
      link(shape, addedCallActivity);

      // provide information to support direct-editing directly
      // after object creation (must be activated additionally)
      final IDirectEditingInfo directEditingInfo = getFeatureProvider().getDirectEditingInfo();
      // set container shape for direct editing after object creation
      directEditingInfo.setMainPictogramElement(containerShape);
      // set shape and graphics algorithm where the editor for
      // direct editing shall be opened after object creation
      directEditingInfo.setPictogramElement(shape);
      directEditingInfo.setGraphicsAlgorithm(text);
    }

    {
      final Shape shape = peCreateService.createShape(containerShape, false);
      final Image image = gaService.createImage(shape, getIcon());

      // calculate position for icon
      final int iconWidthAndHeight = 10;
      final int padding = 5;
      final int xPos = (roundedRectangle.getWidth() / 2) - (iconWidthAndHeight / 2);
      final int yPos = roundedRectangle.getHeight() - padding - iconWidthAndHeight;

      gaService.setLocationAndSize(image, xPos, yPos, iconWidthAndHeight, iconWidthAndHeight);
    }

    // add a chopbox anchor to the shape
View Full Code Here

TOP

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

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.