<AWT Dev>  Review Request for JDK-8015477 Support single threaded AWT/FX mode.
anthony.petrov at oracle.com
Wed May 29 07:54:04 PDT 2013
> 88 /* If we operate in FX/AWT single threaded mode the nested loop should run in default mode */
> 89 private static final boolean inAWT;
> 314 isRunning = [[NSRunLoop currentRunLoop] runMode:inAWT ? [JNFRunLoop javaRunLoopMode] : NSDefaultRunLoopMode
If I read the comment above right, then we should swap the modes in ?:,
no? Also, since ':' has a special meaning in ObjC, I suggest to enclose
the ?: expression in parentheses for better readability.
> 2 * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
Is it true that this code exists since 2011?
> 41 * @since 8.0
We use "1.8" to indicate that an API is available since JDK8.
Regarding the FX part, I'm a bit uncertain if it's a good idea to
perform so many actions with undefined semantics. I mean, the
SwingFXUtils.runOnFxThread() either executes the runnable here and now
(blocking the calling code), or just schedules the execution for later
time. Sometimes this indeed makes sense. But in some cases this may be
the wrong thing to do because e.g. we may want to block always. I
believe we should mention this explicitly in the spec for this method,
so that people know what they do when they use this method. Anyway, as
long as this code is experimental and is off by default I'm OK with it.
On 05/28/2013 01:28 PM, Petr Pchelko wrote:
> Hello, AWT Team.
> Please review the fix for the issue:
> The fix is available at:
> The issue is just created, so it might not show up on bugs.sun.com
> This fix adds a private API to support a single threaded mode for AWT/FX interop.
> The main idea is to delegate some methods of an EventQueue to FX, so that AWT events were processed on FX thread.
> Here's the webrev for FX part of changes, for a usage sample:
> With best regards. Petr.
More information about the awt-dev