Class 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 Detail

      • SwingGUISynchronizer

        public SwingGUISynchronizer()
    • Method Detail

      • asyncInvoke

        public void asyncInvoke​(Runnable runnable)
        Invokes the given runnable asynchronously on the event dispatch thread. This is done using the java.awt.EventQueue class.
        Specified by:
        asyncInvoke in interface net.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 the java.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 interface net.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 interface net.sf.jguiraffe.gui.builder.utils.GUISynchronizer
        Returns:
        a flag if this method is called on the event dispatch thread