1 /*
2 * Copyright (c) 2013, 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
25 import java.awt.*;
26 import java.awt.datatransfer.Clipboard;
27 import java.awt.dnd.DragGestureEvent;
28 import java.awt.dnd.InvalidDnDOperationException;
29 import java.awt.dnd.peer.DragSourceContextPeer;
30 import java.awt.font.TextAttribute;
31 import java.awt.im.InputMethodHighlight;
32 import java.awt.image.ColorModel;
33 import java.awt.image.ImageObserver;
34 import java.awt.image.ImageProducer;
35 import java.awt.peer.*;
36 import java.net.URL;
37 import java.util.Map;
38 import java.util.Properties;
39
40
41 /**
42 * @test
43 * @bug 7172833
44 * @summary java.awt.Toolkit methods is/setDynamicLayout() should be consistent.
45 * @author Sergey Bylokhov
46 */
47 public final class bug7172833 {
48
49 public static void main(final String[] args) throws Exception {
50 final StubbedToolkit t = new StubbedToolkit();
51
52 t.setDynamicLayout(true);
53 if(!t.isDynamicLayoutSet()){
54 throw new RuntimeException("'true' expected but 'false' returned");
55 }
56
57 t.setDynamicLayout(false);
58 if(t.isDynamicLayoutSet()){
59 throw new RuntimeException("'false' expected but 'true' returned");
60 }
61 }
62
|
1 /*
2 * Copyright (c) 2013, 2016, 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
25 import java.awt.*;
26 import java.awt.datatransfer.Clipboard;
27 import java.awt.dnd.DragGestureEvent;
28 import java.awt.dnd.InvalidDnDOperationException;
29 import java.awt.dnd.peer.DragSourceContextPeer;
30 import java.awt.font.TextAttribute;
31 import java.awt.im.InputMethodHighlight;
32 import java.awt.image.ColorModel;
33 import java.awt.image.ImageObserver;
34 import java.awt.image.ImageProducer;
35 import java.awt.peer.*;
36 import java.net.URL;
37 import java.util.Map;
38 import java.util.Properties;
39
40
41 /**
42 * @test
43 * @key headful
44 * @bug 7172833
45 * @summary java.awt.Toolkit methods is/setDynamicLayout() should be consistent.
46 * @author Sergey Bylokhov
47 */
48 public final class bug7172833 {
49
50 public static void main(final String[] args) throws Exception {
51 final StubbedToolkit t = new StubbedToolkit();
52
53 t.setDynamicLayout(true);
54 if(!t.isDynamicLayoutSet()){
55 throw new RuntimeException("'true' expected but 'false' returned");
56 }
57
58 t.setDynamicLayout(false);
59 if(t.isDynamicLayoutSet()){
60 throw new RuntimeException("'false' expected but 'true' returned");
61 }
62 }
63
|