Package org.eclipse.graphiti.mm.algorithms

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


  private void addLineToBox(ContainerShape containerShape) {
    // create shape for line
    Shape shape = Graphiti.getPeCreateService().createShape(
        containerShape, false);
    // create and set graphics algorithm
    Polyline polyline = Graphiti.getGaService().createPolyline(
        shape, new int[] { 0, 40, BOX_WIDTH, 40 });
    polyline.setStyle(StyleUtil.getStyleForPE(getDiagram()));
  }
View Full Code Here


            if (containerWidth != size.getWidth()) {

                if (graphicsAlgorithm instanceof Polyline) {

                    Polyline polyline = (Polyline) graphicsAlgorithm;
                    Point secondPoint = polyline.getPoints().get(1);
                    Point newSecondPoint =
                        gaService.createPoint(containerWidth,
                            secondPoint.getY());
                    polyline.getPoints().set(1, newSecondPoint);
                    anythingChanged = true;

                } else if (graphicsAlgorithm instanceof Rectangle){
                 
                  Rectangle r = (Rectangle) graphicsAlgorithm;
View Full Code Here

            .createFreeFormConnection(getDiagram());
        connection.setStart(addConContext.getSourceAnchor());
        connection.setEnd(addConContext.getTargetAnchor());

        IGaService gaService = Graphiti.getGaService();
        Polyline polyline = gaService.createPolyline(connection);
        polyline.setStyle(StyleUtil.getStyleForConn(getDiagram()));
        ConnectionDecorator cd = peCreateService.createConnectionDecorator(
            connection, false, 1.0, true);

        createArrow(cd);
View Full Code Here

     * @return
     */
    private Polyline createArrow(GraphicsAlgorithmContainer gaContainer) {

      IGaService gaService = Graphiti.getGaService();
      Polyline polyline = gaService.createPolygon(
          gaContainer, new int[] { -9, 6, 0, 0, -9, -6 });
      polyline.setForeground(manageColor(IColorConstant.BLACK));
      polyline.setBackground(manageColor(IColorConstant.BLACK));
      polyline.setLineWidth(1);

      return polyline;
    }
View Full Code Here

    Connection connection = peCreateService.createFreeFormConnection(getDiagram());
    connection.setStart(addConContext.getSourceAnchor());
    connection.setEnd(addConContext.getTargetAnchor());
   
    IGaService gaService = Graphiti.getGaService();
    Polyline polyline = gaService.createPolyline(connection);
    polyline.setStyle(StyleUtil.getStyleForEClass(getDiagram()));
    polyline.setForeground(manageColor(StyleUtil.getColorConstant(PreferenceManager.getInstance().loadPreferenceAsString(PreferencesConstants.EDITOR_CONNECTION_COLOR))));

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

    // add dynamic text decorator for the reference name
View Full Code Here

        StyleUtil.applyBGStyle(polygon, this);

        xy = new int[] { 0, 14, whalf, 24, width, 14 };
        bend = new int[] { 0, 0, whalf, whalf, 0, 0 };
        Polyline line1 = gaService.createPolyline(invisibleRect, xy, bend);
        line1.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));

        xy = new int[] { 0, 18, whalf, 28, width, 18 };
        Polyline line2 = gaService.createPolyline(invisibleRect, xy, bend);
        line2.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));

        xy = new int[] { 0, 11, whalf, 0, width, 11 };
        Polyline lineTop = gaService.createPolyline(invisibleRect, xy, bend);
        lineTop.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));

        Shape textShape = peService.createShape(container, false);
        peService
            .setPropertyValue(textShape, UpdateBaseElementNameFeature.TEXT_ELEMENT, Boolean.toString(true));
        Text text = gaService.createDefaultText(getDiagram(), textShape, store.getName());
View Full Code Here

  private static void drawMessageLink(String name, BoundaryAnchor boundaryAnchor, int x, int y, boolean filled) {
    Diagram diagram = peService.getDiagramForAnchor(boundaryAnchor.anchor);

    FreeFormConnection connection = peService.createFreeFormConnection(diagram);
    Polyline connectionLine = gaService.createPolyline(connection);
    connectionLine.setForeground(gaService.manageColor(diagram, StyleUtil.CLASS_FOREGROUND));
    connectionLine.setLineStyle(LineStyle.DOT);
    connectionLine.setLineWidth(2);

    ContainerShape envelope = peService.createContainerShape(diagram, true);
    Rectangle invisibleRectangle = gaService.createInvisibleRectangle(envelope);
    gaService.setLocation(invisibleRectangle, x, y);
    gaService.setSize(invisibleRectangle, ENV_W + 50, ENV_H);
View Full Code Here

      Iterator<Shape> iterator = peService.getAllContainedShapes(container).iterator();
      while (iterator.hasNext()) {
        Shape shape = iterator.next();
        String prop = peService.getPropertyValue(shape, Properties.HIDEABLE_PROPERTY);
        if (prop != null && new Boolean(prop)) {
          Polyline line = (Polyline) shape.getGraphicsAlgorithm();
          line.setLineVisible(drawCollectionMarker);
        }
      }

      peService.setPropertyValue(container, Properties.COLLECTION_PROPERTY,
          Boolean.toString(data.isIsCollection()));
View Full Code Here

    int y = size.getHeight() - h - 1;
    gaService.setLocationAndSize(rect, x, y, w, h);

    int[][] coorinates = { new int[] { 0, 0, 0, h }, new int[] { 4, 0, 4, h }, new int[] { 8, 0, 8, h } };
    for (int[] xy : coorinates) {
      Polyline line = gaService.createPolyline(rect, xy);
      line.setLineWidth(2);
      line.setForeground(gaService.manageColor(diagram, StyleUtil.CLASS_FOREGROUND));
    }
  }
View Full Code Here

        Iterator<Shape> iterator = peService.getAllContainedShapes(container).iterator();
        while (iterator.hasNext()) {
          Shape shape = iterator.next();
          String property = peService.getPropertyValue(shape, GraphicsUtil.ACTIVITY_MARKER_CONTAINER);
          if (property != null && new Boolean(property)) {
            Polyline tilde = GraphicsUtil.createActivityMarkerAdHoc((ContainerShape) shape);
            tilde.setForeground(manageColor(StyleUtil.CLASS_FOREGROUND));
          }
        }
      }
    };
  }
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.