Package org.eclipse.graphiti.mm.algorithms

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


      Shape shape = iterator.next();
      GraphicsAlgorithm ga = shape.getGraphicsAlgorithm();
      IDimension size = gaService.calculateSize(ga);
      if (containerHeight != size.getHeight()) {
        if (ga instanceof Polyline) {
          Polyline line = (Polyline) ga;
          Point firstPoint = line.getPoints().get(0);
          Point newPoint = gaService.createPoint(firstPoint.getX(), containerHeight);
          line.getPoints().set(1, newPoint);
        } else if (ga instanceof Text) {
          gaService.setHeight(ga, containerHeight);
        }
      }
    }
View Full Code Here


    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));

    Polyline lineVertical = gaService.createPolyline(box, new int[] { 10, 2, 10, 18 });
    lineVertical.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));

    ChopboxAnchor anchor = peService.createChopboxAnchor(containerShape);
    anchor.setReferencedGraphicsAlgorithm(rect);

    peService.setPropertyValue(containerShape, TRIGGERED_BY_EVENT, "false");
View Full Code Here

    Rectangle rect = gaService.createRectangle(containerShape);
    StyleUtil.applyBGStyle(rect, this);
    gaService.setLocationAndSize(rect, context.getX(), context.getY(), width, height);

    Shape lineShape = peCreateService.createShape(containerShape, false);
    Polyline line = gaService.createPolyline(lineShape, new int[] { 15, 0, 15, height });
    line.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));

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

      GraphicsAlgorithm parentGa = containerShape.getGraphicsAlgorithm();
      int x = (parentGa.getWidth() / 2) - 10;
      int y = parentGa.getHeight() - 20;
      gaService.setLocationAndSize(invisibleRectangle, x, y, 20, 20);

      Polyline line1 = gaService.createPolyline(invisibleRectangle, new int[] { 0, 0, 0, 20 });
      line1.setLineWidth(2);
      line1.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
      Polyline line2 = gaService.createPolyline(invisibleRectangle, new int[] { 9, 0, 9, 20 });
      line2.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
      line2.setLineWidth(2);
      Polyline line3 = gaService.createPolyline(invisibleRectangle, new int[] { 18, 0, 18, 20 });
      line3.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
      line3.setLineWidth(2);
    } else {
      Shape shape = FeatureSupport.getShape(containerShape, MULTIPLICITY_MARKER, Boolean.toString(true));
      if (shape != null) {
        peService.deletePictogramElement(shape);
      }
View Full Code Here

    rect.setLineWidth(1);
    StyleUtil.applyBGStyle(rect, this);
    decorate(rect);

    int p = width - e - 1;
    Polyline edge = gaService.createPolyline(rect, new int[] { p, 0, p, e + 1, width, e + 1 });
    edge.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
    edge.setLineWidth(1);

    if (isSupportCollectionMarkers()) {
      int whalf = width / 2;
      createCollectionShape(container, new int[] { whalf - 2, height - 8, whalf - 2, height });
      createCollectionShape(container, new int[] { whalf, height - 8, whalf, height });
View Full Code Here

  private Shape createCollectionShape(ContainerShape container, int[] xy) {
    IPeService peService = Graphiti.getPeService();
    IGaService gaService = Graphiti.getGaService();
    Shape collectionShape = peService.createShape(container, false);
    Polyline line = gaService.createPolyline(collectionShape, xy);
    line.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
    line.setLineWidth(1);
    line.setLineVisible(false);
    peService.setPropertyValue(collectionShape, Properties.HIDEABLE_PROPERTY, Boolean.toString(true));
    return collectionShape;
  }
View Full Code Here

    return ellipse;
  }

  public static Cross createGatewayCross(ContainerShape container) {
    Shape verticalShape = peService.createShape(container, false);
    Polyline verticalLine = gaService.createPolyline(verticalShape, new int[] { 24, 7, 24, 43 });
    verticalLine.setLineWidth(3);
    peService.setPropertyValue(verticalShape, DELETABLE_PROPERTY, "false");

    Shape horizontalShape = peService.createShape(container, false);
    Polyline horizontalLine = gaService.createPolyline(horizontalShape, new int[] { 7, 24, 43, 24 });
    horizontalLine.setLineWidth(3);
    peService.setPropertyValue(horizontalShape, DELETABLE_PROPERTY, "false");

    Cross cross = new Cross();
    cross.vertical = verticalLine;
    cross.horizontal = horizontalLine;
View Full Code Here

  public static Asterisk createGatewayAsterisk(ContainerShape container) {
    IPeService service = Graphiti.getPeService();

    Shape verticalShape = service.createShape(container, false);
    Polyline vertical = gaService.createPolyline(verticalShape, new int[] { 23, 8, 23, 42 });
    vertical.setLineWidth(5);
    peService.setPropertyValue(verticalShape, DELETABLE_PROPERTY, "true");

    Shape horizontalShape = service.createShape(container, false);
    Polyline horizontal = gaService.createPolyline(horizontalShape, new int[] { 8, 24, 42, 24 });
    horizontal.setLineWidth(5);
    peService.setPropertyValue(horizontalShape, DELETABLE_PROPERTY, "true");

    Shape diagonalDescShape = service.createShape(container, false);
    Polyline diagonalDesc = gaService.createPolyline(diagonalDescShape, new int[] { 13, 14, 37, 37 });
    diagonalDesc.setLineWidth(4);
    peService.setPropertyValue(diagonalDescShape, DELETABLE_PROPERTY, "true");

    Shape diagonalAscShape = service.createShape(container, false);
    Polyline diagonalAsc = gaService.createPolyline(diagonalAscShape, new int[] { 37, 14, 13, 37 });
    diagonalAsc.setLineWidth(4);
    peService.setPropertyValue(diagonalAscShape, DELETABLE_PROPERTY, "true");

    Asterisk a = new Asterisk();
    a.horizontal = horizontal;
    a.vertical = vertical;
View Full Code Here

  public static Envelope createEnvelope(GraphicsAlgorithmContainer gaContainer, int x, int y, int w, int h) {
    Rectangle rect = gaService.createRectangle(gaContainer);
    gaService.setLocationAndSize(rect, x, y, w, h);
    rect.setFilled(false);

    Polyline line = gaService.createPolyline(rect, new int[] { 0, 0, w / 2, h / 2, w, 0 });

    Envelope envelope = new Envelope();
    envelope.rect = rect;
    envelope.line = line;
View Full Code Here

    GraphicsAlgorithmContainer algorithmContainer = createActivityMarkerGaContainer(markerContainer,
            ACTIVITY_MARKER_LOOP_CHARACTERISTIC);

    int[] xy = { 8, 10, 10, 5, 5, 0, 0, 5, 3, 10 };
    int[] bend = { 0, 0, 3, 4, 4, 4, 4, 3, 3, 0 };
    Polyline circle = gaService.createPolyline(algorithmContainer, xy, bend);

    Loop loop = new Loop();
    loop.circle = circle;
    loop.arrow = gaService.createPolyline(algorithmContainer, new int[] { 5, 5, 5, 10, 0, 10 });
    return loop;
View Full Code Here

TOP

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

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.