Package java.awt

Examples of java.awt.Polygon.invalidate()


        Polygon pg = new Polygon(new int[]{1, 2, 3}, new int[]{4, 5, 6}, 3);
        assertEquals(new Rectangle(1, 4, 2, 2), pg.getBounds());
        pg.xpoints[0] = 0;
        pg.ypoints[0] = -1;
        assertEquals(new Rectangle(1, 4, 2, 2), pg.getBounds());
        pg.invalidate();
        assertEquals(new Rectangle(0, -1, 3, 7), pg.getBounds());
    }

    public void testAddPoint() {
        Polygon pg = new Polygon(new int[]{1, 2, 3, 4, 5, 6}, new int[]{7, 8, 9, 10, 11, 12}, 3);
View Full Code Here


        Polygon pg = new Polygon(new int[]{1, 2, 3}, new int[]{4, 5, 6}, 3);
        assertEquals(new Rectangle(1, 4, 2, 2), pg.getBounds());
        pg.xpoints[0] = 0;
        pg.ypoints[0] = -1;
        assertEquals(new Rectangle(1, 4, 2, 2), pg.getBounds());
        pg.invalidate();
        assertEquals(new Rectangle(0, -1, 3, 7), pg.getBounds());
    }

    public void testAddPoint() {
        Polygon pg = new Polygon(new int[]{1, 2, 3, 4, 5, 6}, new int[]{7, 8, 9, 10, 11, 12}, 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.