jdk/test/javax/swing/Headless/HeadlessJTree.java
author vromero
Thu, 05 Jan 2017 11:16:39 -0800
changeset 43033 c37b643739a7
parent 30469 bac0a7ff7e1e
permissions -rw-r--r--
8148100: Convert lambda most specific positive tests to check runtime behavior Reviewed-by: mcimadamore Contributed-by: bsrbnd@gmail.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25203
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
     1
/*
30469
bac0a7ff7e1e 8074028: Remove API references to java.awt.peer
serb
parents: 25203
diff changeset
     2
 * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
25203
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
     4
 *
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
     7
 * published by the Free Software Foundation.
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
     8
 *
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    13
 * accompanied this code).
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    14
 *
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    18
 *
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    21
 * questions.
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    22
 */
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    23
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    24
import javax.swing.*;
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    25
import javax.swing.tree.DefaultMutableTreeNode;
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    26
import javax.swing.tree.DefaultTreeCellRenderer;
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    27
import javax.swing.tree.DefaultTreeModel;
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    28
import java.awt.*;
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    29
import java.util.Locale;
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    30
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    31
/*
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    32
 * @test
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    33
 * @summary Check that JTree constructors and methods do not throw unexpected
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    34
 *          exceptions in headless mode
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    35
 * @run main/othervm -Djava.awt.headless=true HeadlessJTree
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    36
 */
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    37
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    38
public class HeadlessJTree {
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    39
    public static void main(String args[]) {
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    40
        JTree t;
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    41
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    42
        DefaultMutableTreeNode root = new DefaultMutableTreeNode("JTree");
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    43
        DefaultMutableTreeNode parent;
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    44
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    45
        parent = new DefaultMutableTreeNode("colors");
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    46
        root.add(parent);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    47
        parent.add(new DefaultMutableTreeNode("blue"));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    48
        parent.add(new DefaultMutableTreeNode("violet"));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    49
        parent.add(new DefaultMutableTreeNode("red"));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    50
        parent.add(new DefaultMutableTreeNode("yellow"));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    51
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    52
        parent = new DefaultMutableTreeNode("sports");
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    53
        root.add(parent);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    54
        parent.add(new DefaultMutableTreeNode("basketball"));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    55
        parent.add(new DefaultMutableTreeNode("soccer"));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    56
        parent.add(new DefaultMutableTreeNode("football"));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    57
        parent.add(new DefaultMutableTreeNode("hockey"));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    58
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    59
        parent = new DefaultMutableTreeNode("food");
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    60
        root.add(parent);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    61
        parent.add(new DefaultMutableTreeNode("hot dogs"));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    62
        parent.add(new DefaultMutableTreeNode("pizza"));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    63
        parent.add(new DefaultMutableTreeNode("ravioli"));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    64
        parent.add(new DefaultMutableTreeNode("bananas"));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    65
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    66
        t = new JTree(root);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    67
        t = new JTree(new DefaultTreeModel(root));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    68
        t.setCellRenderer(new DefaultTreeCellRenderer() {
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    69
            public Component getTreeCellRendererComponent(
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    70
                    JTree tree, Object value, boolean selected, boolean expanded,
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    71
                    boolean leaf, int row, boolean hasFocus) {
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    72
                return super.getTreeCellRendererComponent(
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    73
                        tree, value, selected, expanded,
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    74
                        leaf, row, hasFocus);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    75
            }
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    76
        });
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    77
        t.getCellRenderer();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    78
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    79
        t.getAccessibleContext();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    80
        t.isFocusTraversable();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    81
        t.setEnabled(false);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    82
        t.setEnabled(true);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    83
        t.requestFocus();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    84
        t.requestFocusInWindow();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    85
        t.getPreferredSize();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    86
        t.getMaximumSize();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    87
        t.getMinimumSize();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    88
        t.contains(1, 2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    89
        Component c1 = t.add(new Component(){});
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    90
        Component c2 = t.add(new Component(){});
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    91
        Component c3 = t.add(new Component(){});
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    92
        Insets ins = t.getInsets();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    93
        t.getAlignmentY();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    94
        t.getAlignmentX();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    95
        t.getGraphics();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    96
        t.setVisible(false);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    97
        t.setVisible(true);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    98
        t.setForeground(Color.red);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
    99
        t.setBackground(Color.red);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   100
        for (String font : Toolkit.getDefaultToolkit().getFontList()) {
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   101
            for (int j = 8; j < 17; j++) {
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   102
                Font f1 = new Font(font, Font.PLAIN, j);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   103
                Font f2 = new Font(font, Font.BOLD, j);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   104
                Font f3 = new Font(font, Font.ITALIC, j);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   105
                Font f4 = new Font(font, Font.BOLD | Font.ITALIC, j);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   106
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   107
                t.setFont(f1);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   108
                t.setFont(f2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   109
                t.setFont(f3);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   110
                t.setFont(f4);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   111
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   112
                t.getFontMetrics(f1);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   113
                t.getFontMetrics(f2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   114
                t.getFontMetrics(f3);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   115
                t.getFontMetrics(f4);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   116
            }
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   117
        }
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   118
        t.enable();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   119
        t.disable();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   120
        t.reshape(10, 10, 10, 10);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   121
        t.getBounds(new Rectangle(1, 1, 1, 1));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   122
        t.getSize(new Dimension(1, 2));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   123
        t.getLocation(new Point(1, 2));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   124
        t.getX();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   125
        t.getY();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   126
        t.getWidth();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   127
        t.getHeight();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   128
        t.isOpaque();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   129
        t.isValidateRoot();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   130
        t.isOptimizedDrawingEnabled();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   131
        t.isDoubleBuffered();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   132
        t.getComponentCount();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   133
        t.countComponents();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   134
        t.getComponent(1);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   135
        t.getComponent(2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   136
        Component[] cs = t.getComponents();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   137
        t.getLayout();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   138
        t.setLayout(new FlowLayout());
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   139
        t.doLayout();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   140
        t.layout();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   141
        t.invalidate();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   142
        t.validate();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   143
        t.remove(0);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   144
        t.remove(c2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   145
        t.removeAll();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   146
        t.preferredSize();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   147
        t.minimumSize();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   148
        t.getComponentAt(1, 2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   149
        t.locate(1, 2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   150
        t.getComponentAt(new Point(1, 2));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   151
        t.isFocusCycleRoot(new Container());
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   152
        t.transferFocusBackward();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   153
        t.setName("goober");
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   154
        t.getName();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   155
        t.getParent();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   156
        t.getGraphicsConfiguration();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   157
        t.getTreeLock();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   158
        t.getToolkit();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   159
        t.isValid();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   160
        t.isDisplayable();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   161
        t.isVisible();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   162
        t.isShowing();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   163
        t.isEnabled();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   164
        t.enable(false);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   165
        t.enable(true);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   166
        t.enableInputMethods(false);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   167
        t.enableInputMethods(true);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   168
        t.show();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   169
        t.show(false);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   170
        t.show(true);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   171
        t.hide();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   172
        t.getForeground();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   173
        t.isForegroundSet();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   174
        t.getBackground();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   175
        t.isBackgroundSet();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   176
        t.getFont();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   177
        t.isFontSet();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   178
        Container c = new Container();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   179
        c.add(t);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   180
        t.getLocale();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   181
        for (Locale locale : Locale.getAvailableLocales())
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   182
            t.setLocale(locale);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   183
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   184
        t.getColorModel();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   185
        t.getLocation();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   186
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   187
        boolean exceptions = false;
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   188
        try {
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   189
            t.getLocationOnScreen();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   190
        } catch (IllegalComponentStateException e) {
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   191
            exceptions = true;
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   192
        }
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   193
        if (!exceptions)
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   194
            throw new RuntimeException("IllegalComponentStateException did not occur when expected");
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   195
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   196
        t.location();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   197
        t.setLocation(1, 2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   198
        t.move(1, 2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   199
        t.setLocation(new Point(1, 2));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   200
        t.getSize();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   201
        t.size();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   202
        t.setSize(1, 32);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   203
        t.resize(1, 32);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   204
        t.setSize(new Dimension(1, 32));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   205
        t.resize(new Dimension(1, 32));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   206
        t.getBounds();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   207
        t.bounds();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   208
        t.setBounds(10, 10, 10, 10);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   209
        t.setBounds(new Rectangle(10, 10, 10, 10));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   210
        t.isLightweight();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   211
        t.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   212
        t.getCursor();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   213
        t.isCursorSet();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   214
        t.inside(1, 2);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   215
        t.contains(new Point(1, 2));
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   216
        t.isFocusable();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   217
        t.setFocusable(true);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   218
        t.setFocusable(false);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   219
        t.transferFocus();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   220
        t.getFocusCycleRootAncestor();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   221
        t.nextFocus();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   222
        t.transferFocusUpCycle();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   223
        t.hasFocus();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   224
        t.isFocusOwner();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   225
        t.toString();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   226
        t.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   227
        t.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   228
        t.setComponentOrientation(ComponentOrientation.UNKNOWN);
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   229
        t.getComponentOrientation();
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   230
    }
ea684628f900 8047180: Move functional tests AWT_Headless/Automated to OpenJDK repository
yan
parents:
diff changeset
   231
}