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
GUISynchronizerinterface.This implementation makes uses of
java.awt.EventQueueto 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 voidasyncInvoke(Runnable runnable)Invokes the given runnable asynchronously on the event dispatch thread.booleanisEventDispatchThread()Tests if the current thread is the event dispatch thread.voidsyncInvoke(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.EventQueueclass.- Specified by:
asyncInvokein 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.EventQueueclass. It will cause no harm if this method is invoked from the event dispatch thread; then the runnable will be directly called.- Specified by:
syncInvokein 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:
isEventDispatchThreadin interfacenet.sf.jguiraffe.gui.builder.utils.GUISynchronizer- Returns:
- a flag if this method is called on the event dispatch thread
-
-