Examples of Polygon


Examples of ae.java.awt.Polygon

    public void fillPolygon(SunGraphics2D sg2d,
                            int[] xPoints, int[] yPoints,
                            int nPoints)
    {
        fill(sg2d, new Polygon(xPoints, yPoints, nPoints));
    }
View Full Code Here

Examples of ag.ion.bion.officelayer.draw.shapes.data.Polygon

  public InheritanceArrow() {
    super(getInheritanceArrow(2000, 200));
  }

  private static PolyPolygon getInheritanceArrow(int size, int lineWith) {
    Polygon polygon = new Polygon();
    PolygonFlags flag = PolygonFlags.NORMAL;

    double high = Math.sqrt(0.75 * size * size);

    double sceleLength = size;
    double baseLength = size * 0.9;
    double baseAngle = Math.asin(high / sceleLength);
    double topAngle = Math.PI - 2 * baseAngle;

    Point p;
    p = new Point(0, round(high));
    polygon.addPoint(p, flag);

    p = new Point(round(baseLength / 2), 0);
    polygon.addPoint(p, flag);

    p = new Point(round(baseLength), round(high));
    polygon.addPoint(p, flag);

    double x = lineWith / Math.sin(baseAngle);
    double tolerance = 1;
    p = new Point(round(x + tolerance), round(high));
    polygon.addPoint(p, flag);

    double y = lineWith / Math.tan(baseAngle);
    p = new Point(round(x + y + tolerance), round(high) - lineWith);
    polygon.addPoint(p, flag);

    p = new Point(round(baseLength - x - y), round(high - lineWith));
    polygon.addPoint(p, flag);

    double f = lineWith / Math.sin(topAngle / 2);
    p = new Point(round(baseLength / 2), (int) Math.round(f));
    polygon.addPoint(p, flag);

    p = new Point(round(x), round(high));
    polygon.addPoint(p, flag);

    PolyPolygon polyPolygon = new PolyPolygon();
    polyPolygon.getPolygons().add(polygon);
    return polyPolygon;
  }
View Full Code Here

Examples of buri.ddmsence.ddms.summary.gml.Polygon

        String gmlNamespace = getDDMSVersion().getGmlNamespace();
        _polygons = new ArrayList<Polygon>();
        _points = new ArrayList<Point>();
        Elements polygons = element.getChildElements(Polygon.getName(getDDMSVersion()), gmlNamespace);
        for (int i = 0; i < polygons.size(); i++) {
          _polygons.add(new Polygon(polygons.get(i)));
        }
        Elements points = element.getChildElements(Point.getName(getDDMSVersion()), gmlNamespace);
        for (int i = 0; i < points.size(); i++) {
          _points.add(new Point(points.get(i)));
        }
View Full Code Here

Examples of ca.carleton.gcrc.geom.Polygon

   
    return lineString;
  }
 
  private Polygon parsePolygon(BufferedReader br) throws Exception {
    Polygon polygon = new Polygon();
   
    skipWhiteSpaces(br);
    popLeftParen(br);
   
    LineString ls = parseLineString(br);
    polygon.addLinearRing(ls);
    skipWhiteSpaces(br);
    while( false == checkForRightParen(br) ){
      popComma(br);
     
      ls = parseLineString(br);
      polygon.addLinearRing(ls);
      skipWhiteSpaces(br);
    }
   
    popRightParen(br);
   
View Full Code Here

Examples of chunmap.model.geom.Polygon

  @Test
  public void testGetIM() {
    WktReader wkt = new WktReader();
    Geometry g = wkt.read("POLYGON((1 2,3 1,4 0,3 -2,0 0,1 2))");
    Polygon pg = (Polygon) g;
    GeoPoint p1 = new GeoPoint(1, 0);
    GeoPoint p2 = new GeoPoint(2, 2);

    IntersectionMatrix rt = ComputeImFactory.getInstance().getImComputer(p1, pg).getIM();
    IntersectionMatrix rt2 = ComputeImFactory.getInstance().getImComputer(p2, pg).getIM();
View Full Code Here

Examples of com.badlogic.gdx.math.Polygon

          for (int i = 0; i < points.length; i++) {
            String[] point = points[i].split(",");
            vertices[i * 2] = Float.parseFloat(point[0]) * scaleX;
            vertices[i * 2 + 1] = -Float.parseFloat(point[1]) * scaleY;
          }
          Polygon polygon = new Polygon(vertices);
          polygon.setPosition(x, y);
          object = new PolygonMapObject(polygon);
        } else if ((child = element.getChildByName("polyline")) != null) {
          String[] points = child.getAttribute("points").split(" ");
          float[] vertices = new float[points.length * 2];
          for (int i = 0; i < points.length; i++) {
View Full Code Here

Examples of com.esri.core.geometry.Polygon

      LogUtils.Log_ArgumentsNull(LOG);
      return null;
    }

    try {
      Polygon mPolygon = new Polygon();

      int arg_idx=0;
      for (List<DoubleWritable> multipath : multipaths)
        {
          if (multipath.size() %2 != 0){
            LogUtils.Log_VariableArgumentLengthXY(LOG, arg_idx);
            return null;
          }

          mPolygon.startPath(multipath.get(0).get(), multipath.get(0).get());

          for (int i=2;i<multipath.size();i+=2){
            mPolygon.lineTo(multipath.get(i).get(), multipath.get(i+1).get());
          }

          mPolygon.closeAllPaths();

          arg_idx++;
        }

      return GeometryUtils.geometryToEsriShapeBytesWritable(OGCGeometry.createFromEsriGeometry(mPolygon, null, true));
View Full Code Here

Examples of com.google.code.appengine.awt.Polygon

        int x1 = getX( di, currentValue );
        int y1 = getY( di, currentValue );

        if( props.getFillRadar() )
        {
          Polygon p = new Polygon();
          p.addPoint( c0, c1 );
          p.addPoint( x0, y0 );
          p.addPoint( x1, y1 );
          // make color translucent
          if( paint instanceof Color )
          {
            Color color = (Color) paint;
            g.setPaint( new Color( color.getRed(), color.getGreen(),
View Full Code Here

Examples of com.google.gwt.maeglin89273.game.ashinyballonthecross.client.core.creation.shape.Polygon

  /* (non-Javadoc)
   * @see com.google.gwt.maeglin89273.game.ashinyballonthecross.client.core.dot.BombDot#generateShape(com.google.gwt.maeglin89273.game.mengine.physics.Point, double)
   */
  @Override
  protected PhysicalShape generateShape(Point position, double angle) {
    return new Polygon(this.controller, position, angle ,Polygon.generateRandomInscribedPolygonVertices(3+Random.nextInt(6), 13+Random.nextInt(3)), dotColor);
  }
View Full Code Here

Examples of com.google.gwt.maps.client.overlay.Polygon

            "BBBBB", 1);
        polylines[1].setColor("#ff0000");
        polylines[1].setWeight(2);
        polylines[1].setOpacity(0.7);

        Polygon theFountain = Polygon.fromEncoded(polylines, true, "#ff0000",
            0.2, true);
        map.addOverlay(theFountain);
      }
        break;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.