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

  1. /*
  2.  * $Id: text_toggle_test.java,v 1.10 1996/10/03 19:46:51 hudson Exp $
  3.  * $Author: hudson $
  4.  */
  5.  
  6. package sub_arctic.test;
  7.  
  8. import sub_arctic.lib.*;
  9. import sub_arctic.output.*;
  10. import sub_arctic.input.*;
  11. import sub_arctic.constraints.std_function;
  12.  
  13. public class text_toggle_test extends interactor_applet  
  14. implements callback_object {
  15.   static String[] school_data= { "GT", "MIT" , "CMU", "UCB" , "SU"};
  16.   static String[] car_data= { "porsche", "mercedes" , "ferrari", "volvo"};
  17.   public void build_ui(base_parent_interactor tl) {
  18.     text_toggle_collection tt1,tt2;
  19.     // make a toggle group for schools
  20.     tt1=new text_toggle_collection(school_data,true,100,this);
  21.     // make a toggle group for cars
  22.     tt2=new text_toggle_collection(car_data,false,-1,this);
  23.     // put in parent
  24.     tl.add_child(tt1);
  25.     tl.add_child(tt2);
  26.     // set the constraints 
  27.     tt1.set_x_constraint(std_function.offset(PARENT.X(),0));
  28.     tt1.set_y_constraint(std_function.offset(PARENT.Y(),0));
  29.     tt1.set_x_constraint(std_function.offset(PARENT.X(),0));
  30.     tt2.set_y_constraint(std_function.offset(PREV_SIBLING.Y2() ,10));
  31.   }
  32.   public void callback(interactor       from_obj, 
  33.         event            evt,
  34.         int              callback_num, 
  35.                Object           callback_info){
  36.  
  37.     int i=((Integer)from_obj.user_info()).intValue();
  38.     System.out.println("clicked on : " + i);
  39.   }
  40. }
  41. /*=========================== COPYRIGHT NOTICE ===========================
  42.  
  43. This file is part of the subArctic user interface toolkit.
  44.  
  45. Copyright (c) 1996 Scott Hudson and Ian Smith
  46. All rights reserved.
  47.  
  48. The subArctic system is freely available for most uses under the terms
  49. and conditions described in 
  50.   http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html 
  51. and appearing in full in the lib/interactor.java source file.
  52.  
  53. The current release and additional information about this software can be 
  54. found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
  55.  
  56. ========================================================================*/
  57.