home *** CD-ROM | disk | FTP | other *** search
- package sub_arctic.input;
-
- /**
- * This interface provides you with the basic infrastructure necessary
- * to execute multi-threaded code safely in the sub_arctic framework.<P>
- *
- * This interface defines a function which you can arrange to be called
- * with the sub_arctic system in a "safe state." In this state, you
- * can call any methods on any sub_arctic objects in your interface; if
- * you are not in this state, you <STRONG>should not</STRONG> be modifying
- * the interactor tree or any of the sub_arctic infrastructure. <p>
- *
- * To use this interface in a multi-threaded program, the basic steps
- * are these:
- * <OL>
- * <LI> Create your own threads and then perform some work (such as
- * read from a network, do a long calculation, etc). When you reach
- * a point where you need to update the user interface, proceed to
- * step 2.
- * <LI> You should now create an instance of any object implementing
- * this (work_proc) interface. The object in question should be
- * set up so that it can update the user interface in the way you
- * desire in its run_safely() method.
- * <LI> Hand this work_proc object and an object you want to be the
- * parameter to run_safely() to the manager using the method
- * perform_work(). This will cause (once the synchronization has
- * been achieved) your code in run_safely() to be executed. The
- * thread making the call on the manager will block until the
- * run_safely() completes. In fact, the thread making the
- * call on perform_work() will be the one executing inside
- * run_safely().
- *
- * @author Ian Smith
- */
- public interface work_proc {
- /**
- * This is the function that will get called when the world is safely
- * synchronized and you may update the sub_arctic interface.
- *
- * @param Object obj this parameter is the one given to the manager when
- * the "perform_work" method is called.
- */
- public void run_safely(Object obj);
- //xx need to pass in an event here
- }
- /*=========================== COPYRIGHT NOTICE ===========================
-
- This file is part of the subArctic user interface toolkit.
-
- Copyright (c) 1996 Scott Hudson and Ian Smith
- All rights reserved.
-
- The subArctic system is freely available for most uses under the terms
- and conditions described in
- http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html
- and appearing in full in the lib/interactor.java source file.
-
- The current release and additional information about this software can be
- found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
-
- ========================================================================*/
-