home *** CD-ROM | disk | FTP | other *** search
- /*
- * $Id: text_toggle_test.java,v 1.10 1996/10/03 19:46:51 hudson Exp $
- * $Author: hudson $
- */
-
- package sub_arctic.test;
-
- import sub_arctic.lib.*;
- import sub_arctic.output.*;
- import sub_arctic.input.*;
- import sub_arctic.constraints.std_function;
-
- public class text_toggle_test extends interactor_applet
- implements callback_object {
- static String[] school_data= { "GT", "MIT" , "CMU", "UCB" , "SU"};
- static String[] car_data= { "porsche", "mercedes" , "ferrari", "volvo"};
- public void build_ui(base_parent_interactor tl) {
- text_toggle_collection tt1,tt2;
- // make a toggle group for schools
- tt1=new text_toggle_collection(school_data,true,100,this);
- // make a toggle group for cars
- tt2=new text_toggle_collection(car_data,false,-1,this);
- // put in parent
- tl.add_child(tt1);
- tl.add_child(tt2);
- // set the constraints
- tt1.set_x_constraint(std_function.offset(PARENT.X(),0));
- tt1.set_y_constraint(std_function.offset(PARENT.Y(),0));
- tt1.set_x_constraint(std_function.offset(PARENT.X(),0));
- tt2.set_y_constraint(std_function.offset(PREV_SIBLING.Y2() ,10));
- }
- public void callback(interactor from_obj,
- event evt,
- int callback_num,
- Object callback_info){
-
- int i=((Integer)from_obj.user_info()).intValue();
- System.out.println("clicked on : " + i);
- }
- }
- /*=========================== 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/
-
- ========================================================================*/
-