1 /*
2 * Copyright (c) 2001, 2002, 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. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
32 * A class which tags a window with a particular semantic usage,
33 * either tooltip, menu, sub-menu, popup-menu, or comobobox-popup.
34 * This is used as a temporary solution for getting native AWT support
35 * for transition effects in Windows 98 and Windows 2000. The native
36 * code will interpret the windowType property and automatically
37 * implement appropriate animation when the window is shown/hidden.
38 * <p>
39 * Note that support for transition effects may be supported with a
40 * different mechanism in the future and so this class is
41 * package-private and targeted for Swing implementation use only.
42 * <p>
43 * <strong>Warning:</strong>
44 * Serialized objects of this class will not be compatible with
45 * future Swing releases. The current serialization support is appropriate
46 * for short term storage or RMI between applications running the same
47 * version of Swing. A future release of Swing will provide support for
48 * long term persistence.
49 *
50 * @author Amy Fowler
51 */
52 class WindowsPopupWindow extends JWindow {
53
54 static final int UNDEFINED_WINDOW_TYPE = 0;
55 static final int TOOLTIP_WINDOW_TYPE = 1;
56 static final int MENU_WINDOW_TYPE = 2;
57 static final int SUBMENU_WINDOW_TYPE = 3;
58 static final int POPUPMENU_WINDOW_TYPE = 4;
59 static final int COMBOBOX_POPUP_WINDOW_TYPE = 5;
60
61 private int windowType;
62
63 WindowsPopupWindow(Window parent) {
64 super(parent);
65 setFocusableWindowState(false);
66 }
67
68 void setWindowType(int type) {
69 windowType = type;
70 }
71
|
1 /*
2 * Copyright (c) 2001, 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. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
32 * A class which tags a window with a particular semantic usage,
33 * either tooltip, menu, sub-menu, popup-menu, or comobobox-popup.
34 * This is used as a temporary solution for getting native AWT support
35 * for transition effects in Windows 98 and Windows 2000. The native
36 * code will interpret the windowType property and automatically
37 * implement appropriate animation when the window is shown/hidden.
38 * <p>
39 * Note that support for transition effects may be supported with a
40 * different mechanism in the future and so this class is
41 * package-private and targeted for Swing implementation use only.
42 * <p>
43 * <strong>Warning:</strong>
44 * Serialized objects of this class will not be compatible with
45 * future Swing releases. The current serialization support is appropriate
46 * for short term storage or RMI between applications running the same
47 * version of Swing. A future release of Swing will provide support for
48 * long term persistence.
49 *
50 * @author Amy Fowler
51 */
52 @SuppressWarnings("serial") // Superclass is not serializable across versions
53 class WindowsPopupWindow extends JWindow {
54
55 static final int UNDEFINED_WINDOW_TYPE = 0;
56 static final int TOOLTIP_WINDOW_TYPE = 1;
57 static final int MENU_WINDOW_TYPE = 2;
58 static final int SUBMENU_WINDOW_TYPE = 3;
59 static final int POPUPMENU_WINDOW_TYPE = 4;
60 static final int COMBOBOX_POPUP_WINDOW_TYPE = 5;
61
62 private int windowType;
63
64 WindowsPopupWindow(Window parent) {
65 super(parent);
66 setFocusableWindowState(false);
67 }
68
69 void setWindowType(int type) {
70 windowType = type;
71 }
72
|