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

  1.  
  2. package sub_arctic.lib;
  3.  
  4. import sub_arctic.lib.manager;
  5.  
  6. /** 
  7.  * This class implements a container (parent) object which is limited to 
  8.  * no more than one child.  This is useful primarily as a base class for
  9.  * more sophisticated containers.
  10.  *
  11.  * @author Scott Hudson
  12.  */
  13. public class uni_container extends base_interactor {
  14.  
  15.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  16.  
  17.   /** 
  18.    * Full constructor.
  19.    * @param xv initial x location of the object 
  20.    * @param yv initial y location of the object 
  21.    * @param wv initial width of the object 
  22.    * @param hv initial height of the object 
  23.    * @param chld only child of object (can be null)
  24.    */
  25.   public uni_container(int xv, int yv, int wv, int hv, interactor chld)
  26.     {
  27.       super(xv,yv,wv,hv);
  28.       setup_for_fixed_children(1);
  29.       set_child(0,chld);
  30.     }
  31.  
  32.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  33.  
  34.   /** 
  35.    * Constructor with default (temporary) size and no child.
  36.    * @param xv initial x location of the object 
  37.    * @param yv initial y location of the object 
  38.    */
  39.   public uni_container(int xv, int yv)
  40.     {
  41.       this(xv,yv,73,73,null);
  42.     }
  43.  
  44.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  45.  
  46.   /**
  47.    * Default constructor.  Defaults to location 0,0 a small (temporary)
  48.    * default size, and no child.
  49.    */
  50.    public uni_container()
  51.      {
  52.        this(0,0,73,73,null);
  53.      }
  54.  
  55.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  56.  
  57.   /** 
  58.    * Override add child (since its so commonly used) to mean set_child(0,chld) 
  59.    * @param chld the child object which becomes our only child.
  60.    */
  61.   public void add_child(interactor chld) 
  62. {
  63.       set_child(0,chld);
  64.     }
  65.  
  66.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  67. }
  68.  
  69.   
  70. /*=========================== COPYRIGHT NOTICE ===========================
  71.  
  72. This file is part of the subArctic user interface toolkit.
  73.  
  74. Copyright (c) 1996 Scott Hudson and Ian Smith
  75. All rights reserved.
  76.  
  77. The subArctic system is freely available for most uses under the terms
  78. and conditions described in 
  79.   http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html 
  80. and appearing in full in the lib/interactor.java source file.
  81.  
  82. The current release and additional information about this software can be 
  83. found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
  84.  
  85. ========================================================================*/
  86.