Package org.eclipse.graphiti.mm.algorithms

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


    Rectangle rect = gaService.createInvisibleRectangle(containerShape);
    gaService.setLocationAndSize(rect, context.getX(), context.getY(), width, height);

    Shape lineShape = peCreateService.createShape(containerShape, false);
    Polyline line = gaService.createPolyline(lineShape, new int[] { commentEdge, 0, 0, 0, 0, height, commentEdge,
        height });
    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()));
View Full Code Here


        gaService.setWidth(shapeGa, containerWidth - 5);
        changed = true;
      }
      if (containerHeight != size.getHeight()) {
        if (shapeGa instanceof Polyline) {
          Polyline line = (Polyline) shapeGa;
          line.getPoints().set(2, getNewPoint(line, 2, containerHeight, gaService));
          line.getPoints().set(3, getNewPoint(line, 3, containerHeight, gaService));
          changed = true;
        } else if (shapeGa instanceof MultiText) {
          gaService.setHeight(shapeGa, containerHeight - 5);
          changed = true;
        }
View Full Code Here

      for (Shape s : children) {
        GraphicsAlgorithm childGa = s.getGraphicsAlgorithm();
        if (childGa instanceof Text) {
          s.getGraphicsAlgorithm().setHeight(newHeight);
        } else if (childGa instanceof Polyline) {
          Polyline line = (Polyline) childGa;
          Point firstPoint = line.getPoints().get(0);
          Point newPoint = service.createPoint(firstPoint.getX(), newHeight);
          line.getPoints().set(1, newPoint);
        }
      }

      return new Dimension(newWidth, newHeight);
    }
View Full Code Here

      for (Shape s : root.getChildren()) {
        GraphicsAlgorithm childGa = s.getGraphicsAlgorithm();
        if (childGa instanceof Text) {
          s.getGraphicsAlgorithm().setHeight(ga.getHeight());
        } else if (childGa instanceof Polyline) {
          Polyline line = (Polyline) childGa;
          Point firstPoint = line.getPoints().get(0);
          Point newPoint = service.createPoint(firstPoint.getX(), ga.getHeight());
          line.getPoints().set(1, newPoint);
        }
      }
      return new Dimension(ga.getWidth(), ga.getHeight());
    }
View Full Code Here

      Text text = gaService.createText(labelDecorator, ModelUtil.getName(element));
      peService.setPropertyValue(labelDecorator, UpdateBaseElementNameFeature.TEXT_ELEMENT, Boolean.toString(true));
      text.setStyle(StyleUtil.getStyleForText(getDiagram()));
    }
   
    Polyline connectionLine = gaService.createPolyline(connection);
    connectionLine.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));

    decorateConnectionLine(connectionLine);

    createDIEdge(connection, element);
    createConnectionDecorators(connection);
View Full Code Here

       
        ConnectionDecorator decorator = Graphiti.getPeService().createConnectionDecorator(connection, false,
            1.0, true);

        IGaService gaService = Graphiti.getGaService();
        Polyline arrow = gaService.createPolygon(decorator, new int[] { -l, w, 0, 0, -l, -w, -l, w });

        arrow.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
        arrow.setLineWidth(2);
      }

      @Override
      protected void hook(IAddContext context, Connection connection, BaseElement element) {
        setDefaultSequenceFlow(connection);
View Full Code Here

        ConnectionDecorator endDecorator = peService.createConnectionDecorator(connection, false, 1.0, true);

        int w = 5;
        int l = 10;

        Polyline polyline = gaService.createPolyline(endDecorator, new int[] { -l, w, 0, 0, -l, -w });
        polyline.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
        polyline.setLineWidth(1);
      }

      @Override
      protected Class<? extends BaseElement> getBoClass() {
        return DataOutputAssociation.class;
View Full Code Here

        ConnectionDecorator endDecorator = peService.createConnectionDecorator(connection, false, 1.0, true);

        int w = 5;
        int l = 10;

        Polyline polyline = gaService.createPolyline(endDecorator, new int[] { -l, w, 0, 0, -l, -w });
        polyline.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
        polyline.setLineWidth(1);
      }

      @Override
      protected Class<? extends BaseElement> getBoClass() {
        return DataInputAssociation.class;
View Full Code Here

        ConnectionDecorator startDecorator = peService.createConnectionDecorator(connection, false, 0, true);

        int w = 5;
        int l = 15;
       
        Polyline polyline = gaService.createPolygon(endDecorator, new int[] { -l, w, 0, 0, -l, -w, -l, w });
        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);
View Full Code Here

        }
      }
    }

    IGaService gaService = Graphiti.getGaService();
    Polyline polyline = gaService.createPolyline(connection);
    polyline.setLineStyle(LineStyle.SOLID);
    polyline.setForeground(Graphiti.getGaService().manageColor(getDiagram(), IColorConstant.BLACK));

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

    // add dynamic text decorator for the reference name
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.