home *** CD-ROM | disk | FTP | other *** search
-
- package sub_arctic.input;
-
- import sub_arctic.lib.interactor;
-
- /**
- * This is a monitor focus agent used for debugging purposes. It does not
- * actually dispatch any input, but instead prints a human readable dump
- * of each event on System.err "as it goes past". This trace can be turned
- * on and off using the do_trace() method (and is by default off).
- */
- public class event_trace_agent extends dispatch_agent {
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /** Are we current doing trace output or not. */
- protected boolean doing_trace;
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /** Default constructor. We default to tracing being off. */
- public event_trace_agent()
- {
- doing_trace = false;
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /** Turn tracing on or off.
- * @param boolean on_off true means we produce trace output.
- */
- public void do_trace(boolean on_off)
- {
- doing_trace = on_off;
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * "Dispatch" an event. This agent never consumes the event.
- *
- * @param event evt event to potential display trace output for
- * @param Object user_info ignored
- * @param interactor to_obj ignored
- * @param int seq_num ignored
- * @returns boolean indication of whether event was consumed (always false).
- */
- public boolean dispatch_event(
- event evt,
- Object user_info,
- interactor to_obj,
- int seq_num)
- {
- if (doing_trace)
- {
- System.err.println(evt);
- }
- return false;
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
- }
- /*=========================== 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/
-
- ========================================================================*/
-