summaryrefslogtreecommitdiffstats
path: root/src/newt/classes/com
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-10-09 02:10:19 +0200
committerSven Gothel <[email protected]>2013-10-09 02:10:19 +0200
commit56502090ba5c2e0c266666a4ba3ddd501e9ad95f (patch)
tree59ab9e12de5be7b78f83360f0fe7009d433751a6 /src/newt/classes/com
parent88291cd5e20fc8b172f1d78a683be7d2bdec807a (diff)
NEWT Display: Issue EDTUtil.start() at runOnEDTIfAvail(..) even if on EDT, which is to be stopped.
This case appears on e.g. OSX/CALayer (offscreen) reparenting using recreation (onscreen <-> offscreen), i.e. display destroy/create is performed on EDT. Misc Cleanup: - Rename EDTUtil: restart() -> start() - Rename Display: validateEDT() -> validateEDTStopped() - Simplify Display.setEDTUtil(..): Remove need for redundant 'newEDTUtil' local var. - Simplify Display.runOnEDTIfAvail(..): edtUtil is never null
Diffstat (limited to 'src/newt/classes/com')
-rw-r--r--src/newt/classes/com/jogamp/newt/Display.java2
-rw-r--r--src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java2
-rw-r--r--src/newt/classes/com/jogamp/newt/util/EDTUtil.java10
3 files changed, 7 insertions, 7 deletions
diff --git a/src/newt/classes/com/jogamp/newt/Display.java b/src/newt/classes/com/jogamp/newt/Display.java
index c618405c2..382a5d583 100644
--- a/src/newt/classes/com/jogamp/newt/Display.java
+++ b/src/newt/classes/com/jogamp/newt/Display.java
@@ -78,7 +78,7 @@ public abstract class Display {
* Stop the running EDT in case this display is destroyed already.<br>
* @return true if EDT has been stopped (destroyed but running), otherwise false.
*/
- public abstract boolean validateEDT();
+ public abstract boolean validateEDTStopped();
/**
* @return true if the native display handle is valid and ready to operate,
diff --git a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
index 47dfca0f3..2fa83e0e2 100644
--- a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
+++ b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
@@ -346,7 +346,7 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
{
final Display newtDisplay = newtChild.getScreen().getDisplay();
final EDTUtil edtUtil = new SWTEDTUtil(newtDisplay, getDisplay());
- edtUtil.restart();
+ edtUtil.start();
newtDisplay.setEDTUtil( edtUtil );
}
diff --git a/src/newt/classes/com/jogamp/newt/util/EDTUtil.java b/src/newt/classes/com/jogamp/newt/util/EDTUtil.java
index e86df2084..52ca95682 100644
--- a/src/newt/classes/com/jogamp/newt/util/EDTUtil.java
+++ b/src/newt/classes/com/jogamp/newt/util/EDTUtil.java
@@ -65,10 +65,10 @@ public interface EDTUtil {
public void setPollPeriod(long ms);
/**
- * Starts or restarts the EDT.
+ * Starts the EDT after it's creation or after {@link #invokeStop(boolean, Runnable) stopping}.
* <p>
- * If the EDT is running, it must be stopped first via {@link #invokeStop(boolean, Runnable)}
- * and the caller should wait until it's stopped via {@link #waitUntilStopped()}.
+ * If the EDT is running, it must be {@link #invokeStop(boolean, Runnable) stopped} first
+ * and the caller should wait {@link #waitUntilStopped() until it's stopped}.
* </p>
*
* @return true if EDT has been successfully restarted, otherwise false
@@ -77,7 +77,7 @@ public interface EDTUtil {
* @see #invokeStop(boolean, java.lang.Runnable)
* @see #waitUntilStopped()
*/
- public boolean restart() throws IllegalStateException;
+ public boolean start() throws IllegalStateException;
/**
* Returns true if the current thread is the event dispatch thread (EDT).
@@ -130,7 +130,7 @@ public interface EDTUtil {
* <li>All previous queued tasks will be finished.</li>
* <li>No new tasks are allowed, an Exception is thrown.</li>
* <li>Can be issued from within EDT, ie from within an enqueued task.</li>
- * <li>{@link #restart()} may follow immediately, ie creating a new EDT</li>
+ * <li>{@link #start()} may follow immediately, ie creating a new EDT</li>
* </ul>
* </p>
* @return true if <code>task</code> has been executed or queued for later execution, otherwise false