home *** CD-ROM | disk | FTP | other *** search
/ Chip Special: HTML & Java / Chip-Special_1997-01_HTML-a-Java.bin / vjtrial / vjupdate.exe / VJAPPWIZ.AWX / TEMPLATE / APPLET.JVA < prev    next >
Encoding:
Text File  |  1996-07-31  |  20.1 KB  |  668 lines

  1. $$IF(Comments)
  2. //******************************************************************************
  3. // $$AppName$$.java:    Applet
  4. //
  5. //******************************************************************************
  6. $$ENDIF
  7. import java.applet.*;
  8. import java.awt.*;
  9. $$IF(StandAlone)
  10. import $$AppName$$Frame;
  11. $$ENDIF(StandAlone)
  12.  
  13. $$IF(Comments)
  14. //==============================================================================
  15. // Main Class for applet $$AppName$$
  16. //
  17. //==============================================================================
  18. $$ENDIF
  19. $$IF(IsRunnable)
  20. public class $$AppName$$ extends Applet implements Runnable
  21. $$ELSE
  22. public class $$AppName$$ extends Applet
  23. $$ENDIF
  24. {
  25. $$IF(IsRunnable)
  26. $$IF(Comments)
  27.     // THREAD SUPPORT:
  28.     //        m_$$AppName$$    is the Thread object for the applet
  29.     //--------------------------------------------------------------------------
  30. $$ENDIF
  31.     Thread     m_$$AppName$$ = null;
  32.  
  33. $$IF(Animation)
  34. $$IF(Comments)
  35.     // ANIMATION SUPPORT:
  36.     //        m_Graphics        used for storing the applet's Graphics context
  37.     //        m_Images[]        the array of Image objects for the animation
  38.     //        m_nCurrImage    the index of the next image to be displayed
  39.     //        m_ImgWidth        width of each image
  40.     //        m_ImgHeight        height of each image
  41.     //        m_fAllLoaded    indicates whether all images have been loaded
  42.     //        NUM_IMAGES         number of images used in the animation
  43.     //--------------------------------------------------------------------------
  44. $$ENDIF
  45.     private Graphics m_Graphics;
  46.     private Image     m_Images[];
  47.     private int      m_nCurrImage;
  48.     private int      m_nImgWidth  = 0;
  49.     private int      m_nImgHeight = 0;
  50.     private boolean  m_fAllLoaded = false;
  51.     private final int NUM_IMAGES = 18;
  52.  
  53. $$ENDIF(Animation)
  54. $$ENDIF(IsRunnable)
  55. $$IF(StandAlone)
  56.     // STANDALONE APPLICATION SUPPORT:
  57.     //        m_fStandAlone will be set to true if applet is run standalone
  58.     //--------------------------------------------------------------------------
  59.     boolean m_fStandAlone = false;
  60.  
  61. $$ENDIF
  62. $$IF(HasParameters)
  63. $$IF(Comments)
  64.     // PARAMETER SUPPORT:
  65.     //        Parameters allow an HTML author to pass information to the applet;
  66.     // the HTML author specifies them using the <PARAM> tag within the <APPLET>
  67.     // tag.  The following variables are used to store the values of the
  68.     // parameters.
  69.     //--------------------------------------------------------------------------
  70.  
  71.     // Members for applet parameters
  72.     // <type>       <MemberVar>    = <Default Value>
  73.     //--------------------------------------------------------------------------
  74. $$ENDIF
  75. $$BEGINLOOP(Parameters)
  76. $$IF(HasMember)
  77.     private $$ParamType$$ $$ParamMemberName$$ = $$ParamDefValue$$;
  78. $$ENDIF
  79. $$ENDLOOP
  80.  
  81.     // Parameter names.  To change a name of a parameter, you need only make
  82.     // a single change.  Simply modify the value of the parameter string below.
  83.     //--------------------------------------------------------------------------
  84. $$BEGINLOOP(Parameters)
  85.     private final String PARAM_$$ParamName$$ = "$$ParamName$$";
  86. $$ENDLOOP
  87. $$IF(StandAlone)
  88.  
  89. $$IF(Comments)
  90.     // STANDALONE APPLICATION SUPPORT
  91.     //     The GetParameter() method is a replacement for the getParameter() method
  92.     // defined by Applet. This method returns the value of the specified parameter;
  93.     // unlike the original getParameter() method, this method works when the applet
  94.     // is run as a standalone application, as well as when run within an HTML page.
  95.     // This method is called by GetParameters().
  96.     //---------------------------------------------------------------------------
  97. $$ENDIF(Comments)
  98.     String GetParameter(String strName, String args[])
  99.     {
  100.         if (args == null)
  101.         {
  102. $$IF(Comments)
  103.             // Running within an HTML page, so call original getParameter().
  104.             //-------------------------------------------------------------------
  105. $$ENDIF(Comments)
  106.             return getParameter(strName);
  107.         }
  108.  
  109. $$IF(Comments)
  110.         // Running as standalone application, so parameter values are obtained from
  111.         // the command line. The user specifies them as follows:
  112.         //
  113.         //    JView $$AppName$$ param1=<val> param2=<"val with spaces"> ...
  114.         //-----------------------------------------------------------------------
  115. $$ENDIF(Comments)
  116.         int    i;
  117.         String strArg    = strName + "=";
  118.         String strValue = null;
  119.  
  120.         for (i = 0; i < args.length; i++)
  121.         {
  122.             if (strArg.equalsIgnoreCase(args[i].substring(0, strArg.length())))
  123.             {
  124.                 // Found matching parameter on command line, so extract its value.
  125.                 // If in double quotes, remove the quotes.
  126.                 //---------------------------------------------------------------
  127.                 strValue= args[i].substring(strArg.length());
  128.                 if (strValue.startsWith("\""))
  129.                 {
  130.                     strValue = strValue.substring(1);
  131.                     if (strValue.endsWith("\""))
  132.                         strValue = strValue.substring(0, strValue.length() - 1);
  133.                 }
  134.             }
  135.         }
  136.  
  137.         return strValue;
  138.     }
  139.  
  140. $$IF(Comments)
  141.     // STANDALONE APPLICATION SUPPORT
  142.     //     The GetParameters() method retrieves the values of each of the applet's
  143.     // parameters and stores them in variables. This method works both when the
  144.     // applet is run as a standalone application and when it's run within an HTML
  145.     // page.  When the applet is run as a standalone application, this method is
  146.     // called by the main() method, which passes it the command-line arguments.
  147.     // When the applet is run within an HTML page, this method is called by the
  148.     // init() method with args == null.
  149.     //---------------------------------------------------------------------------
  150. $$ENDIF(Comments)
  151.     void GetParameters(String args[])
  152.     {
  153. $$IF(Comments)
  154.         // Query values of all Parameters
  155.         //--------------------------------------------------------------
  156. $$ENDIF
  157.         String param;
  158.  
  159. $$BEGINLOOP(Parameters)
  160. $$IF(Comments)
  161.         // $$ParamName$$: $$ParamDescription$$
  162.         //--------------------------------------------------------------
  163. $$ENDIF
  164.         param = GetParameter(PARAM_$$ParamName$$, args);
  165.         if (param != null)
  166. $$IF(HasMember)
  167.             $$ParamMemberName$$ = $$ParamFromString$$;
  168. $$ELSE
  169. $$IF(TODOComments)
  170.             // TODO: Process parameter $$ParamName$$
  171. $$ENDIF
  172.             ;
  173.         else
  174. $$IF(TODOComments)
  175.             // TODO: Handle case of parameter not provided
  176. $$ENDIF
  177.             ;                
  178. $$ENDIF(HasMember)
  179.  
  180. $$ENDLOOP()
  181.     }
  182.  
  183. $$ENDIF(StandAlone)
  184. $$ENDIF(HasParameters)
  185. $$IF(StandAlone)
  186. $$IF(Comments)
  187.     // STANDALONE APPLICATION SUPPORT
  188.     //     The main() method acts as the applet's entry point when it is run
  189.     // as a standalone application. It is ignored if the applet is run from
  190.     // within an HTML page.
  191.     //--------------------------------------------------------------------------
  192. $$ENDIF
  193.     public static void main(String args[])
  194.     {
  195. $$IF(Comments)
  196.         // Create Toplevel Window to contain applet $$AppName$$
  197.         //----------------------------------------------------------------------
  198. $$ENDIF
  199.         $$AppName$$Frame frame = new $$AppName$$Frame("$$AppName$$");
  200.  
  201.         // Must show Frame before we size it so insets() will return valid values
  202.         //----------------------------------------------------------------------
  203.         frame.show();
  204.         frame.hide();
  205.         frame.resize(frame.insets().left + frame.insets().right  + $$InitialWidth$$,
  206.                      frame.insets().top  + frame.insets().bottom + $$InitialHeight$$);
  207.  
  208. $$IF(Comments)
  209.         // The following code starts the applet running within the frame window.
  210.         // It also calls GetParameters() to retrieve parameter values from the
  211.         // command line, and sets m_fStandAlone to true to prevent init() from
  212.         // trying to get them from the HTML page.
  213.         //----------------------------------------------------------------------
  214. $$ENDIF
  215.         $$AppName$$ applet_$$AppName$$ = new $$AppName$$();
  216.  
  217.         frame.add("Center", applet_$$AppName$$);
  218.         applet_$$AppName$$.m_fStandAlone = true;
  219. $$IF(HasParameters)
  220.         applet_$$AppName$$.GetParameters(args);
  221. $$ENDIF
  222.         applet_$$AppName$$.init();
  223.         applet_$$AppName$$.start();
  224.         frame.show();
  225.     }
  226. $$ENDIF(StandAlone)
  227.  
  228. $$IF(Comments)
  229.     // $$AppName$$ Class Constructor
  230.     //--------------------------------------------------------------------------
  231. $$ENDIF
  232.     public $$AppName$$()
  233.     {
  234. $$IF(TODOComments)
  235.         // TODO: Add constructor code here
  236. $$ENDIF
  237.     }
  238.  
  239. $$IF(Comments)
  240.     // APPLET INFO SUPPORT:
  241.     //        The getAppletInfo() method returns a string describing the applet's
  242.     // author, copyright date, or miscellaneous information.
  243.     //--------------------------------------------------------------------------
  244. $$ENDIF
  245.     public String getAppletInfo()
  246.     {
  247. $$BEGINLOOP(AppInfoLines)
  248.         $$AppInfoLine$$
  249. $$ENDLOOP
  250.     }
  251.  
  252. $$IF(HasParameters)
  253. $$IF(Comments)
  254.     // PARAMETER SUPPORT
  255.     //        The getParameterInfo() method returns an array of strings describing
  256.     // the parameters understood by this applet.
  257.     //
  258.     // $$AppName$$ Parameter Information:
  259.     //  { "Name", "Type", "Description" },
  260.     //--------------------------------------------------------------------------
  261. $$ENDIF
  262.     public String[][] getParameterInfo()
  263.     {
  264.         String[][] info =
  265.         {
  266. $$BEGINLOOP(Parameters)
  267.             { PARAM_$$ParamName$$, "$$ParamType$$", "$$ParamDescription$$" },
  268. $$ENDLOOP
  269.         };
  270.         return info;        
  271.     }
  272. $$ENDIF(Parameters)
  273.  
  274. $$IF(Comments)
  275.     // The init() method is called by the AWT when an applet is first loaded or
  276.     // reloaded.  Override this method to perform whatever initialization your
  277.     // applet needs, such as initializing data structures, loading images or
  278.     // fonts, creating frame windows, setting the layout manager, or adding UI
  279.     // components.
  280.     //--------------------------------------------------------------------------
  281. $$ENDIF
  282.     public void init()
  283.     {
  284. $$IF(HasParameters)
  285. $$IF(StandAlone)
  286.         if (!m_fStandAlone)
  287.             GetParameters(null);
  288. $$ELSE
  289. $$IF(Comments)
  290.         // PARAMETER SUPPORT
  291.         //        The following code retrieves the value of each parameter
  292.         // specified with the <PARAM> tag and stores it in a member
  293.         // variable.
  294.         //----------------------------------------------------------------------
  295. $$ENDIF
  296.         String param;
  297.  
  298. $$BEGINLOOP(Parameters)
  299. $$IF(Comments)
  300.         // $$ParamName$$: $$ParamDescription$$
  301.         //----------------------------------------------------------------------
  302. $$ENDIF
  303.         param = getParameter(PARAM_$$ParamName$$);
  304.         if (param != null)
  305. $$IF(HasMember)
  306.             $$ParamMemberName$$ = $$ParamFromString$$;
  307. $$ELSE
  308. $$IF(TODOComments)
  309.             // TODO: Process parameter $$ParamName$$
  310. $$ENDIF
  311.             ;
  312.         else
  313. $$IF(TODOComments)
  314.             // TODO: Handle case of parameter not provided
  315. $$ENDIF
  316.             ;
  317. $$ENDIF(HasMember)
  318.  
  319. $$ENDLOOP()
  320. $$ENDIF(StandAlone)
  321. $$ENDIF(HasParameters)
  322.         // If you use a ResourceWizard-generated "control creator" class to
  323.         // arrange controls in your applet, you may want to call its
  324.         // CreateControls() method from within this method. Remove the following
  325.         // call to resize() before adding the call to CreateControls();
  326.         // CreateControls() does its own resizing.
  327.         //----------------------------------------------------------------------
  328.         resize($$InitialWidth$$, $$InitialHeight$$);
  329.  
  330. $$IF(TODOComments)
  331.         // TODO: Place additional initialization code here
  332. $$ENDIF
  333.     }
  334.  
  335. $$IF(Comments)
  336.     // Place additional applet clean up code here.  destroy() is called when
  337.     // when you applet is terminating and being unloaded.
  338.     //-------------------------------------------------------------------------
  339. $$ENDIF
  340.     public void destroy()
  341.     {
  342. $$IF(TODOComments)
  343.         // TODO: Place applet cleanup code here
  344. $$ENDIF
  345.     }
  346.  
  347. $$IF(Animation)
  348. $$IF(Comments)
  349.     // ANIMATION SUPPORT:
  350.     //        Draws the next image, if all images are currently loaded
  351.     //--------------------------------------------------------------------------
  352. $$ENDIF
  353.     private void displayImage(Graphics g)
  354.     {
  355.         if (!m_fAllLoaded)
  356.             return;
  357.  
  358. $$IF(Comments)
  359.         // Draw Image in center of applet
  360.         //----------------------------------------------------------------------
  361. $$ENDIF
  362.         g.drawImage(m_Images[m_nCurrImage],
  363.                    (size().width - m_nImgWidth)   / 2,
  364.                    (size().height - m_nImgHeight) / 2, null);
  365.     }
  366.  
  367. $$ENDIF(Animation)
  368. $$IF(Comments)
  369.     // $$AppName$$ Paint Handler
  370.     //--------------------------------------------------------------------------
  371. $$ENDIF
  372.     public void paint(Graphics g)
  373.     {
  374. $$IF(Animation)
  375.         // ANIMATION SUPPORT:
  376.         //        The following code displays a status message until all the
  377.         // images are loaded. Then it calls displayImage to display the current
  378.         // image.
  379.         //----------------------------------------------------------------------
  380.         if (m_fAllLoaded)
  381.         {
  382.             Rectangle r = g.getClipRect();
  383.             
  384.             g.clearRect(r.x, r.y, r.width, r.height);
  385.             displayImage(g);
  386.         }
  387.         else
  388.             g.drawString("Loading images...", 10, 20);
  389.  
  390. $$IF(TODOComments)
  391.         // TODO: Place additional applet Paint code here
  392. $$ENDIF
  393. $$ELIF(IsRunnable)
  394. $$IF(TODOComments)
  395.         // TODO: Place applet paint code here
  396. $$ENDIF
  397.         g.drawString("Running: " + Math.random(), 10, 20);
  398. $$ELSE
  399.         g.drawString("Created with Microsoft Visual J++ Version 1.0", 10, 20);
  400. $$ENDIF(Animation)
  401.     }
  402.  
  403. $$IF(Comments)
  404.     //        The start() method is called when the page containing the applet
  405.     // first appears on the screen. The AppletWizard's initial implementation
  406.     // of this method starts execution of the applet's thread.
  407.     //--------------------------------------------------------------------------
  408. $$ENDIF
  409.     public void start()
  410.     {
  411. $$IF(IsRunnable)
  412.         if (m_$$AppName$$ == null)
  413.         {
  414.             m_$$AppName$$ = new Thread(this);
  415.             m_$$AppName$$.start();
  416.         }
  417. $$ENDIF
  418. $$IF(TODOComments)
  419.         // TODO: Place additional applet start code here
  420. $$ENDIF
  421.     }
  422.     
  423. $$IF(Comments)
  424.     //        The stop() method is called when the page containing the applet is
  425.     // no longer on the screen. The AppletWizard's initial implementation of
  426.     // this method stops execution of the applet's thread.
  427.     //--------------------------------------------------------------------------
  428. $$ENDIF
  429.     public void stop()
  430.     {
  431. $$IF(IsRunnable)
  432.         if (m_$$AppName$$ != null)
  433.         {
  434.             m_$$AppName$$.stop();
  435.             m_$$AppName$$ = null;
  436.         }
  437. $$IF(TODOComments)
  438.  
  439.         // TODO: Place additional applet stop code here
  440. $$ENDIF
  441. $$ENDIF(IsRunnable)
  442.     }
  443.  
  444. $$IF(IsRunnable)
  445. $$IF(Comments)
  446.     // THREAD SUPPORT
  447.     //        The run() method is called when the applet's thread is started. If
  448.     // your applet performs any ongoing activities without waiting for user
  449.     // input, the code for implementing that behavior typically goes here. For
  450.     // example, for an applet that performs animation, the run() method controls
  451.     // the display of images.
  452.     //--------------------------------------------------------------------------
  453. $$ENDIF
  454.     public void run()
  455.     {
  456. $$IF(Animation)
  457.         m_nCurrImage = 0;
  458.         
  459.         // If re-entering the page, then the images have already been loaded.
  460.         // m_fAllLoaded == TRUE.
  461.         //----------------------------------------------------------------------
  462.         if (!m_fAllLoaded)
  463.         {
  464.             repaint();
  465.             m_Graphics = getGraphics();
  466.             m_Images   = new Image[NUM_IMAGES];
  467.  
  468. $$IF(Comments)
  469.             // Load in all the images
  470.             //------------------------------------------------------------------
  471. $$ENDIF
  472.             MediaTracker tracker = new MediaTracker(this);
  473.             String strImage;
  474.  
  475.             // For each image in the animation, this method first constructs a
  476.             // string containing the path to the image file; then it begins
  477.             // loading the image into the m_Images array.  Note that the call to
  478.             // getImage will return before the image is completely loaded.
  479.             //------------------------------------------------------------------
  480.             for (int i = 1; i <= NUM_IMAGES; i++)
  481.             {
  482. $$IF(Comments)
  483.                 // Build path to next image
  484.                 //--------------------------------------------------------------
  485. $$ENDIF
  486.                 strImage = "images/img00" + ((i < 10) ? "0" : "") + i + ".gif";
  487. $$IF(StandAlone)
  488.                 if (m_fStandAlone)
  489.                     m_Images[i-1] = Toolkit.getDefaultToolkit().getImage(strImage);
  490.                 else
  491.                     m_Images[i-1] = getImage(getDocumentBase(), strImage);
  492. $$ELSE
  493.                 m_Images[i-1] = getImage(getDocumentBase(), strImage);
  494. $$ENDIF
  495.  
  496.                 tracker.addImage(m_Images[i-1], 0);
  497.             }
  498.  
  499. $$IF(Comments)
  500.             // Wait until all images are fully loaded
  501.             //------------------------------------------------------------------
  502. $$ENDIF
  503.             try
  504.             {
  505.                 tracker.waitForAll();
  506.                 m_fAllLoaded = !tracker.isErrorAny();
  507.             }
  508.             catch (InterruptedException e)
  509.             {
  510. $$IF(TODOComments)
  511.                 // TODO: Place exception-handling code here in case an
  512.                 //       InterruptedException is thrown by Thread.sleep(),
  513.                 //         meaning that another thread has interrupted this one
  514. $$ENDIF
  515.             }
  516.             
  517.             if (!m_fAllLoaded)
  518.             {
  519.                 stop();
  520.                 m_Graphics.drawString("Error loading images!", 10, 40);
  521.                 return;
  522.             }
  523.             
  524. $$IF(Comments)
  525.  
  526.             // Assuming all images are same width and height.
  527.             //--------------------------------------------------------------
  528. $$ENDIF
  529.             m_nImgWidth  = m_Images[0].getWidth(this);
  530.             m_nImgHeight = m_Images[0].getHeight(this);
  531.         }        
  532.         repaint();
  533.  
  534. $$ENDIF(Animation)
  535.         while (true)
  536.         {
  537.             try
  538.             {
  539. $$IF(Animation)
  540. $$IF(Comments)
  541.                 // Draw next image in animation
  542.                 //--------------------------------------------------------------
  543. $$ENDIF
  544.                 displayImage(m_Graphics);
  545.                 m_nCurrImage++;
  546.                 if (m_nCurrImage == NUM_IMAGES)
  547.                     m_nCurrImage = 0;
  548.  
  549. $$ELSE
  550.                 repaint();
  551. $$ENDIF(Animation)
  552. $$IF(TODOComments)
  553.                 // TODO:  Add additional thread-specific code here
  554. $$ENDIF
  555.                 Thread.sleep(50);
  556.             }
  557.             catch (InterruptedException e)
  558.             {
  559. $$IF(TODOComments)
  560.                 // TODO: Place exception-handling code here in case an
  561.                 //       InterruptedException is thrown by Thread.sleep(),
  562.                 //         meaning that another thread has interrupted this one
  563. $$ENDIF
  564.                 stop();
  565.             }
  566.         }
  567.     }
  568. $$ENDIF(IsRunnable)
  569.  
  570. $$IF(Mouse)
  571. $$IF(MouseDownUp)
  572. $$IF(Comments)
  573.     // MOUSE SUPPORT:
  574.     //        The mouseDown() method is called if the mouse button is pressed
  575.     // while the mouse cursor is over the applet's portion of the screen.
  576.     //--------------------------------------------------------------------------
  577. $$ENDIF
  578.     public boolean mouseDown(Event evt, int x, int y)
  579.     {
  580. $$IF(TODOComments)
  581.         // TODO: Place applet mouseDown code here
  582. $$ENDIF
  583.         return true;
  584.     }
  585.  
  586. $$IF(Comments)
  587.     // MOUSE SUPPORT:
  588.     //        The mouseUp() method is called if the mouse button is released
  589.     // while the mouse cursor is over the applet's portion of the screen.
  590.     //--------------------------------------------------------------------------
  591. $$ENDIF
  592.     public boolean mouseUp(Event evt, int x, int y)
  593.     {
  594. $$IF(TODOComments)
  595.         // TODO: Place applet mouseUp code here
  596. $$ENDIF
  597.         return true;
  598.     }
  599. $$ENDIF(MouseDownUp)
  600. $$IF(MouseDragMove)
  601.  
  602. $$IF(Comments)
  603.     // MOUSE SUPPORT:
  604.     //        The mouseDrag() method is called if the mouse cursor moves over the
  605.     // applet's portion of the screen while the mouse button is being held down.
  606.     //--------------------------------------------------------------------------
  607. $$ENDIF
  608.     public boolean mouseDrag(Event evt, int x, int y)
  609.     {
  610. $$IF(TODOComments)
  611.         // TODO: Place applet mouseDrag code here
  612. $$ENDIF
  613.         return true;
  614.     }
  615.  
  616. $$IF(Comments)
  617.     // MOUSE SUPPORT:
  618.     //        The mouseMove() method is called if the mouse cursor moves over the
  619.     // applet's portion of the screen and the mouse button isn't being held down.
  620.     //--------------------------------------------------------------------------
  621. $$ENDIF
  622.     public boolean mouseMove(Event evt, int x, int y)
  623.     {
  624. $$IF(TODOComments)
  625.         // TODO: Place applet mouseMove code here
  626. $$ENDIF
  627.         return true;
  628.     }
  629. $$ENDIF(MouseDragMove)
  630. $$IF(MouseEnterExit)
  631.  
  632. $$IF(Comments)
  633.     // MOUSE SUPPORT:
  634.     //        The mouseEnter() method is called if the mouse cursor enters the
  635.     // applet's portion of the screen.
  636.     //--------------------------------------------------------------------------
  637. $$ENDIF
  638.     public boolean mouseEnter(Event evt, int x, int y)
  639.     {
  640. $$IF(TODOComments)
  641.         // TODO: Place applet mouseEnter code here
  642. $$ENDIF
  643.         return true;
  644.     }
  645.  
  646. $$IF(Comments)
  647.     // MOUSE SUPPORT:
  648.     //        The mouseExit() method is called if the mouse cursor leaves the
  649.     // applet's portion of the screen.
  650.      //--------------------------------------------------------------------------
  651. $$ENDIF
  652.     public boolean mouseExit(Event evt, int x, int y)
  653.     {
  654. $$IF(TODOComments)
  655.         // TODO: Place applet mouseExit code here
  656. $$ENDIF
  657.         return true;
  658.     }
  659. $$ENDIF(MouseDragMove)
  660. $$ENDIF(Mouse)
  661.  
  662. $$IF(TODOComments)
  663.  
  664.     // TODO: Place additional applet code here
  665.  
  666. $$ENDIF
  667. }
  668.