Package java.awt.geom

Examples of java.awt.geom.GeneralPath.lineTo()


        GeneralPath path = new GeneralPath();
        path.moveTo((float) ul.getX(), (float) ul.getY());
        path.lineTo((float) ur.getX(), (float) ur.getY());
        path.lineTo((float) lr.getX(), (float) lr.getY());
        path.lineTo((float) ll.getX(), (float) ll.getY());
        path.closePath();

        return path;
    }
View Full Code Here


                float lasty = zeroY;
                for (int i = 0; i < numBins; i++) {
                    int y = s.yscale(bins[c][i]);
                    float x = xstep * i + minx;
                    if (lasty != zeroY || y != zeroY) {
                        gp.lineTo(x, y);
                        lastx = x;
                        lasty = y;
                    }
                }
                if (lasty != zeroY)
View Full Code Here

                        lastx = x;
                        lasty = y;
                    }
                }
                if (lasty != zeroY)
                    gp.lineTo(lastx, zeroY);

                g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.4f));
                g2d.fill(gp);
                g2d.setComposite(AlphaComposite.SrcOver);
                g2d.draw(gp);
View Full Code Here

        int[] ycoords = { y, y + 50, y + 50 };
        GeneralPath polygon = new GeneralPath(GeneralPath.WIND_EVEN_ODD, xcoords.length);
        polygon.moveTo(x + 25, y);
        for (int i = 0; i < xcoords.length; i++)
        {
            polygon.lineTo(xcoords[i], ycoords[i]);
        }
        polygon.closePath();
        g2.fill(polygon);
        BasicStroke wideStroke = new BasicStroke(2.0f);
        g2.setColor(Color.black);
View Full Code Here

            int[] ycoords = { y, y + 50, y + 50 };
            GeneralPath polygon = new GeneralPath(GeneralPath.WIND_EVEN_ODD, xcoords.length);
            polygon.moveTo(x + 25, y);
            for (int i = 0; i < xcoords.length; i++)
            {
                polygon.lineTo(xcoords[i], ycoords[i]);
            }
            polygon.closePath();
            g2.fill(polygon);
            BasicStroke wideStroke = new BasicStroke(2.0f);
            g2.setColor(Color.black);
View Full Code Here

            int[] ycoords = { y, y + 50, y + 50, y };
            GeneralPath polygon = new GeneralPath(GeneralPath.WIND_EVEN_ODD, xcoords.length);
            polygon.moveTo(x + 25, y);
            for (int i = 0; i < xcoords.length; i++)
            {
                polygon.lineTo(xcoords[i], ycoords[i]);
            }
            polygon.closePath();
            g2.fill(polygon);
            BasicStroke wideStroke = new BasicStroke(2.0f);
            g2.setColor(Color.black);
View Full Code Here

    Point2D viewPoint = toPoint(lineString.getCoordinateN(0));
    shape.moveTo((float) viewPoint.getX(), (float) viewPoint.getY());

    for (int i = 1; i < lineString.getNumPoints(); i++) {
      viewPoint = toPoint(lineString.getCoordinateN(i));
      shape.lineTo((float) viewPoint.getX(), (float) viewPoint.getY());
    }
    return shape;
  }

  private Shape toShape(Point point)
View Full Code Here

     * Some checks for the serialization of a GeneralPath instance.
     */
    public void testGeneralPathSerialization() {
        GeneralPath g1 = new GeneralPath();
        g1.moveTo(1.0f, 2.0f);
        g1.lineTo(3.0f, 4.0f);
        g1.curveTo(5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);
        g1.quadTo(1.0f, 2.0f, 3.0f, 4.0f);
        g1.closePath();
        GeneralPath g2 = null;
        try {
View Full Code Here

                    switch (type) {
                        case PathIterator.SEG_MOVETO :
                            gp.moveTo(args[0], args[1]);
                            break;
                        case PathIterator.SEG_LINETO :
                            gp.lineTo(args[0], args[1]);
                            break;
                        case PathIterator.SEG_CUBICTO :
                            gp.curveTo(args[0], args[1], args[2],
                                    args[3], args[4], args[5]);
                            break;
View Full Code Here

        for (int i =0; i<points.size ();i++)
        {
            p = points.get (i);
            w = new Point2D.Double (p.getX (), p.getY ());
            v = w2v.transform (w, null);
            polyline.lineTo ((int) v.getX (), (int) v.getY ());
        }
       
        return polyline;
    }
   
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.