Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/jdk/java/awt/Graphics2D/Headless/HeadlessRectangle.java
41153 views
1
/*
2
* Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation.
8
*
9
* This code is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
* version 2 for more details (a copy is included in the LICENSE file that
13
* accompanied this code).
14
*
15
* You should have received a copy of the GNU General Public License version
16
* 2 along with this work; if not, write to the Free Software Foundation,
17
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18
*
19
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20
* or visit www.oracle.com if you need additional information or have any
21
* questions.
22
*/
23
24
import java.awt.*;
25
26
/*
27
* @test
28
* @summary Check that Rectangle constructors and methods do not throw unexpected
29
* exceptions in headless mode
30
* @run main/othervm -Djava.awt.headless=true HeadlessRectangle
31
*/
32
33
public class HeadlessRectangle {
34
public static void main(String args[]) {
35
Rectangle r;
36
r = new Rectangle();
37
r = new Rectangle(new Rectangle());
38
r = new Rectangle(100, 200);
39
r = new Rectangle(new Point(100, 200), new Dimension(300, 400));
40
r = new Rectangle(new Point(100, 200));
41
r = new Rectangle(new Dimension(300, 400));
42
r = new Rectangle(100, 200, 300, 400);
43
r.getX();
44
r.getY();
45
r.getWidth();
46
r.getHeight();
47
r.getBounds();
48
r.getBounds2D();
49
r.getLocation();
50
r.getSize();
51
r.contains(new Point(1, 2));
52
r.contains(1, 2);
53
r.contains(new Rectangle(1, 2, 3, 4));
54
r.contains(1, 2, 3, 4);
55
r.add(1, 2);
56
r.add(new Point(1, 2));
57
r.add(new Rectangle(1, 2, 3, 4));
58
r.grow(1, 2);
59
r.isEmpty();
60
r.toString();
61
r.hashCode();
62
r.getMinX();
63
r.getMinY();
64
r.getMaxX();
65
r.getMaxY();
66
r.getCenterX();
67
r.getCenterY();
68
r.getFrame();
69
}
70
}
71
72