author | pchelko |
Fri, 13 Sep 2013 18:02:18 +0400 | |
changeset 20134 | 8711b271f96c |
parent 20125 | 65a1e01378a2 |
child 20147 | 78e51d8fcb92 |
permissions | -rw-r--r-- |
12047 | 1 |
/* |
15989
0fe0985a7bde
8003169: [macosx] JVM crash after disconnecting from projector
serb
parents:
15988
diff
changeset
|
2 |
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. |
12047 | 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 |
|
23 |
* questions. |
|
24 |
*/ |
|
25 |
||
26 |
package sun.lwawt.macosx; |
|
27 |
||
28 |
import java.awt.*; |
|
29 |
import java.awt.datatransfer.Clipboard; |
|
30 |
import java.awt.dnd.*; |
|
31 |
import java.awt.dnd.peer.DragSourceContextPeer; |
|
32 |
import java.awt.event.InputEvent; |
|
33 |
import java.awt.event.InvocationEvent; |
|
34 |
import java.awt.event.KeyEvent; |
|
35 |
import java.awt.im.InputMethodHighlight; |
|
36 |
import java.awt.peer.*; |
|
37 |
import java.lang.reflect.*; |
|
38 |
import java.security.*; |
|
39 |
import java.util.*; |
|
40 |
import java.util.concurrent.Callable; |
|
41 |
||
42 |
import sun.awt.*; |
|
43 |
import sun.lwawt.*; |
|
44 |
import sun.lwawt.LWWindowPeer.PeerType; |
|
13605
be3bee073685
7180036: Build failure in Mac platform caused by fix # 7163201
bagiras
parents:
13604
diff
changeset
|
45 |
import sun.security.action.GetBooleanAction; |
12047 | 46 |
|
47 |
class NamedCursor extends Cursor { |
|
48 |
NamedCursor(String name) { |
|
49 |
super(name); |
|
50 |
} |
|
51 |
} |
|
52 |
||
53 |
/** |
|
54 |
* Mac OS X Cocoa-based AWT Toolkit. |
|
55 |
*/ |
|
14166
fb29a7f1a862
7124520: [macosx] re:6373505 Toolkit.getScreenResolution() != GraphicsConfiguration.getNormalizingTransform()
serb
parents:
13775
diff
changeset
|
56 |
public final class LWCToolkit extends LWToolkit { |
12047 | 57 |
// While it is possible to enumerate all mouse devices |
58 |
// and query them for the number of buttons, the code |
|
59 |
// that does it is rather complex. Instead, we opt for |
|
60 |
// the easy way and just support up to 5 mouse buttons, |
|
61 |
// like Windows. |
|
62 |
private static final int BUTTONS = 5; |
|
63 |
||
64 |
private static native void initIDs(); |
|
65 |
||
66 |
private static CInputMethodDescriptor sInputMethodDescriptor; |
|
67 |
||
68 |
static { |
|
69 |
System.err.flush(); |
|
70 |
java.security.AccessController.doPrivileged(new java.security.PrivilegedAction<Object>() { |
|
71 |
public Object run() { |
|
72 |
System.loadLibrary("awt"); |
|
73 |
System.loadLibrary("fontmanager"); |
|
74 |
return null; |
|
75 |
} |
|
76 |
}); |
|
77 |
if (!GraphicsEnvironment.isHeadless()) { |
|
78 |
initIDs(); |
|
79 |
} |
|
17899 | 80 |
inAWT = AccessController.doPrivileged(new PrivilegedAction<Boolean>() { |
81 |
@Override |
|
82 |
public Boolean run() { |
|
83 |
return !Boolean.parseBoolean(System.getProperty("javafx.embed.singleThread", "false")); |
|
84 |
} |
|
85 |
}); |
|
12047 | 86 |
} |
87 |
||
17899 | 88 |
/* |
89 |
* If true we operate in normal mode and nested runloop is executed in JavaRunLoopMode |
|
90 |
* If false we operate in singleThreaded FX/AWT interop mode and nested loop uses NSDefaultRunLoopMode |
|
91 |
*/ |
|
92 |
private static final boolean inAWT; |
|
93 |
||
12047 | 94 |
public LWCToolkit() { |
95 |
SunToolkit.setDataTransfererClassName("sun.lwawt.macosx.CDataTransferer"); |
|
96 |
||
97 |
areExtraMouseButtonsEnabled = Boolean.parseBoolean(System.getProperty("sun.awt.enableExtraMouseButtons", "true")); |
|
98 |
//set system property if not yet assigned |
|
99 |
System.setProperty("sun.awt.enableExtraMouseButtons", ""+areExtraMouseButtonsEnabled); |
|
100 |
} |
|
101 |
||
102 |
/* |
|
103 |
* System colors with default initial values, overwritten by toolkit if system values differ and are available. |
|
104 |
*/ |
|
105 |
private final static int NUM_APPLE_COLORS = 3; |
|
106 |
public final static int KEYBOARD_FOCUS_COLOR = 0; |
|
107 |
public final static int INACTIVE_SELECTION_BACKGROUND_COLOR = 1; |
|
108 |
public final static int INACTIVE_SELECTION_FOREGROUND_COLOR = 2; |
|
109 |
private static int[] appleColors = { |
|
110 |
0xFF808080, // keyboardFocusColor = Color.gray; |
|
111 |
0xFFC0C0C0, // secondarySelectedControlColor |
|
112 |
0xFF303030, // controlDarkShadowColor |
|
113 |
}; |
|
114 |
||
115 |
private native void loadNativeColors(final int[] systemColors, final int[] appleColors); |
|
116 |
||
117 |
protected void loadSystemColors(final int[] systemColors) { |
|
118 |
if (systemColors == null) return; |
|
119 |
loadNativeColors(systemColors, appleColors); |
|
120 |
} |
|
121 |
||
122 |
private static class AppleSpecificColor extends Color { |
|
123 |
int index; |
|
124 |
public AppleSpecificColor(int index) { |
|
125 |
super(appleColors[index]); |
|
126 |
this.index = index; |
|
127 |
} |
|
128 |
||
129 |
public int getRGB() { |
|
130 |
return appleColors[index]; |
|
131 |
} |
|
132 |
} |
|
133 |
||
134 |
/** |
|
135 |
* Returns Apple specific colors that we may expose going forward. |
|
136 |
* |
|
137 |
*/ |
|
138 |
public static Color getAppleColor(int color) { |
|
139 |
return new AppleSpecificColor(color); |
|
140 |
} |
|
141 |
||
142 |
static void systemColorsChanged() { |
|
143 |
// This is only called from native code. |
|
144 |
EventQueue.invokeLater(new Runnable() { |
|
145 |
public void run() { |
|
146 |
AccessController.doPrivileged (new PrivilegedAction<Object>() { |
|
147 |
public Object run() { |
|
148 |
try { |
|
149 |
final Method updateColorsMethod = SystemColor.class.getDeclaredMethod("updateSystemColors", new Class[0]); |
|
150 |
updateColorsMethod.setAccessible(true); |
|
151 |
updateColorsMethod.invoke(null, new Object[0]); |
|
152 |
} catch (final Throwable e) { |
|
153 |
e.printStackTrace(); |
|
154 |
// swallow this if something goes horribly wrong |
|
155 |
} |
|
156 |
return null; |
|
157 |
} |
|
158 |
}); |
|
159 |
} |
|
160 |
}); |
|
161 |
} |
|
162 |
||
14306
8d823e84507a
7198229: Painting during resizing of the frame should be more smooth
serb
parents:
14166
diff
changeset
|
163 |
public static LWCToolkit getLWCToolkit() { |
8d823e84507a
7198229: Painting during resizing of the frame should be more smooth
serb
parents:
14166
diff
changeset
|
164 |
return (LWCToolkit)Toolkit.getDefaultToolkit(); |
8d823e84507a
7198229: Painting during resizing of the frame should be more smooth
serb
parents:
14166
diff
changeset
|
165 |
} |
8d823e84507a
7198229: Painting during resizing of the frame should be more smooth
serb
parents:
14166
diff
changeset
|
166 |
|
12047 | 167 |
@Override |
168 |
protected PlatformWindow createPlatformWindow(PeerType peerType) { |
|
14753
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
169 |
if (peerType == PeerType.EMBEDDED_FRAME) { |
12047 | 170 |
return new CPlatformEmbeddedFrame(); |
14753
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
171 |
} else if (peerType == PeerType.VIEW_EMBEDDED_FRAME) { |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
172 |
return new CViewPlatformEmbeddedFrame(); |
15983
26a673dec5b2
8006406: lightweight embedding in other Java UI toolkits
ant
parents:
14753
diff
changeset
|
173 |
} else if (peerType == PeerType.LW_FRAME) { |
26a673dec5b2
8006406: lightweight embedding in other Java UI toolkits
ant
parents:
14753
diff
changeset
|
174 |
return new CPlatformLWWindow(); |
12047 | 175 |
} else { |
14753
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
176 |
assert (peerType == PeerType.SIMPLEWINDOW || peerType == PeerType.DIALOG || peerType == PeerType.FRAME); |
a56a685d137f
7154778: [macosx] NSView-based implementation of sun.awt.EmbeddedFrame
serb
parents:
14306
diff
changeset
|
177 |
return new CPlatformWindow(); |
12047 | 178 |
} |
179 |
} |
|
180 |
||
181 |
@Override |
|
18241 | 182 |
protected SecurityWarningWindow createSecurityWarning(Window ownerWindow, LWWindowPeer ownerPeer) { |
183 |
return new CWarningWindow(ownerWindow, ownerPeer); |
|
184 |
} |
|
185 |
||
186 |
@Override |
|
12047 | 187 |
protected PlatformComponent createPlatformComponent() { |
188 |
return new CPlatformComponent(); |
|
189 |
} |
|
190 |
||
191 |
@Override |
|
15983
26a673dec5b2
8006406: lightweight embedding in other Java UI toolkits
ant
parents:
14753
diff
changeset
|
192 |
protected PlatformComponent createLwPlatformComponent() { |
26a673dec5b2
8006406: lightweight embedding in other Java UI toolkits
ant
parents:
14753
diff
changeset
|
193 |
return new CPlatformLWComponent(); |
26a673dec5b2
8006406: lightweight embedding in other Java UI toolkits
ant
parents:
14753
diff
changeset
|
194 |
} |
26a673dec5b2
8006406: lightweight embedding in other Java UI toolkits
ant
parents:
14753
diff
changeset
|
195 |
|
26a673dec5b2
8006406: lightweight embedding in other Java UI toolkits
ant
parents:
14753
diff
changeset
|
196 |
@Override |
12047 | 197 |
protected FileDialogPeer createFileDialogPeer(FileDialog target) { |
198 |
return new CFileDialog(target); |
|
199 |
} |
|
200 |
||
201 |
@Override |
|
202 |
public MenuPeer createMenu(Menu target) { |
|
203 |
MenuPeer peer = new CMenu(target); |
|
204 |
targetCreatedPeer(target, peer); |
|
205 |
return peer; |
|
206 |
} |
|
207 |
||
208 |
@Override |
|
209 |
public MenuBarPeer createMenuBar(MenuBar target) { |
|
20125
65a1e01378a2
7124537: [macosx] Menu shortcuts for all menu items should be disabled if a menu itself is disabled
serb
parents:
18274
diff
changeset
|
210 |
MenuBarPeer peer = new CMenuBar(target); |
65a1e01378a2
7124537: [macosx] Menu shortcuts for all menu items should be disabled if a menu itself is disabled
serb
parents:
18274
diff
changeset
|
211 |
targetCreatedPeer(target, peer); |
65a1e01378a2
7124537: [macosx] Menu shortcuts for all menu items should be disabled if a menu itself is disabled
serb
parents:
18274
diff
changeset
|
212 |
return peer; |
12047 | 213 |
} |
214 |
||
215 |
@Override |
|
216 |
public MenuItemPeer createMenuItem(MenuItem target) { |
|
217 |
MenuItemPeer peer = new CMenuItem(target); |
|
218 |
targetCreatedPeer(target, peer); |
|
219 |
return peer; |
|
220 |
} |
|
221 |
||
222 |
@Override |
|
223 |
public CheckboxMenuItemPeer createCheckboxMenuItem(CheckboxMenuItem target) { |
|
224 |
CheckboxMenuItemPeer peer = new CCheckboxMenuItem(target); |
|
225 |
targetCreatedPeer(target, peer); |
|
226 |
return peer; |
|
227 |
} |
|
228 |
||
229 |
@Override |
|
230 |
public PopupMenuPeer createPopupMenu(PopupMenu target) { |
|
231 |
PopupMenuPeer peer = new CPopupMenu(target); |
|
232 |
targetCreatedPeer(target, peer); |
|
233 |
return peer; |
|
234 |
||
235 |
} |
|
236 |
||
237 |
@Override |
|
238 |
public SystemTrayPeer createSystemTray(SystemTray target) { |
|
239 |
SystemTrayPeer peer = new CSystemTray(); |
|
240 |
return peer; |
|
241 |
} |
|
242 |
||
243 |
@Override |
|
244 |
public TrayIconPeer createTrayIcon(TrayIcon target) { |
|
245 |
TrayIconPeer peer = new CTrayIcon(target); |
|
246 |
targetCreatedPeer(target, peer); |
|
247 |
return peer; |
|
248 |
} |
|
249 |
||
250 |
@Override |
|
251 |
public LWCursorManager getCursorManager() { |
|
252 |
return CCursorManager.getInstance(); |
|
253 |
} |
|
254 |
||
255 |
@Override |
|
256 |
public Cursor createCustomCursor(final Image cursor, final Point hotSpot, final String name) throws IndexOutOfBoundsException, HeadlessException { |
|
257 |
return new CCustomCursor(cursor, hotSpot, name); |
|
258 |
} |
|
259 |
||
260 |
@Override |
|
261 |
public Dimension getBestCursorSize(final int preferredWidth, final int preferredHeight) throws HeadlessException { |
|
262 |
return CCustomCursor.getBestCursorSize(preferredWidth, preferredHeight); |
|
263 |
} |
|
264 |
||
265 |
@Override |
|
266 |
protected void platformCleanup() { |
|
267 |
// TODO Auto-generated method stub |
|
268 |
||
269 |
} |
|
270 |
||
271 |
@Override |
|
272 |
protected void platformInit() { |
|
273 |
// TODO Auto-generated method stub |
|
274 |
||
275 |
} |
|
276 |
||
277 |
@Override |
|
278 |
protected void platformRunMessage() { |
|
279 |
// TODO Auto-generated method stub |
|
280 |
||
281 |
} |
|
282 |
||
283 |
@Override |
|
284 |
protected void platformShutdown() { |
|
285 |
// TODO Auto-generated method stub |
|
286 |
||
287 |
} |
|
288 |
||
289 |
class OSXPlatformFont extends sun.awt.PlatformFont |
|
290 |
{ |
|
291 |
public OSXPlatformFont(String name, int style) |
|
292 |
{ |
|
293 |
super(name, style); |
|
294 |
} |
|
295 |
protected char getMissingGlyphCharacter() |
|
296 |
{ |
|
297 |
// Follow up for real implementation |
|
298 |
return (char)0xfff8; // see http://developer.apple.com/fonts/LastResortFont/ |
|
299 |
} |
|
300 |
} |
|
301 |
public FontPeer getFontPeer(String name, int style) { |
|
302 |
return new OSXPlatformFont(name, style); |
|
303 |
} |
|
304 |
||
305 |
@Override |
|
306 |
protected int getScreenHeight() { |
|
307 |
return GraphicsEnvironment.getLocalGraphicsEnvironment() |
|
308 |
.getDefaultScreenDevice().getDefaultConfiguration().getBounds().height; |
|
309 |
} |
|
310 |
||
311 |
@Override |
|
312 |
protected int getScreenWidth() { |
|
313 |
return GraphicsEnvironment.getLocalGraphicsEnvironment() |
|
314 |
.getDefaultScreenDevice().getDefaultConfiguration().getBounds().width; |
|
315 |
} |
|
316 |
||
317 |
@Override |
|
318 |
protected void initializeDesktopProperties() { |
|
319 |
super.initializeDesktopProperties(); |
|
320 |
Map <Object, Object> fontHints = new HashMap<Object, Object>(); |
|
321 |
fontHints.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
|
322 |
fontHints.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); |
|
323 |
desktopProperties.put(SunToolkit.DESKTOPFONTHINTS, fontHints); |
|
324 |
desktopProperties.put("awt.mouse.numButtons", BUTTONS); |
|
325 |
||
326 |
// These DnD properties must be set, otherwise Swing ends up spewing NPEs |
|
327 |
// all over the place. The values came straight off of MToolkit. |
|
328 |
desktopProperties.put("DnD.Autoscroll.initialDelay", new Integer(50)); |
|
329 |
desktopProperties.put("DnD.Autoscroll.interval", new Integer(50)); |
|
330 |
desktopProperties.put("DnD.Autoscroll.cursorHysteresis", new Integer(5)); |
|
331 |
||
332 |
desktopProperties.put("DnD.isDragImageSupported", new Boolean(true)); |
|
333 |
||
334 |
// Register DnD cursors |
|
335 |
desktopProperties.put("DnD.Cursor.CopyDrop", new NamedCursor("DnD.Cursor.CopyDrop")); |
|
336 |
desktopProperties.put("DnD.Cursor.MoveDrop", new NamedCursor("DnD.Cursor.MoveDrop")); |
|
337 |
desktopProperties.put("DnD.Cursor.LinkDrop", new NamedCursor("DnD.Cursor.LinkDrop")); |
|
338 |
desktopProperties.put("DnD.Cursor.CopyNoDrop", new NamedCursor("DnD.Cursor.CopyNoDrop")); |
|
339 |
desktopProperties.put("DnD.Cursor.MoveNoDrop", new NamedCursor("DnD.Cursor.MoveNoDrop")); |
|
340 |
desktopProperties.put("DnD.Cursor.LinkNoDrop", new NamedCursor("DnD.Cursor.LinkNoDrop")); |
|
341 |
||
342 |
} |
|
343 |
||
344 |
||
345 |
/* |
|
346 |
* The method returns true if some events were processed during that timeout. |
|
347 |
* @see sun.awt.SunToolkit#syncNativeQueue(long) |
|
348 |
*/ |
|
349 |
@Override |
|
350 |
protected boolean syncNativeQueue(long timeout) { |
|
351 |
return nativeSyncQueue(timeout); |
|
352 |
} |
|
353 |
||
354 |
@Override |
|
355 |
public native void beep(); |
|
356 |
||
357 |
@Override |
|
358 |
public int getScreenResolution() throws HeadlessException { |
|
14166
fb29a7f1a862
7124520: [macosx] re:6373505 Toolkit.getScreenResolution() != GraphicsConfiguration.getNormalizingTransform()
serb
parents:
13775
diff
changeset
|
359 |
return (int) ((CGraphicsDevice) GraphicsEnvironment |
fb29a7f1a862
7124520: [macosx] re:6373505 Toolkit.getScreenResolution() != GraphicsConfiguration.getNormalizingTransform()
serb
parents:
13775
diff
changeset
|
360 |
.getLocalGraphicsEnvironment().getDefaultScreenDevice()) |
fb29a7f1a862
7124520: [macosx] re:6373505 Toolkit.getScreenResolution() != GraphicsConfiguration.getNormalizingTransform()
serb
parents:
13775
diff
changeset
|
361 |
.getXResolution(); |
12047 | 362 |
} |
363 |
||
364 |
@Override |
|
365 |
public Insets getScreenInsets(final GraphicsConfiguration gc) { |
|
15989
0fe0985a7bde
8003169: [macosx] JVM crash after disconnecting from projector
serb
parents:
15988
diff
changeset
|
366 |
return ((CGraphicsConfig) gc).getDevice().getScreenInsets(); |
12047 | 367 |
} |
368 |
||
369 |
@Override |
|
370 |
public void sync() { |
|
371 |
// TODO Auto-generated method stub |
|
372 |
||
373 |
} |
|
374 |
||
375 |
@Override |
|
376 |
public RobotPeer createRobot(Robot target, GraphicsDevice screen) { |
|
377 |
return new CRobot(target, (CGraphicsDevice)screen); |
|
378 |
} |
|
379 |
||
380 |
private native boolean isCapsLockOn(); |
|
381 |
||
382 |
/* |
|
383 |
* NOTE: Among the keys this method is supposed to check, |
|
384 |
* only Caps Lock works as a true locking key with OS X. |
|
385 |
* There is no Scroll Lock key on modern Apple keyboards, |
|
386 |
* and with a PC keyboard plugged in Scroll Lock is simply |
|
387 |
* ignored: no LED lights up if you press it. |
|
388 |
* The key located at the same position on Apple keyboards |
|
389 |
* as Num Lock on PC keyboards is called Clear, doesn't lock |
|
390 |
* anything and is used for entirely different purpose. |
|
391 |
*/ |
|
392 |
public boolean getLockingKeyState(int keyCode) throws UnsupportedOperationException { |
|
393 |
switch (keyCode) { |
|
394 |
case KeyEvent.VK_NUM_LOCK: |
|
395 |
case KeyEvent.VK_SCROLL_LOCK: |
|
396 |
case KeyEvent.VK_KANA_LOCK: |
|
397 |
throw new UnsupportedOperationException("Toolkit.getLockingKeyState"); |
|
398 |
||
399 |
case KeyEvent.VK_CAPS_LOCK: |
|
400 |
return isCapsLockOn(); |
|
401 |
||
402 |
default: |
|
403 |
throw new IllegalArgumentException("invalid key for Toolkit.getLockingKeyState"); |
|
404 |
} |
|
405 |
} |
|
406 |
||
407 |
//Is it allowed to generate events assigned to extra mouse buttons. |
|
408 |
//Set to true by default. |
|
409 |
private static boolean areExtraMouseButtonsEnabled = true; |
|
410 |
||
411 |
public boolean areExtraMouseButtonsEnabled() throws HeadlessException { |
|
412 |
return areExtraMouseButtonsEnabled; |
|
413 |
} |
|
414 |
||
415 |
public int getNumberOfButtons(){ |
|
416 |
return BUTTONS; |
|
417 |
} |
|
418 |
||
419 |
@Override |
|
420 |
public boolean isTraySupported() { |
|
421 |
return true; |
|
422 |
} |
|
423 |
||
424 |
@Override |
|
425 |
public boolean isAlwaysOnTopSupported() { |
|
426 |
return true; |
|
427 |
} |
|
428 |
||
429 |
// Intended to be called from the LWCToolkit.m only. |
|
430 |
private static void installToolkitThreadNameInJava() { |
|
431 |
Thread.currentThread().setName(CThreading.APPKIT_THREAD_NAME); |
|
432 |
} |
|
433 |
||
434 |
@Override |
|
435 |
public boolean isWindowOpacitySupported() { |
|
436 |
return true; |
|
437 |
} |
|
438 |
||
439 |
@Override |
|
440 |
public boolean isFrameStateSupported(int state) throws HeadlessException { |
|
441 |
switch (state) { |
|
442 |
case Frame.NORMAL: |
|
443 |
case Frame.ICONIFIED: |
|
444 |
case Frame.MAXIMIZED_BOTH: |
|
445 |
return true; |
|
446 |
default: |
|
447 |
return false; |
|
448 |
} |
|
449 |
} |
|
450 |
||
451 |
/** |
|
452 |
* Determines which modifier key is the appropriate accelerator |
|
453 |
* key for menu shortcuts. |
|
454 |
* <p> |
|
455 |
* Menu shortcuts, which are embodied in the |
|
456 |
* <code>MenuShortcut</code> class, are handled by the |
|
457 |
* <code>MenuBar</code> class. |
|
458 |
* <p> |
|
459 |
* By default, this method returns <code>Event.CTRL_MASK</code>. |
|
460 |
* Toolkit implementations should override this method if the |
|
461 |
* <b>Control</b> key isn't the correct key for accelerators. |
|
462 |
* @return the modifier mask on the <code>Event</code> class |
|
463 |
* that is used for menu shortcuts on this toolkit. |
|
464 |
* @see java.awt.MenuBar |
|
465 |
* @see java.awt.MenuShortcut |
|
466 |
* @since JDK1.1 |
|
467 |
*/ |
|
468 |
public int getMenuShortcutKeyMask() { |
|
469 |
return Event.META_MASK; |
|
470 |
} |
|
471 |
||
472 |
@Override |
|
473 |
public Image getImage(final String filename) { |
|
474 |
final Image nsImage = checkForNSImage(filename); |
|
475 |
if (nsImage != null) return nsImage; |
|
476 |
||
477 |
return super.getImage(filename); |
|
478 |
} |
|
479 |
||
480 |
static final String nsImagePrefix = "NSImage://"; |
|
481 |
protected Image checkForNSImage(final String imageName) { |
|
482 |
if (imageName == null) return null; |
|
483 |
if (!imageName.startsWith(nsImagePrefix)) return null; |
|
484 |
return CImage.getCreator().createImageFromName(imageName.substring(nsImagePrefix.length())); |
|
485 |
} |
|
486 |
||
487 |
// Thread-safe Object.equals() called from native |
|
488 |
public static boolean doEquals(final Object a, final Object b, Component c) { |
|
489 |
if (a == b) return true; |
|
490 |
||
491 |
final boolean[] ret = new boolean[1]; |
|
492 |
||
493 |
try { invokeAndWait(new Runnable() { public void run() { synchronized(ret) { |
|
494 |
ret[0] = a.equals(b); |
|
495 |
}}}, c); } catch (Exception e) { e.printStackTrace(); } |
|
496 |
||
497 |
synchronized(ret) { return ret[0]; } |
|
498 |
} |
|
499 |
||
500 |
public static <T> T invokeAndWait(final Callable<T> callable, Component component) throws Exception { |
|
501 |
final CallableWrapper<T> wrapper = new CallableWrapper<T>(callable); |
|
502 |
invokeAndWait(wrapper, component); |
|
503 |
return wrapper.getResult(); |
|
504 |
} |
|
505 |
||
506 |
static final class CallableWrapper<T> implements Runnable { |
|
507 |
final Callable<T> callable; |
|
508 |
T object; |
|
509 |
Exception e; |
|
510 |
||
511 |
public CallableWrapper(final Callable<T> callable) { |
|
512 |
this.callable = callable; |
|
513 |
} |
|
514 |
||
515 |
public void run() { |
|
516 |
try { |
|
517 |
object = callable.call(); |
|
518 |
} catch (final Exception e) { |
|
519 |
this.e = e; |
|
520 |
} |
|
521 |
} |
|
522 |
||
523 |
public T getResult() throws Exception { |
|
524 |
if (e != null) throw e; |
|
525 |
return object; |
|
526 |
} |
|
527 |
} |
|
528 |
||
15985
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
529 |
// Kicks an event over to the appropriate eventqueue and waits for it to finish |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
530 |
// To avoid deadlocking, we manually run the NSRunLoop while waiting |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
531 |
// Any selector invoked using ThreadUtilities performOnMainThread will be processed in doAWTRunLoop |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
532 |
// The InvocationEvent will call LWCToolkit.stopAWTRunLoop() when finished, which will stop our manual runloop |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
533 |
// Does not dispatch native events while in the loop |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
534 |
public static void invokeAndWait(Runnable event, Component component) throws InterruptedException, InvocationTargetException { |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
535 |
final long mediator = createAWTRunLoopMediator(); |
12047 | 536 |
|
15985
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
537 |
InvocationEvent invocationEvent = |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
538 |
new InvocationEvent(component != null ? component : Toolkit.getDefaultToolkit(), event) { |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
539 |
@Override |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
540 |
public void dispatch() { |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
541 |
try { |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
542 |
super.dispatch(); |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
543 |
} finally { |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
544 |
if (mediator != 0) { |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
545 |
stopAWTRunLoop(mediator); |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
546 |
} |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
547 |
} |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
548 |
} |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
549 |
}; |
12047 | 550 |
|
551 |
if (component != null) { |
|
552 |
AppContext appContext = SunToolkit.targetToAppContext(component); |
|
553 |
SunToolkit.postEvent(appContext, invocationEvent); |
|
554 |
||
555 |
// 3746956 - flush events from PostEventQueue to prevent them from getting stuck and causing a deadlock |
|
13775
3ab536cab1d1
7186109: Simplify lock machinery for PostEventQueue & EventQueue
bagiras
parents:
13605
diff
changeset
|
556 |
SunToolkit.flushPendingEvents(appContext); |
12047 | 557 |
} else { |
558 |
// This should be the equivalent to EventQueue.invokeAndWait |
|
559 |
((LWCToolkit)Toolkit.getDefaultToolkit()).getSystemEventQueueForInvokeAndWait().postEvent(invocationEvent); |
|
560 |
} |
|
561 |
||
15985
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
562 |
doAWTRunLoop(mediator, false); |
12047 | 563 |
|
564 |
Throwable eventException = invocationEvent.getException(); |
|
565 |
if (eventException != null) { |
|
566 |
if (eventException instanceof UndeclaredThrowableException) { |
|
567 |
eventException = ((UndeclaredThrowableException)eventException).getUndeclaredThrowable(); |
|
568 |
} |
|
569 |
throw new InvocationTargetException(eventException); |
|
570 |
} |
|
571 |
} |
|
572 |
||
573 |
public static void invokeLater(Runnable event, Component component) throws InvocationTargetException { |
|
15985
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
574 |
final InvocationEvent invocationEvent = |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
575 |
new InvocationEvent(component != null ? component : Toolkit.getDefaultToolkit(), event); |
12047 | 576 |
|
577 |
if (component != null) { |
|
578 |
final AppContext appContext = SunToolkit.targetToAppContext(component); |
|
579 |
SunToolkit.postEvent(appContext, invocationEvent); |
|
580 |
||
581 |
// 3746956 - flush events from PostEventQueue to prevent them from getting stuck and causing a deadlock |
|
13775
3ab536cab1d1
7186109: Simplify lock machinery for PostEventQueue & EventQueue
bagiras
parents:
13605
diff
changeset
|
582 |
SunToolkit.flushPendingEvents(appContext); |
12047 | 583 |
} else { |
584 |
// This should be the equivalent to EventQueue.invokeAndWait |
|
585 |
((LWCToolkit)Toolkit.getDefaultToolkit()).getSystemEventQueueForInvokeAndWait().postEvent(invocationEvent); |
|
586 |
} |
|
587 |
||
588 |
final Throwable eventException = invocationEvent.getException(); |
|
589 |
if (eventException == null) return; |
|
590 |
||
591 |
if (eventException instanceof UndeclaredThrowableException) { |
|
592 |
throw new InvocationTargetException(((UndeclaredThrowableException)eventException).getUndeclaredThrowable()); |
|
593 |
} |
|
594 |
throw new InvocationTargetException(eventException); |
|
595 |
} |
|
596 |
||
597 |
// This exists purely to get around permissions issues with getSystemEventQueueImpl |
|
598 |
EventQueue getSystemEventQueueForInvokeAndWait() { |
|
599 |
return getSystemEventQueueImpl(); |
|
600 |
} |
|
601 |
||
602 |
||
603 |
// DnD support |
|
604 |
||
605 |
public DragSourceContextPeer createDragSourceContextPeer(DragGestureEvent dge) throws InvalidDnDOperationException { |
|
606 |
DragSourceContextPeer dscp = CDragSourceContextPeer.createDragSourceContextPeer(dge); |
|
607 |
||
608 |
return dscp; |
|
609 |
} |
|
610 |
||
611 |
public <T extends DragGestureRecognizer> T createDragGestureRecognizer(Class<T> abstractRecognizerClass, DragSource ds, Component c, int srcActions, DragGestureListener dgl) { |
|
612 |
DragGestureRecognizer dgr = null; |
|
613 |
||
614 |
// Create a new mouse drag gesture recognizer if we have a class match: |
|
615 |
if (MouseDragGestureRecognizer.class.equals(abstractRecognizerClass)) |
|
616 |
dgr = new CMouseDragGestureRecognizer(ds, c, srcActions, dgl); |
|
617 |
||
618 |
return (T)dgr; |
|
619 |
} |
|
620 |
||
621 |
// InputMethodSupport Method |
|
622 |
/** |
|
623 |
* Returns the default keyboard locale of the underlying operating system |
|
624 |
*/ |
|
625 |
public Locale getDefaultKeyboardLocale() { |
|
626 |
Locale locale = CInputMethod.getNativeLocale(); |
|
627 |
||
628 |
if (locale == null) { |
|
629 |
return super.getDefaultKeyboardLocale(); |
|
630 |
} |
|
631 |
||
632 |
return locale; |
|
633 |
} |
|
634 |
||
635 |
public java.awt.im.spi.InputMethodDescriptor getInputMethodAdapterDescriptor() { |
|
636 |
if (sInputMethodDescriptor == null) |
|
637 |
sInputMethodDescriptor = new CInputMethodDescriptor(); |
|
638 |
||
639 |
return sInputMethodDescriptor; |
|
640 |
} |
|
641 |
||
642 |
/** |
|
643 |
* Returns a map of visual attributes for thelevel description |
|
644 |
* of the given input method highlight, or null if no mapping is found. |
|
645 |
* The style field of the input method highlight is ignored. The map |
|
646 |
* returned is unmodifiable. |
|
647 |
* @param highlight input method highlight |
|
648 |
* @return style attribute map, or null |
|
649 |
* @since 1.3 |
|
650 |
*/ |
|
651 |
public Map mapInputMethodHighlight(InputMethodHighlight highlight) { |
|
652 |
return CInputMethod.mapInputMethodHighlight(highlight); |
|
653 |
} |
|
654 |
||
655 |
/** |
|
656 |
* Returns key modifiers used by Swing to set up a focus accelerator key stroke. |
|
657 |
*/ |
|
658 |
@Override |
|
659 |
public int getFocusAcceleratorKeyMask() { |
|
660 |
return InputEvent.CTRL_MASK | InputEvent.ALT_MASK; |
|
661 |
} |
|
662 |
||
12418
f749f1ed92ca
7124286: [macosx] Option modifier should work like AltGr as in Apple jdk
leonidr
parents:
12176
diff
changeset
|
663 |
/** |
f749f1ed92ca
7124286: [macosx] Option modifier should work like AltGr as in Apple jdk
leonidr
parents:
12176
diff
changeset
|
664 |
* Tests whether specified key modifiers mask can be used to enter a printable |
f749f1ed92ca
7124286: [macosx] Option modifier should work like AltGr as in Apple jdk
leonidr
parents:
12176
diff
changeset
|
665 |
* character. |
f749f1ed92ca
7124286: [macosx] Option modifier should work like AltGr as in Apple jdk
leonidr
parents:
12176
diff
changeset
|
666 |
*/ |
f749f1ed92ca
7124286: [macosx] Option modifier should work like AltGr as in Apple jdk
leonidr
parents:
12176
diff
changeset
|
667 |
@Override |
f749f1ed92ca
7124286: [macosx] Option modifier should work like AltGr as in Apple jdk
leonidr
parents:
12176
diff
changeset
|
668 |
public boolean isPrintableCharacterModifiersMask(int mods) { |
f749f1ed92ca
7124286: [macosx] Option modifier should work like AltGr as in Apple jdk
leonidr
parents:
12176
diff
changeset
|
669 |
return ((mods & (InputEvent.META_MASK | InputEvent.CTRL_MASK)) == 0); |
f749f1ed92ca
7124286: [macosx] Option modifier should work like AltGr as in Apple jdk
leonidr
parents:
12176
diff
changeset
|
670 |
} |
f749f1ed92ca
7124286: [macosx] Option modifier should work like AltGr as in Apple jdk
leonidr
parents:
12176
diff
changeset
|
671 |
|
12529
6da056faf511
7154480: [macosx] Not all popup menu items are visible
leonidr
parents:
12418
diff
changeset
|
672 |
/** |
6da056faf511
7154480: [macosx] Not all popup menu items are visible
leonidr
parents:
12418
diff
changeset
|
673 |
* Returns whether popup is allowed to be shown above the task bar. |
6da056faf511
7154480: [macosx] Not all popup menu items are visible
leonidr
parents:
12418
diff
changeset
|
674 |
*/ |
6da056faf511
7154480: [macosx] Not all popup menu items are visible
leonidr
parents:
12418
diff
changeset
|
675 |
@Override |
6da056faf511
7154480: [macosx] Not all popup menu items are visible
leonidr
parents:
12418
diff
changeset
|
676 |
public boolean canPopupOverlapTaskBar() { |
6da056faf511
7154480: [macosx] Not all popup menu items are visible
leonidr
parents:
12418
diff
changeset
|
677 |
return false; |
6da056faf511
7154480: [macosx] Not all popup menu items are visible
leonidr
parents:
12418
diff
changeset
|
678 |
} |
6da056faf511
7154480: [macosx] Not all popup menu items are visible
leonidr
parents:
12418
diff
changeset
|
679 |
|
12047 | 680 |
private static Boolean sunAwtDisableCALayers = null; |
681 |
||
682 |
/** |
|
683 |
* Returns the value of "sun.awt.disableCALayers" property. Default |
|
684 |
* value is {@code false}. |
|
685 |
*/ |
|
686 |
public synchronized static boolean getSunAwtDisableCALayers() { |
|
687 |
if (sunAwtDisableCALayers == null) { |
|
13604 | 688 |
sunAwtDisableCALayers = AccessController.doPrivileged( |
13605
be3bee073685
7180036: Build failure in Mac platform caused by fix # 7163201
bagiras
parents:
13604
diff
changeset
|
689 |
new GetBooleanAction("sun.awt.disableCALayers")); |
12047 | 690 |
} |
691 |
return sunAwtDisableCALayers.booleanValue(); |
|
692 |
} |
|
693 |
||
12176 | 694 |
|
695 |
/* |
|
696 |
* Returns true if the application (one of its windows) owns keyboard focus. |
|
697 |
*/ |
|
12047 | 698 |
public native boolean isApplicationActive(); |
699 |
||
700 |
/************************ |
|
701 |
* Native methods section |
|
702 |
************************/ |
|
703 |
||
15985
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
704 |
static native long createAWTRunLoopMediator(); |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
705 |
/** |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
706 |
* Method to run a nested run-loop. The nested loop is spinned in the javaRunLoop mode, so selectors sent |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
707 |
* by [JNFRunLoop performOnMainThreadWaiting] are processed. |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
708 |
* @param mediator a native pointer to the mediator object created by createAWTRunLoopMediator |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
709 |
* @param processEvents if true - dispatches event while in the nested loop. Used in DnD. |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
710 |
* Additional attention is needed when using this feature as we short-circuit normal event |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
711 |
* processing which could break Appkit. |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
712 |
* (One known example is when the window is resized with the mouse) |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
713 |
* |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
714 |
* if false - all events come after exit form the nested loop |
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
715 |
*/ |
17899 | 716 |
static void doAWTRunLoop(long mediator, boolean processEvents) { |
717 |
doAWTRunLoopImpl(mediator, processEvents, inAWT); |
|
718 |
} |
|
719 |
static private native void doAWTRunLoopImpl(long mediator, boolean processEvents, boolean inAWT); |
|
15985
b9e25a486549
8006634: Unify LWCToolkit.invokeAndWait() and sun.awt.datatransfer.ToolkitThreadBlockedHandler
pchelko
parents:
15983
diff
changeset
|
720 |
static native void stopAWTRunLoop(long mediator); |
12047 | 721 |
|
722 |
private native boolean nativeSyncQueue(long timeout); |
|
723 |
||
724 |
@Override |
|
725 |
public Clipboard createPlatformClipboard() { |
|
726 |
return new CClipboard("System"); |
|
727 |
} |
|
728 |
||
729 |
@Override |
|
730 |
public boolean isModalExclusionTypeSupported(Dialog.ModalExclusionType exclusionType) { |
|
731 |
return (exclusionType == null) || |
|
732 |
(exclusionType == Dialog.ModalExclusionType.NO_EXCLUDE) || |
|
733 |
(exclusionType == Dialog.ModalExclusionType.APPLICATION_EXCLUDE) || |
|
734 |
(exclusionType == Dialog.ModalExclusionType.TOOLKIT_EXCLUDE); |
|
735 |
} |
|
736 |
||
737 |
@Override |
|
738 |
public boolean isModalityTypeSupported(Dialog.ModalityType modalityType) { |
|
739 |
//TODO: FileDialog blocks excluded windows... |
|
740 |
//TODO: Test: 2 file dialogs, separate AppContexts: a) Dialog 1 blocked, shouldn't be. Frame 4 blocked (shouldn't be). |
|
741 |
return (modalityType == null) || |
|
742 |
(modalityType == Dialog.ModalityType.MODELESS) || |
|
743 |
(modalityType == Dialog.ModalityType.DOCUMENT_MODAL) || |
|
744 |
(modalityType == Dialog.ModalityType.APPLICATION_MODAL) || |
|
745 |
(modalityType == Dialog.ModalityType.TOOLKIT_MODAL); |
|
746 |
} |
|
747 |
||
748 |
@Override |
|
13233 | 749 |
public boolean isWindowShapingSupported() { |
750 |
return true; |
|
751 |
} |
|
752 |
||
753 |
@Override |
|
12047 | 754 |
public boolean isWindowTranslucencySupported() { |
755 |
return true; |
|
756 |
} |
|
757 |
||
758 |
@Override |
|
759 |
public boolean isTranslucencyCapable(GraphicsConfiguration gc) { |
|
760 |
return true; |
|
761 |
} |
|
762 |
||
13233 | 763 |
public boolean isSwingBackbufferTranslucencySupported() { |
764 |
return true; |
|
765 |
} |
|
766 |
||
12047 | 767 |
@Override |
768 |
public boolean enableInputMethodsForTextComponent() { |
|
769 |
return true; |
|
770 |
} |
|
771 |
} |