home *** CD-ROM | disk | FTP | other *** search
-
- package sub_arctic.input;
-
- import sub_arctic.lib.manager;
-
- /**
- * Focus based input policy. This policy delivers inputs to objects which
- * have previously established themselves as a focus for a given type of input.
- * @author Scott Hudson
- */
- public class focus_policy_class extends input_policy {
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /* Simple constructor. */
- public focus_policy_class()
- {
- /* nothing extra to do here */
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * Attempt to dispatch the event via one of the agents under this policy.
- * @param event evt the event to dispatch
- * @return boolean whether the event was consumed.
- */
- public boolean dispatch_event(event evt)
- {
- dispatch_agent an_agent;
-
- /* walk down the agent list */
- for (int i = 0; i < num_agents(); i++)
- {
- /* try to dispatch with the agent. if it takes it, we are done */
- an_agent = (dispatch_agent)_agent_list.elementAt(i);
- if (an_agent.event_is_useful(evt) &&
- an_agent.dispatch_event(evt, null, null, manager.event_seq_num()))
- return true;
- }
-
- /* nobody wanted it */
- 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/
-
- ========================================================================*/
-