20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24
25 import java.awt.Rectangle;
26 import java.awt.geom.AffineTransform;
27 import java.awt.geom.GeneralPath;
28 import java.awt.geom.IllegalPathStateException;
29 import java.awt.geom.Path2D;
30 import java.awt.geom.PathIterator;
31 import java.awt.geom.Point2D;
32 import java.awt.geom.Rectangle2D;
33 import java.util.Arrays;
34
35 /**
36 * @test
37 * @bug 8076419
38 * @summary Check Path2D copy constructor (trims arrays)
39 * and constructor with zero capacity
40 * @run main Path2DTrimCopy
41 */
42 public class Path2DCopyConstructor {
43
44 private final static float EPSILON = 5e-6f;
45 private final static float FLATNESS = 1e-2f;
46
47 private final static AffineTransform at
48 = AffineTransform.getScaleInstance(1.3, 2.4);
49
50 private final static Rectangle2D.Double rect2d
51 = new Rectangle2D.Double(3.2, 4.1, 5.0, 10.0);
52
53 private final static Point2D.Double pt2d
54 = new Point2D.Double(2.0, 2.5);
55
56 public static boolean verbose;
57
58 static void log(String msg) {
59 if (verbose) {
60 System.out.println(msg);
|
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24
25 import java.awt.Rectangle;
26 import java.awt.geom.AffineTransform;
27 import java.awt.geom.GeneralPath;
28 import java.awt.geom.IllegalPathStateException;
29 import java.awt.geom.Path2D;
30 import java.awt.geom.PathIterator;
31 import java.awt.geom.Point2D;
32 import java.awt.geom.Rectangle2D;
33 import java.util.Arrays;
34
35 /**
36 * @test
37 * @bug 8076419
38 * @summary Check Path2D copy constructor (trims arrays)
39 * and constructor with zero capacity
40 * @run main Path2DCopyConstructor
41 */
42 public class Path2DCopyConstructor {
43
44 private final static float EPSILON = 5e-6f;
45 private final static float FLATNESS = 1e-2f;
46
47 private final static AffineTransform at
48 = AffineTransform.getScaleInstance(1.3, 2.4);
49
50 private final static Rectangle2D.Double rect2d
51 = new Rectangle2D.Double(3.2, 4.1, 5.0, 10.0);
52
53 private final static Point2D.Double pt2d
54 = new Point2D.Double(2.0, 2.5);
55
56 public static boolean verbose;
57
58 static void log(String msg) {
59 if (verbose) {
60 System.out.println(msg);
|