Package com.jgraph.gaeawt.java.awt

Examples of com.jgraph.gaeawt.java.awt.Polygon


    }
    return internal_polygon;
  }

  private Polygon constructInternalPolygon() {
    internal_polygon = new Polygon();
    for (int i = 0; i < number_of_curves - 1; i++) {
      curve[i].addFinalPointsToPolygon(internal_polygon);
    }

    curve[number_of_curves - 1].addFinalPointsToPolygon(internal_polygon);
View Full Code Here


    }
    return graphics_polygon;
  }

  private Polygon constructGraphicsPolygon(Coords c) {
    graphics_polygon = new Polygon();
    getInternalPolygon();
    for (int i = 0; i < internal_polygon.npoints; i++) {
      graphics_polygon.addPoint(c.scaleX(internal_polygon.xpoints[i]), c.scaleY(internal_polygon.ypoints[i]));
    }
    return graphics_polygon;
View Full Code Here

  }

  @Override
  public void drawPolygon(int[] xpoints, int[] ypoints, int npoints)
  {
    draw(new Polygon(xpoints, ypoints, npoints));
  }
View Full Code Here

  }

  @Override
  public void fillPolygon(int[] xpoints, int[] ypoints, int npoints)
  {
    fill(new Polygon(xpoints, ypoints, npoints));
  }
View Full Code Here

      mag = 1;
    }

    int rav_x = (dy * width) / mag;
    int rav_y = (dx * width) / mag;
    Polygon temp_polygon = new Polygon();

    temp_polygon.addPoint(c.scaleX(x1 + rav_x), c.scaleY(y1 - rav_y));
    temp_polygon.addPoint(c.scaleX(x1 - rav_x), c.scaleY(y1 + rav_y));
    temp_polygon.addPoint(c.scaleX(x2 - rav_x), c.scaleY(y2 + rav_y));
    temp_polygon.addPoint(c.scaleX(x2 + rav_x), c.scaleY(y2 - rav_y));
    g.fillPolygon(temp_polygon);
  }
View Full Code Here

    int y1 = from.getY();
    int y2 = to.getY();
    int dy = (y2 - y1);

    Polygon temp_polygon = new Polygon();

    if (dy > 0)
    {
      /*     45
       *    /  6
       * 3  /
       * 21
       */
      temp_polygon.addPoint(c.scaleX(x1 + width), c.scaleY(y1 - width));
      temp_polygon.addPoint(c.scaleX(x1 - width), c.scaleY(y1 - width));
      temp_polygon.addPoint(c.scaleX(x1 - width), c.scaleY(y1 + width));
      temp_polygon.addPoint(c.scaleX(x2 - width), c.scaleY(y2 + width));
      temp_polygon.addPoint(c.scaleX(x2 + width), c.scaleY(y2 + width));
      temp_polygon.addPoint(c.scaleX(x2 + width), c.scaleY(y2 - width));
    }
    else
    {
      /* 23
       * 1  \
       *    \ 4
       *     56
       */
      temp_polygon.addPoint(c.scaleX(x1 - width), c.scaleY(y1 - width));
      temp_polygon.addPoint(c.scaleX(x1 - width), c.scaleY(y1 + width));
      temp_polygon.addPoint(c.scaleX(x1 + width), c.scaleY(y1 + width));
      temp_polygon.addPoint(c.scaleX(x2 + width), c.scaleY(y2 + width));
      temp_polygon.addPoint(c.scaleX(x2 + width), c.scaleY(y2 - width));
      temp_polygon.addPoint(c.scaleX(x2 - width), c.scaleY(y2 - width));
    }

    g.fillPolygon(temp_polygon);
  }
View Full Code Here

TOP

Related Classes of com.jgraph.gaeawt.java.awt.Polygon

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.