author | anthony |
Thu, 26 Mar 2009 14:38:46 +0300 | |
changeset 2472 | b7aba00cabb6 |
parent 2465 | 1a6452b990cf |
child 2808 | a139a919f645 |
permissions | -rw-r--r-- |
1978
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
1 |
/* |
2451 | 2 |
* Copyright 2008-2009 Sun Microsystems, Inc. All Rights Reserved. |
1978
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
4 |
* |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. Sun designates this |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
8 |
* particular file as subject to the "Classpath" exception as provided |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
9 |
* by Sun in the LICENSE file that accompanied this code. |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
10 |
* |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
15 |
* accompanied this code). |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
16 |
* |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
17 |
* You should have received a copy of the GNU General Public License version |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
20 |
* |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
21 |
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
22 |
* CA 95054 USA or visit www.sun.com if you need additional information or |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
23 |
* have any questions. |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
24 |
*/ |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
25 |
|
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
26 |
package sun.awt; |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
27 |
|
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
28 |
import java.awt.*; |
2451 | 29 |
import java.awt.geom.Point2D; |
30 |
import java.awt.image.BufferedImage; |
|
31 |
||
1978
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
32 |
import sun.misc.Unsafe; |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
33 |
|
2464
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
34 |
/** |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
35 |
* The AWTAccessor utility class. |
1978
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
36 |
* The main purpose of this class is to enable accessing |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
37 |
* private and package-private fields of classes from |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
38 |
* different classes/packages. See sun.misc.SharedSecretes |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
39 |
* for another example. |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
40 |
*/ |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
41 |
public final class AWTAccessor { |
2451 | 42 |
|
1978
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
43 |
private static final Unsafe unsafe = Unsafe.getUnsafe(); |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
44 |
|
2451 | 45 |
/* |
46 |
* We don't need any objects of this class. |
|
1978
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
47 |
* It's rather a collection of static methods |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
48 |
* and interfaces. |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
49 |
*/ |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
50 |
private AWTAccessor() { |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
51 |
} |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
52 |
|
2451 | 53 |
/* |
54 |
* An interface of accessor for the java.awt.Component class. |
|
1978
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
55 |
*/ |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
56 |
public interface ComponentAccessor { |
2451 | 57 |
/* |
58 |
* Sets whether the native background erase for a component |
|
59 |
* has been disabled via SunToolkit.disableBackgroundErase(). |
|
60 |
*/ |
|
61 |
void setBackgroundEraseDisabled(Component comp, boolean disabled); |
|
62 |
/* |
|
63 |
* Indicates whether the native background erase for a |
|
64 |
* component has been disabled via |
|
65 |
* SunToolkit.disableBackgroundErase(). |
|
66 |
*/ |
|
67 |
boolean getBackgroundEraseDisabled(Component comp); |
|
68 |
/* |
|
69 |
* |
|
70 |
* Gets the bounds of this component in the form of a |
|
71 |
* <code>Rectangle</code> object. The bounds specify this |
|
72 |
* component's width, height, and location relative to |
|
73 |
* its parent. |
|
74 |
*/ |
|
75 |
Rectangle getBounds(Component comp); |
|
76 |
/* |
|
1978
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
77 |
* Sets the shape of a lw component to cut out from hw components. |
2451 | 78 |
* |
79 |
* See 6797587, 6776743, 6768307, and 6768332 for details |
|
1978
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
80 |
*/ |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
81 |
void setMixingCutoutShape(Component comp, Shape shape); |
2459
08f3416ff334
6804747: Ensure consistent graphicsConfig member across components hierarchy
anthony
parents:
2453
diff
changeset
|
82 |
|
08f3416ff334
6804747: Ensure consistent graphicsConfig member across components hierarchy
anthony
parents:
2453
diff
changeset
|
83 |
/** |
08f3416ff334
6804747: Ensure consistent graphicsConfig member across components hierarchy
anthony
parents:
2453
diff
changeset
|
84 |
* Sets GraphicsConfiguration value for the component. |
08f3416ff334
6804747: Ensure consistent graphicsConfig member across components hierarchy
anthony
parents:
2453
diff
changeset
|
85 |
*/ |
08f3416ff334
6804747: Ensure consistent graphicsConfig member across components hierarchy
anthony
parents:
2453
diff
changeset
|
86 |
void setGraphicsConfiguration(Component comp, GraphicsConfiguration gc); |
2464
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
87 |
/* |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
88 |
* Requests focus to the component. |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
89 |
*/ |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
90 |
boolean requestFocus(Component comp, CausedFocusEvent.Cause cause); |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
91 |
/* |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
92 |
* Determines if the component can gain focus. |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
93 |
*/ |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
94 |
boolean canBeFocusOwner(Component comp); |
2472
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
2465
diff
changeset
|
95 |
|
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
2465
diff
changeset
|
96 |
/** |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
2465
diff
changeset
|
97 |
* Returns whether the component is visible without invoking |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
2465
diff
changeset
|
98 |
* any client code. |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
2465
diff
changeset
|
99 |
*/ |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
2465
diff
changeset
|
100 |
boolean isVisible_NoClientCode(Component comp); |
1978
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
101 |
} |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
102 |
|
2451 | 103 |
/* |
104 |
* An interface of accessor for java.awt.Window class. |
|
105 |
*/ |
|
106 |
public interface WindowAccessor { |
|
107 |
/* |
|
108 |
* Get opacity level of the given window. |
|
109 |
*/ |
|
110 |
float getOpacity(Window window); |
|
111 |
/* |
|
112 |
* Set opacity level to the given window. |
|
113 |
*/ |
|
114 |
void setOpacity(Window window, float opacity); |
|
115 |
/* |
|
116 |
* Get a shape assigned to the given window. |
|
117 |
*/ |
|
118 |
Shape getShape(Window window); |
|
119 |
/* |
|
120 |
* Set a shape to the given window. |
|
121 |
*/ |
|
122 |
void setShape(Window window, Shape shape); |
|
123 |
/* |
|
124 |
* Identify whether the given window is opaque (true) |
|
125 |
* or translucent (false). |
|
126 |
*/ |
|
127 |
boolean isOpaque(Window window); |
|
128 |
/* |
|
129 |
* Set the opaque preoperty to the given window. |
|
130 |
*/ |
|
131 |
void setOpaque(Window window, boolean isOpaque); |
|
132 |
/* |
|
133 |
* Update the image of a non-opaque (translucent) window. |
|
134 |
*/ |
|
135 |
void updateWindow(Window window, BufferedImage backBuffer); |
|
2472
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
2465
diff
changeset
|
136 |
|
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
2465
diff
changeset
|
137 |
/** Get the size of the security warning. |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
2465
diff
changeset
|
138 |
*/ |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
2465
diff
changeset
|
139 |
Dimension getSecurityWarningSize(Window w); |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
2465
diff
changeset
|
140 |
|
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
2465
diff
changeset
|
141 |
/** |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
2465
diff
changeset
|
142 |
* Set the size of the security warning. |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
2465
diff
changeset
|
143 |
*/ |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
2465
diff
changeset
|
144 |
void setSecurityWarningSize(Window w, int width, int height); |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
2465
diff
changeset
|
145 |
|
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
2465
diff
changeset
|
146 |
/** Set the position of the security warning. |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
2465
diff
changeset
|
147 |
*/ |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
2465
diff
changeset
|
148 |
void setSecurityWarningPosition(Window w, Point2D point, |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
2465
diff
changeset
|
149 |
float alignmentX, float alignmentY); |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
2465
diff
changeset
|
150 |
|
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
2465
diff
changeset
|
151 |
/** Request to recalculate the new position of the security warning for |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
2465
diff
changeset
|
152 |
* the given window size/location as reported by the native system. |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
2465
diff
changeset
|
153 |
*/ |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
2465
diff
changeset
|
154 |
Point2D calculateSecurityWarningPosition(Window window, |
b7aba00cabb6
6693253: Security Warning appearance requires enhancements
anthony
parents:
2465
diff
changeset
|
155 |
double x, double y, double w, double h); |
2451 | 156 |
} |
157 |
||
158 |
/* |
|
159 |
* An accessor for the AWTEvent class. |
|
160 |
*/ |
|
161 |
public interface AWTEventAccessor { |
|
162 |
/* |
|
163 |
* |
|
164 |
* Sets the flag on this AWTEvent indicating that it was |
|
165 |
* generated by the system. |
|
166 |
*/ |
|
167 |
void setSystemGenerated(AWTEvent ev); |
|
168 |
/* |
|
169 |
* |
|
170 |
* Indicates whether this AWTEvent was generated by the system. |
|
171 |
*/ |
|
172 |
boolean isSystemGenerated(AWTEvent ev); |
|
173 |
} |
|
174 |
||
175 |
/* |
|
2453
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
176 |
* An accessor for the java.awt.Frame class. |
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
177 |
*/ |
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
178 |
public interface FrameAccessor { |
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
179 |
/* |
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
180 |
* Sets the state of this frame. |
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
181 |
*/ |
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
182 |
void setExtendedState(Frame frame, int state); |
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
183 |
/* |
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
184 |
* Gets the state of this frame. |
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
185 |
*/ |
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
186 |
int getExtendedState(Frame frame); |
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
187 |
} |
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
188 |
|
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
189 |
/* |
2465 | 190 |
* An interface of accessor for the java.awt.KeyboardFocusManager class. |
2464
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
191 |
*/ |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
192 |
public interface KeyboardFocusManagerAccessor { |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
193 |
/* |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
194 |
* Indicates whether the native implementation should |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
195 |
* proceed with a pending focus request for the heavyweight. |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
196 |
*/ |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
197 |
int shouldNativelyFocusHeavyweight(Component heavyweight, |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
198 |
Component descendant, |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
199 |
boolean temporary, |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
200 |
boolean focusedWindowChangeAllowed, |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
201 |
long time, |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
202 |
CausedFocusEvent.Cause cause); |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
203 |
/* |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
204 |
* Delivers focus for the lightweight descendant of the heavyweight |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
205 |
* synchronously. |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
206 |
*/ |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
207 |
boolean processSynchronousLightweightTransfer(Component heavyweight, |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
208 |
Component descendant, |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
209 |
boolean temporary, |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
210 |
boolean focusedWindowChangeAllowed, |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
211 |
long time); |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
212 |
/* |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
213 |
* Removes the last focus request for the heavyweight from the queue. |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
214 |
*/ |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
215 |
void removeLastFocusRequest(Component heavyweight); |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
216 |
} |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
217 |
|
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
218 |
/* |
2451 | 219 |
* The java.awt.Component class accessor object. |
1978
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
220 |
*/ |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
221 |
private static ComponentAccessor componentAccessor; |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
222 |
|
2451 | 223 |
/* |
224 |
* The java.awt.Window class accessor object. |
|
225 |
*/ |
|
226 |
private static WindowAccessor windowAccessor; |
|
227 |
||
228 |
/* |
|
229 |
* The java.awt.AWTEvent class accessor object. |
|
230 |
*/ |
|
231 |
private static AWTEventAccessor awtEventAccessor; |
|
232 |
||
233 |
/* |
|
2453
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
234 |
* The java.awt.Frame class accessor object. |
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
235 |
*/ |
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
236 |
private static FrameAccessor frameAccessor; |
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
237 |
|
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
238 |
/* |
2464
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
239 |
* The java.awt.KeyboardFocusManager class accessor object. |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
240 |
*/ |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
241 |
private static KeyboardFocusManagerAccessor kfmAccessor; |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
242 |
|
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
243 |
/* |
2451 | 244 |
* Set an accessor object for the java.awt.Component class. |
1978
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
245 |
*/ |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
246 |
public static void setComponentAccessor(ComponentAccessor ca) { |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
247 |
componentAccessor = ca; |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
248 |
} |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
249 |
|
2451 | 250 |
/* |
251 |
* Retrieve the accessor object for the java.awt.Window class. |
|
1978
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
252 |
*/ |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
253 |
public static ComponentAccessor getComponentAccessor() { |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
254 |
if (componentAccessor == null) { |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
255 |
unsafe.ensureClassInitialized(Component.class); |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
256 |
} |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
257 |
|
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
258 |
return componentAccessor; |
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
259 |
} |
2451 | 260 |
|
261 |
/* |
|
262 |
* Set an accessor object for the java.awt.Window class. |
|
263 |
*/ |
|
264 |
public static void setWindowAccessor(WindowAccessor wa) { |
|
265 |
windowAccessor = wa; |
|
266 |
} |
|
267 |
||
268 |
/* |
|
269 |
* Retrieve the accessor object for the java.awt.Window class. |
|
270 |
*/ |
|
271 |
public static WindowAccessor getWindowAccessor() { |
|
272 |
if (windowAccessor == null) { |
|
273 |
unsafe.ensureClassInitialized(Window.class); |
|
274 |
} |
|
275 |
return windowAccessor; |
|
276 |
} |
|
277 |
||
278 |
/* |
|
279 |
* Set an accessor object for the java.awt.AWTEvent class. |
|
280 |
*/ |
|
281 |
public static void setAWTEventAccessor(AWTEventAccessor aea) { |
|
282 |
awtEventAccessor = aea; |
|
283 |
} |
|
284 |
||
285 |
/* |
|
286 |
* Retrieve the accessor object for the java.awt.AWTEvent class. |
|
287 |
*/ |
|
288 |
public static AWTEventAccessor getAWTEventAccessor() { |
|
289 |
return awtEventAccessor; |
|
290 |
} |
|
2453
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
291 |
|
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
292 |
/* |
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
293 |
* Set an accessor object for the java.awt.Frame class. |
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
294 |
*/ |
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
295 |
public static void setFrameAccessor(FrameAccessor fa) { |
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
296 |
frameAccessor = fa; |
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
297 |
} |
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
298 |
|
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
299 |
/* |
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
300 |
* Retrieve the accessor object for the java.awt.Frame class. |
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
301 |
*/ |
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
302 |
public static FrameAccessor getFrameAccessor() { |
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
303 |
if (frameAccessor == null) { |
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
304 |
unsafe.ensureClassInitialized(Frame.class); |
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
305 |
} |
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
306 |
return frameAccessor; |
35e5fab82613
6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents:
2451
diff
changeset
|
307 |
} |
2464
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
308 |
|
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
309 |
/* |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
310 |
* Set an accessor object for the java.awt.KeyboardFocusManager class. |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
311 |
*/ |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
312 |
public static void setKeyboardFocusManagerAccessor(KeyboardFocusManagerAccessor kfma) { |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
313 |
kfmAccessor = kfma; |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
314 |
} |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
315 |
|
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
316 |
/* |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
317 |
* Retrieve the accessor object for the java.awt.KeyboardFocusManager class. |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
318 |
*/ |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
319 |
public static KeyboardFocusManagerAccessor getKeyboardFocusManagerAccessor() { |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
320 |
if (kfmAccessor == null) { |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
321 |
unsafe.ensureClassInitialized(KeyboardFocusManager.class); |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
322 |
} |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
323 |
return kfmAccessor; |
3c6755bdc55f
6806217: implement synthetic focus model for MS Windows
ant
parents:
2459
diff
changeset
|
324 |
} |
1978
8b981ce05cd0
6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff
changeset
|
325 |
} |