home *** CD-ROM | disk | FTP | other *** search
/ Best Tools for JAVA / Best Tools for JAVA.iso / JAVA_ALL / IDE / SUBARTIC / SUB_ARCT / INPUT / MENU_FOC.JAV < prev    next >
Encoding:
Text File  |  1996-10-04  |  4.1 KB  |  111 lines

  1. package sub_arctic.input;
  2. import sub_arctic.lib.interactor;
  3. import sub_arctic.lib.menu;
  4.  
  5. /**
  6.  * This interface is used by interactors which are menus or subclasses
  7.  * of menu. It informs you when:
  8.  * 
  9.  * <ul>
  10.  * <li>
  11.  * 1) You receive the "ending" drag of a menu interaction.
  12.  * <li>
  13.  * 2) You receive the "drag" part of a menu interaction on your
  14.  *    area.
  15.  * <li>
  16.  * 3) One of your parents received a "drag" interaction on its area,
  17.  *    or the mouse was released outside your area, 
  18.  *    which implies that you have lost the menu focus and should go
  19.  *    away.
  20.  * </ul>
  21.  * 
  22.  * Be aware: There is are multiple focuses for menus. The trick is 
  23.  * that the menu_focus_agent enforces an ordering on the interactors
  24.  * in its set. If an event occurs on a member of the focus set A which
  25.  * was added before another member of the set B, B is removed from the
  26.  * focus set. Thus, if you override focus_set_enter and focus_set_exit
  27.  * you can detect what it is doing. <p>
  28.  *
  29.  * @author Ian Smith
  30.  */
  31. public interface menu_focusable extends focusable,interactor {
  32.  
  33.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  34.  
  35.   /**
  36.    * This function gets called during the process of the user
  37.    * dragging around on the menu. The menu should probably
  38.    * use pick() to figure out who to highlight based on this
  39.    * event.  Like other focus based agents, its hands you back
  40.    * the object you gave it when you put yourself in the focus set.
  41.    *
  42.    * @param event  evt       event "causing" this action
  43.    * @param Object user_info uninterpreted object that was given at the 
  44.    *                         time focus was established.
  45.    */
  46.   public void menu_feedback(event evt, Object user_info);
  47.  
  48.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  49.  
  50.   /**
  51.    * This function gets called to inform you that the mouse button
  52.    * was released over your menu.  Again, we hand you the object
  53.    * you gave use when you added yourself to the focus.
  54.    */
  55.   public void menu_release(event evt, Object user_info);
  56.  
  57.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  58.  
  59.   /**
  60.    * This function is called to tell you your menu has been
  61.    * exited (the pointer is outside your space). Note you
  62.    * may get this without being removed the focus set... the
  63.    * user might come back!  Also, you are not guaranteed to
  64.    * get this call; you only get if the user leaves your menu.
  65.    *
  66.    * @param event  evt       event "causing" this action
  67.    * @param Object user_info uninterpreted object that was given at the 
  68.    *                         time focus was established.
  69.    */
  70.   public void menu_exit(event evt, Object user_info);
  71.  
  72.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  73.  
  74.   /**
  75.    * This function gets called to ask a menu if  a point
  76.    * generates a menu, an if so which one. This is 
  77.    * useful when dealing with events on a menu, so the 
  78.    * agent will know if it needs to pop a menu down. 
  79.    * 
  80.    * If you get this call it will *only* be called when you have
  81.    * a currently displayed menu as a child. Thus, this is 
  82.    * effectively is a check to see if the currently displayed
  83.    * child is the product of this location.
  84.    * 
  85.    * The x and y coordinates are transformed to your coordinate system.
  86.    *
  87.    * @param int local_x x coordinate of the point in question.
  88.    * @param int local_y y coordinate of the point in question.
  89.    */
  90.   public menu menu_generates_submenu(int local_x, int local_y);
  91.  
  92.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  93.  
  94. }
  95. /*=========================== COPYRIGHT NOTICE ===========================
  96.  
  97. This file is part of the subArctic user interface toolkit.
  98.  
  99. Copyright (c) 1996 Scott Hudson and Ian Smith
  100. All rights reserved.
  101.  
  102. The subArctic system is freely available for most uses under the terms
  103. and conditions described in 
  104.   http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html 
  105. and appearing in full in the lib/interactor.java source file.
  106.  
  107. The current release and additional information about this software can be 
  108. found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
  109.  
  110. ========================================================================*/
  111.