Package org.vaadin.gwtgraphics.client.shape.path

Examples of org.vaadin.gwtgraphics.client.shape.path.MoveTo


      }

      int width = endX - beginX;
      int height = endY - beginY;
      if (height != 0 && width != 0) {
        zoomInRect.setStep(5, new MoveTo(false, beginX, beginY));
        zoomInRect.setStep(6, new LineTo(false, endX, beginY));
        zoomInRect.setStep(7, new LineTo(false, endX, endY));
        zoomInRect.setStep(8, new LineTo(false, beginX, endY));
        zoomInRect.setStep(9, new ClosePath());
        screenBounds = factory.createBbox(beginX, beginY, width, height);
View Full Code Here


    distanceMarker.setStep(2, new LineTo(true, widthInPixels, 0));
  }

  public void onResize() {
    backGround.setY(viewPort.getMapHeight() - 22);
    distanceMarker.setStep(0, new MoveTo(false, 3, viewPort.getMapHeight() - 18));
    distance.setY(viewPort.getMapHeight() - 8);
  }
View Full Code Here

   *
   * @see org.vaadin.gwtgraphics.client.Shape#setX(int)
   */
  @Override
  public void setX(int x) {
    steps.set(0, new MoveTo(false, x, getY()));
    drawPath();
  }
View Full Code Here

   *
   * @see org.vaadin.gwtgraphics.client.Shape#setY(int)
   */
  @Override
  public void setY(int y) {
    steps.set(0, new MoveTo(false, getX(), y));
    drawPath();
  }
View Full Code Here

   *            an absolute x-coordinate in pixels
   * @param y
   *            an absolute y-coordinate in pixels
   */
  public void moveTo(int x, int y) {
    steps.add(new MoveTo(false, x, y));
    drawPath();
  }
View Full Code Here

   *            a relative x-coordinate in pixels
   * @param y
   *            a relative y-coordinate in pixels
   */
  public void moveRelativelyTo(int x, int y) {
    steps.add(new MoveTo(true, x, y));
    drawPath();
  }
View Full Code Here

    StringBuilder path = new StringBuilder();
    for (PathStep step : steps) {
      if (step.getClass() == ClosePath.class) {
        path.append(" z");
      } else if (step.getClass() == MoveTo.class) {
        MoveTo moveTo = (MoveTo) step;
        path.append(moveTo.isRelativeCoords() ? " m" : " M").append(
            moveTo.getX()).append(" ").append(moveTo.getY());
      } else if (step.getClass() == LineTo.class) {
        LineTo lineTo = (LineTo) step;
        path.append(lineTo.isRelativeCoords() ? " l" : " L").append(
            lineTo.getX()).append(" ").append(lineTo.getY());
      } else if (step.getClass() == CurveTo.class) {
View Full Code Here

    int y = -1;
    for (PathStep step : steps) {
      if (step.getClass() == ClosePath.class) {
        path.append(" x e");
      } else if (step.getClass() == MoveTo.class) {
        MoveTo moveTo = (MoveTo) step;
        path.append(moveTo.isRelativeCoords() ? " t" : " m").append(
            moveTo.getX()).append(" ").append(moveTo.getY());
      } else if (step.getClass() == LineTo.class) {
        LineTo lineTo = (LineTo) step;
        path.append(lineTo.isRelativeCoords() ? " r" : " l").append(
            lineTo.getX()).append(" ").append(lineTo.getY());
      } else if (step.getClass() == CurveTo.class) {
        CurveTo curve = (CurveTo) step;
        path.append(curve.isRelativeCoords() ? " v" : " c");
        path.append(curve.getX1()).append(" ").append(curve.getY1());
        path.append(" ").append(curve.getX2()).append(" ").append(
            curve.getY2());
        path.append(" ").append(curve.getX()).append(" ").append(
            curve.getY());
      } else if (step.getClass() == Arc.class) {
        // TODO
      }

      if (step instanceof MoveTo) {
        MoveTo moveTo = (MoveTo) step;
        x = moveTo.getX() + (moveTo.isRelativeCoords() ? x : 0);
        y = moveTo.getY() + (moveTo.isRelativeCoords() ? y : 0);
      } else {
        // TODO close
      }
    }
    element.setAttribute("path", path.toString());
View Full Code Here

TOP

Related Classes of org.vaadin.gwtgraphics.client.shape.path.MoveTo

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.