home *** CD-ROM | disk | FTP | other *** search
/ Web Page Construction Kit 3.0 / Web Page Construction Kit 3.0.iso / pc / source / 3rdparty / java / jamba / dev / jambaobj.awx / TEMPLATE / TOBJ.JAVA < prev    next >
Encoding:
Text File  |  1996-07-15  |  4.3 KB  |  195 lines

  1. $$IF(JAMBA_EXPLCOMMENTS)
  2. /**
  3. * Jamba code template for $$JAMBA_CLASSNAME$$Obj
  4. * tobj.java
  5. */
  6. $$ENDIF
  7.  
  8. // All Jamba objects are located in the objects package
  9. package Aimtech.objects;
  10.  
  11. // Standard Jamba imports
  12. import java.lang.*;
  13. import java.awt.*;
  14. import java.util.*;
  15. import Aimtech.utils.*;
  16. import Aimtech.effects.*;
  17. import Aimtech.smartpage.*;
  18.  
  19. $$IF(JAMBA_EXPLCOMMENTS)
  20. /**
  21. * Implementation of Jamba $$JAMBA_CLASSNAME$$Obj object
  22. */
  23. $$ENDIF
  24. public class $$JAMBA_CLASSNAME$$Obj extends BaseObj
  25. {
  26.     // Used in objStart to check if previously stopped
  27.     private boolean bStopped = false;
  28.  
  29. $$IF(JAMBA_EXPLCOMMENTS)
  30.     /**
  31.     * Called once, and only once, when object is first loaded. Use
  32.     * to perform one time object initialization
  33.     */
  34. $$ENDIF
  35.     public void objLoad ()
  36.     {
  37. $$IF(JAMBA_TODOCOMMENTS)
  38.         //# TODO - Insert custom code here
  39. $$ENDIF
  40.         super.objLoad();
  41.     }
  42.  
  43. $$IF(JAMBA_EXPLCOMMENTS)
  44.     /**
  45.     * Called each time the Jamba page containing the object is displayed. Use
  46.     * to allocate object resources. These resources should be freed in
  47.     * objFlush
  48.     */
  49. $$ENDIF
  50.     public final void objPrepare()
  51.     {
  52. $$IF(JAMBA_TODOCOMMENTS)
  53.         //# TODO - Insert custom code here
  54. $$ENDIF
  55.         super.objPrepare();
  56.     }
  57.  
  58. $$IF(JAMBA_EXPLCOMMENTS)
  59.     /**
  60.     * Called each time the Jamba page containing the object is removed from
  61.     * the list of recently accessed Jamba pages. Use to free resources
  62.     * allocated by object.
  63.     */
  64. $$ENDIF
  65.     public void objFlush()
  66.     {
  67. $$IF(JAMBA_TODOCOMMENTS)
  68.         //# TODO - Insert custom code here
  69. $$ENDIF
  70.         super.objFlush();
  71.     }
  72.  
  73. $$IF(JAMBA_EXPLCOMMENTS)
  74.     /**
  75.     * Called in response to several events including the object being made
  76.     * visible and the HTML page containing the object being redisplayed.
  77.     */
  78. $$ENDIF
  79.     public void objStart()
  80.     {
  81.         // If object stopped by objStop(), restart it here
  82.         if (bStopped)
  83.         {
  84. $$IF(JAMBA_TODOCOMMENTS)
  85.             //# TODO - Insert custom code here
  86. $$ENDIF
  87.             bStopped = false;
  88.         }
  89.  
  90.         super.objStart();
  91.     }
  92.  
  93. $$IF(JAMBA_EXPLCOMMENTS)
  94.     /**
  95.     * Called in response to several events including the object being made
  96.     * not visible and the HTML page containing the object being changed
  97.     * within a web browser such that another HTML page can be displayed.
  98.     * Use to cease any ongoing object activity.
  99.     */
  100. $$ENDIF
  101.     public void objStop()
  102.     {
  103.         if (!bStopped)
  104.         {
  105. $$IF(JAMBA_TODOCOMMENTS)
  106.             //# TODO - Insert custom code here
  107. $$ENDIF
  108.               bStopped = true;
  109.         }
  110.  
  111.         super.objStop();
  112.     }
  113.  
  114. $$IF(JAMBA_EXPLCOMMENTS)
  115.     /**
  116.      * Called when object properties are set or changed
  117.      */
  118. $$ENDIF
  119.     public synchronized void objSetProp(String name, String value)
  120.     {
  121.         if (name.equals("property1"))
  122.         {
  123. $$IF(JAMBA_TODOCOMMENTS)
  124.             //# TODO - Insert custom code here
  125. $$ENDIF
  126.         }
  127.  
  128.         else if (name.equals("property2"))
  129.         {
  130. $$IF(JAMBA_TODOCOMMENTS)
  131.             //# TODO - Insert custom code here
  132. $$ENDIF
  133.         }
  134.  
  135.         // Default property handling
  136.         else super.objSetProp(name, value);
  137.     }
  138.  
  139. $$IF(JAMBA_EXPLCOMMENTS)
  140.     /**
  141.     * Called to retrieve the current value of an object property.
  142.     */
  143. $$ENDIF
  144.     public synchronized String objGetProp(String name)
  145.     {
  146.         // If object does not track a property value in member variables or
  147.         // does not modify properties without updating the object's property
  148.         // list, it can simply allow the default property handling to occur
  149.         // and not have a case for it in the following code
  150.         if (name.equals("property1"))
  151.         {
  152. $$IF(JAMBA_TODOCOMMENTS)
  153.             //# TODO - Insert custom code here
  154. $$ENDIF
  155.         }
  156.  
  157.         else if (name.equals("property2"))
  158.         {
  159. $$IF(JAMBA_TODOCOMMENTS)
  160.             //# TODO - Insert custom code here
  161. $$ENDIF
  162.         }
  163.  
  164.         return (super.objGetProp(name));
  165.     }
  166.  
  167. $$IF(JAMBA_EXPLCOMMENTS)
  168.     /**
  169.     * Called when an object methods has been called within a ToDo list.
  170.     */
  171. $$ENDIF
  172.     public synchronized boolean objDoMethod(String method, Vector args)
  173.     {
  174.         if (method.equals ("method1"))
  175.         {
  176. $$IF(JAMBA_TODOCOMMENTS)
  177.             //# TODO - Insert custom code here
  178. $$ENDIF
  179.         }
  180.         else if (method.equals ("method2"))
  181.         {
  182. $$IF(JAMBA_TODOCOMMENTS)
  183.             //# TODO - Insert custom code here
  184. $$ENDIF
  185.         }
  186.         else
  187.         {
  188.             return (super.objDoMethod(method, args));
  189.         }
  190.  
  191.         // The method was handled
  192.         return (true);
  193.     }
  194. }
  195.