Class SwingGUISynchronizer
- java.lang.Object
-
- net.sf.jguiraffe.gui.platform.swing.builder.utils.SwingGUISynchronizer
-
- All Implemented Interfaces:
net.sf.jguiraffe.gui.builder.utils.GUISynchronizer
public class SwingGUISynchronizer extends Object implements net.sf.jguiraffe.gui.builder.utils.GUISynchronizer
The Swing specific implementation of the
GUISynchronizer
interface.This implementation makes uses of
java.awt.EventQueue
to properly deal with the event dispatch thread.- Version:
- $Id: SwingGUISynchronizer.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Constructor Description SwingGUISynchronizer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
asyncInvoke(Runnable runnable)
Invokes the given runnable asynchronously on the event dispatch thread.boolean
isEventDispatchThread()
Tests if the current thread is the event dispatch thread.void
syncInvoke(Runnable runnable)
Invokes the given runnable synchronously on the event dispatch thread.
-
-
-
Method Detail
-
asyncInvoke
public void asyncInvoke(Runnable runnable)
Invokes the given runnable asynchronously on the event dispatch thread. This is done using thejava.awt.EventQueue
class.- Specified by:
asyncInvoke
in interfacenet.sf.jguiraffe.gui.builder.utils.GUISynchronizer
- Parameters:
runnable
- the runnable to be executed
-
syncInvoke
public void syncInvoke(Runnable runnable)
Invokes the given runnable synchronously on the event dispatch thread. This is done using thejava.awt.EventQueue
class. It will cause no harm if this method is invoked from the event dispatch thread; then the runnable will be directly called.- Specified by:
syncInvoke
in interfacenet.sf.jguiraffe.gui.builder.utils.GUISynchronizer
- Parameters:
runnable
- the runnable to be executed
-
isEventDispatchThread
public boolean isEventDispatchThread()
Tests if the current thread is the event dispatch thread.- Specified by:
isEventDispatchThread
in interfacenet.sf.jguiraffe.gui.builder.utils.GUISynchronizer
- Returns:
- a flag if this method is called on the event dispatch thread
-
-