Package java.awt

Examples of java.awt.Polygon.reset()


    }
   
    // *** Clipping for bottom and right borders ***
    // We have the same number of vertices as before, so it's efficient to
    // reuse the polygon 
    p.reset();
    p.addPoint(x + width, y);
    p.addPoint(x + width, y + height);
    p.addPoint(x, y + height);
    p.addPoint(x + borderWidth, y + height - borderWidth);
    p.addPoint(x + width - borderWidth, y + height - borderWidth);
View Full Code Here


                switch (pi.currentSegment(coords)) {
                    case PathIterator.SEG_MOVETO:
                        if (p.npoints > 1) {
                            drawPolyline(sg2d, p.xpoints, p.ypoints, p.npoints);
                        }
                        p.reset();
                        p.addPoint((int) Math.floor(coords[0]),
                            (int) Math.floor(coords[1]));
                        break;
                    case PathIterator.SEG_LINETO:
                        if (p.npoints == 0) {
View Full Code Here

    }

    public void testReset() {
        Polygon pg = new Polygon(new int[]{1, 2, 3, 4, 5, 6}, new int[]{7, 8, 9, 10, 11, 12}, 3);
        assertTrue(pg.npoints > 0);
        pg.reset();
        assertTrue(pg.npoints == 0);
    }

    public void testInvalidate() {
        Polygon pg = new Polygon(new int[]{1, 2, 3}, new int[]{4, 5, 6}, 3);
View Full Code Here

    }

    public void testReset() {
        Polygon pg = new Polygon(new int[]{1, 2, 3, 4, 5, 6}, new int[]{7, 8, 9, 10, 11, 12}, 3);
        assertTrue(pg.npoints > 0);
        pg.reset();
        assertTrue(pg.npoints == 0);
    }

    public void testInvalidate() {
        Polygon pg = new Polygon(new int[]{1, 2, 3}, new int[]{4, 5, 6}, 3);
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.