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

  1.  
  2. package sub_arctic.test;
  3.  
  4. /* import various pieces of the sub_arctic toolkit that we need */
  5. import sub_arctic.lib.*;
  6. import sub_arctic.input.*;
  7. import sub_arctic.output.*;
  8. import sub_arctic.constraints.std_function;
  9. import sub_arctic.constraints.std_constraint_impl;
  10. import sub_arctic.constraints.std_encoding_consts;
  11. import sub_arctic.constraints.std_ext_constraint;
  12. import sub_arctic.constraints.ext_objpart_encoding;
  13. import sub_arctic.constraints.op2_impl;
  14. import java.awt.Point;
  15. import java.util.Vector;
  16.  
  17. public class ext_test extends debug_interactor_applet 
  18.   implements callback_object, std_encoding_consts {
  19.  
  20.   /* initialization of sub_arctic interface when applet starts */
  21.   public void build_ui(base_parent_interactor top) 
  22.     {
  23.       int offset_enc = std_function.offset(PARENT.X(), 0).encoding();
  24.       int add_enc = std_function.add(PARENT.X(), PARENT.X(), 0).encoding();
  25.  
  26.       scale s1 = new scale(0,0, 200, 0, 100, 50, 10, this);
  27.       scale s2 = new scale(0,0, 200, 0, 100, 50, 10, this);
  28.  
  29.       button b1 = new button("Test", this);
  30.       b1.set_x_constraint(std_function.offset(OTHER.OBJ(s1).PART_A(), 10));
  31.       b1.set_y_constraint(std_function.offset(OTHER.OBJ(top).Y(), 20));
  32.       top.add_child(b1);
  33.  
  34.       button b2 = new button("Test 2", this);
  35.       b2.set_x_constraint(std_function.add(OTHER.OBJ(b1).X2(),
  36.                     OTHER.OBJ(s2).PART_A(), 10));
  37.       b2.set_y_constraint(std_function.offset(OTHER.OBJ(b1).Y(), 0));
  38.       top.add_child(b2);
  39.  
  40.       s1.set_x_constraint(std_function.offset(OTHER.OBJ(top).X(), 10));
  41.       s1.set_y_constraint(std_function.offset(OTHER.OBJ(b2).Y2(), 10));
  42.       top.add_child(s1);
  43.  
  44.       s2.set_x_constraint(std_function.offset(OTHER.OBJ(top).X(), 10));
  45.       s2.set_y_constraint(std_function.offset(OTHER.OBJ(s1).Y2(), 10));
  46.       top.add_child(s2);
  47.     
  48.     }
  49.  
  50.  
  51.   /* handle callback */
  52.   public void callback(interactor from, event evt, int cb_num, Object cb_parm)
  53.     {
  54.       /* ignore */
  55.     }
  56. };
  57.  
  58. /*=========================== COPYRIGHT NOTICE ===========================
  59.  
  60. This file is part of the subArctic user interface toolkit.
  61.  
  62. Copyright (c) 1996 Scott Hudson and Ian Smith
  63. All rights reserved.
  64.  
  65. The subArctic system is freely available for most uses under the terms
  66. and conditions described in 
  67.   http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html 
  68. and appearing in full in the lib/interactor.java source file.
  69.  
  70. The current release and additional information about this software can be 
  71. found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
  72.  
  73. ========================================================================*/
  74.