home *** CD-ROM | disk | FTP | other *** search
/ Internet 1996 World Exposition / park.org.s3.amazonaws.com.7z / park.org.s3.amazonaws.com / Japan / Public / Hiroshima / java / NeonSign.java < prev    next >
Encoding:
Java Source  |  2017-09-21  |  13.0 KB  |  509 lines

  1. /*
  2.  *
  3.  *    NeonSign.java    1.00    96/02/15    S.Nakagawa
  4.  *
  5.  *    Copyright (c) 1996 KOTOBUKI SYSTEM CO.,LTD. All Rights Reserved.
  6.  *
  7.  *    ï@ö\        :    ÄwÆΦé│éΩé╜âpâ^ü[âôâtâ@âCâïé╔ôoÿ^é│éΩé─éóéΘâpâ^ü[âôé≡ôdî⌡îfĪé╖éΘüB
  8.  *
  9.  *    âpâëâüü[â^    :    patfile        âpâ^ü[âôâtâ@âCâïû╝é≡ÄwÆΦé╖éΘüB
  10.  *                    backcolor    ôdî⌡îfĪö┬é╠öwîié╠ÉFé≡ÄwÆΦé╖éΘüB
  11.  *                                "r,g,b"é╠Åçé┼ÄwÆΦé╖éΘüB
  12.  *                                Å╚ù¬Ä₧é═üA"0,0,0" é╞é╖éΘüB
  13.  *                    lightcolor    ôdïàé¬ô_éóé─éóéΘÅΩìçé╠ÉFé≡ÄwÆΦé╖éΘüB
  14.  *                                "r,g,b"é╠Åçé┼ÄwÆΦé╖éΘüB
  15.  *                                Å╚ù¬Ä₧é═üA"255,255,0" é╞é╖éΘüB
  16.  *                    outcolor    ôdïàé¬Å┴éªé─éóéΘÅΩìçé╠ÉFé≡ÄwÆΦé╖éΘüB
  17.  *                                "r,g,b"é╠Åçé┼ÄwÆΦé╖éΘüB
  18.  *                                Å╚ù¬Ä₧é═üA"204,204,0" é╞é╖éΘüB
  19.  *                    lightsize    ôdïàé╠âTâCâYé≡ÄwÆΦé╖éΘüB
  20.  *                                Å╚ù¬Ä₧é═üA5 é╞é╖éΘüB
  21.  *                                òKé╕ 2 ê╚Åπé≡ÄwÆΦé╡é╚é»éΩé╬éóé»é╚éóüB
  22.  *                    lightbetw    ôdïàè╘é╠âTâCâYé≡ÄwÆΦé╖éΘüB
  23.  *                                Å╚ù¬Ä₧é═üA2 é╞é╖éΘüB
  24.  *                    scroll        ôdî⌡îfĪö┬é╠âXâNâìü[âïæ¼ôxé≡ôdïàé╠î┬Éöé┼ÄwÆΦé╖éΘüB
  25.  *                                Å╚ù¬Ä₧é═üA1 é╞é╖éΘüB
  26.  *                    speed        ôdî⌡îfĪö┬é╠ăé╠âXâNâìü[âïé▄é┼é╠Ä₧è╘é≡â~âèòbé┼ÄwÆΦé╖éΘüB
  27.  *                                Å╚ù¬Ä₧é═üA100 é╞é╖éΘüB
  28.  *
  29.  *    Ägùpùß        :    <APPLET CODE="NeonSign.class" WIDTH=300 HEIGHT=300>
  30.  *                    <PARAM NAME=PATFILE    VALUE="..\Java\sign.dat">
  31.  *                    <PARAM NAME=BACKCOLOR  VALUE="0,0,0">
  32.  *                    <PARAM NAME=LIGHTCOLOR VALUE="255,255,0">
  33.  *                    <PARAM NAME=OUTCOLOR   VALUE="204,204,0">
  34.  *                    <PARAM NAME=LIGHTSIZE  VALUE=5>
  35.  *                    <PARAM NAME=LIGHTBETW  VALUE=2>
  36.  *                    <PARAM NAME=SCROLL     VALUE=1>
  37.  *                    <PARAM NAME=SPEED      VALUE=100>
  38.  *                    </APPLET>
  39.  */
  40. import    java.applet.Applet;
  41. import    java.awt.Image;
  42. import    java.awt.Event;
  43. import    java.awt.Color;
  44. import    java.awt.Graphics;
  45. import    java.awt.Component;
  46. import    java.lang.System;
  47. import    java.util.StringTokenizer;
  48. import    java.io.InputStream;
  49. import    java.io.DataInputStream;
  50. import    java.net.URL;
  51. //import    java.net.MalformedURLException;
  52.  
  53.  
  54. /*
  55.  *    NeonSign Class.
  56.  *
  57.  *    ì∞ɼÄ╥        :    S.Nakagawa
  58.  *    Version        :    1.00    96/02/15
  59.  */
  60. public
  61. class    NeonSign    extends    Applet    implements Runnable
  62. {
  63.     /*
  64.      *    âvâìâZâXüAâXâîâbâhè╓ÿA
  65.      */
  66.     Thread        engine            =    null;    /*    âXâîâbâhÅεò±                */
  67.     boolean        threadSuspended    =    false;    /*    âXâîâbâhÆΓÄ~âtâëâO            */
  68.     int            errorCode        =    0;        /*    âGâëü[ö╘ìå                    */
  69.  
  70.     /*
  71.      *    âIâtâXâNâèü[âôù╠êµ
  72.      */
  73.     Graphics    offScrGraph;                /*    âCâüü[âWüEâRâôâeâLâXâg        */
  74.     Image        offScrImage;                /*    âCâüü[âWÅεò±                */
  75.  
  76.     /*
  77.      *    ôdî⌡îfĪö┬ò\Īâpâ^ü[âô
  78.      */
  79.     int            patCount;                    /*    âpâ^ü[âôî┬Éö                */
  80.     int            patHeight;                    /*    âpâ^ü[âôé╠ìéé│                */
  81.     int            patWidth;                    /*    âpâ^ü[âôé╠ò¥                */
  82.     char        patChar;                    /*    ùLî°ò╢ÄÜ                    */
  83.     Graphics    neonScrGraph;                /*    âCâüü[âWüEâRâôâeâLâXâg        */
  84.     Image        neonScrImage;                /*    âCâüü[âWÅεò±                */
  85.     int            neonWidth;                    /*    âCâüü[âWüEâTâCâY            */
  86.     int            neonHeight;                    /*    âCâüü[âWüEâTâCâY            */
  87.     int            neonPos        =    0;            /*    ò\ĪèJÄnê╩Æu                */
  88.  
  89.     /*
  90.      *    âpâëâüü[â^
  91.      */
  92.     String    patFile;                        /*    âpâ^ü[âôâtâ@âCâïû╝            */
  93.     Color    backColor;                        /*    ôdî⌡îfĪö┬öwîiÉF            */
  94.     Color    lightColor;                        /*    ôdïàô_ôòÉF                    */
  95.     Color    outColor;                        /*    ôdïàÅ┴ôòÉF                    */
  96.     int        lightSize;                        /*    ôdïàâTâCâY                    */
  97.     int        lightBetw;                        /*    ôdïàè╘âTâCâY                */
  98.     int        scroll;                            /*    âXâNâìü[âïæ¼ôx                */
  99.     int        speed;                            /*    Äƒé╠âXâNâìü[âïé▄é┼é╠Ä₧è╘    */
  100.  
  101.  
  102.     /*
  103.      *    Åëè·Åêù¥
  104.      *    <PARAM NAME=....>éµéΦôné│éΩé╜âpâëâüü[â^é≡ĵô╛é╖éΘüB
  105.      *    Äµô╛é╡é╜âpâëâüü[â^âtâ@âCâïé⌐éτâpâ^ü[âôé≡ÆèÅoé╖éΘüB
  106.      *    âIâtâXâNâèü[âôé╔ôdî⌡îfĪö┬é≡ì∞ɼé╖éΘüB
  107.      */
  108.     public    void    init()
  109.     {
  110.         InputStream        is;                    /*    âtâ@âCâïüEâXâgâèü[âÇ        */
  111.         int                keyEnd;                /*    îƒì⌡ò╢ÄÜê╩Æu                */
  112.         int                red;                /*    É╘ÉFö╘ìå                    */
  113.         int                green;                /*    ù╬ÉFö╘ìå                    */
  114.         int                blue;                /*    É┬ÉFö╘ìå                    */
  115.         StringTokenizer    st;                    /*    âtâHü[â}âbâgòté½ò╢ÄÜù±        */
  116.  
  117.  
  118.         /*
  119.          *    âpâëâüü[â^é≡ĵô╛é╖éΘ
  120.          */
  121.         /*    âpâ^ü[âôâtâ@âCâïû╝    */
  122.         patFile    =    getParameter( "patfile" );
  123.         if ( patFile == null )
  124.         {
  125.             errorCode    =    1;
  126.             return    ;
  127.         }
  128.  
  129.         /*    ôdî⌡îfĪö┬öwîiÉF    */
  130.         String    at    =    getParameter( "backcolor" );
  131.         if ( at == null )
  132.         {
  133.             backColor    =    new    Color( 0, 0, 0 );
  134.         }
  135.         else
  136.         {
  137.             keyEnd    =    at.indexOf( "," );
  138.             red        =    Integer.valueOf( at.substring( 0, keyEnd ) ).intValue();
  139.             st        =    new    StringTokenizer( at.substring( keyEnd + 1 ), "," );
  140.             green    =    Integer.valueOf( st.nextToken() ).intValue();
  141.             blue    =    Integer.valueOf( st.nextToken() ).intValue();
  142.             backColor    =    new    Color( red, green, blue );
  143.         }
  144.  
  145.         /*    ôdïàô_ôòÉF    */
  146.         at    =    getParameter( "lightcolor" );
  147.         if ( at == null )
  148.         {
  149.             lightColor    =    new    Color( 255, 255, 0 );
  150.         }
  151.         else
  152.         {
  153.             keyEnd    =    at.indexOf( "," );
  154.             red        =    Integer.valueOf( at.substring( 0, keyEnd ) ).intValue();
  155.             st        =    new    StringTokenizer( at.substring( keyEnd + 1 ), "," );
  156.             green    =    Integer.valueOf( st.nextToken() ).intValue();
  157.             blue    =    Integer.valueOf( st.nextToken() ).intValue();
  158.             lightColor    =    new    Color( red, green, blue );
  159.         }
  160.  
  161.         /*    ôdïàô_Å┴ôò    */
  162.         at    =    getParameter( "outcolor" );
  163.         if ( at == null )
  164.         {
  165.             outColor    =    new    Color( 102, 102, 102 );
  166.         }
  167.         else
  168.         {
  169.             keyEnd    =    at.indexOf( "," );
  170.             red        =    Integer.valueOf( at.substring( 0, keyEnd ) ).intValue();
  171.             st        =    new    StringTokenizer( at.substring( keyEnd + 1 ), "," );
  172.             green    =    Integer.valueOf( st.nextToken() ).intValue();
  173.             blue    =    Integer.valueOf( st.nextToken() ).intValue();
  174.             outColor    =    new    Color( red, green, blue );
  175.         }
  176.  
  177.         /*    ôdïàâTâCâY    */
  178.         at    =    getParameter( "lightsize" );
  179.         lightSize    =    ( at != null ) ? Integer.valueOf(at).intValue() : 5;
  180.  
  181.         /*    ôdïàè╘âTâCâY    */
  182.         at    =    getParameter( "lightbetw" );
  183.         lightBetw    =    ( at != null ) ? Integer.valueOf(at).intValue() : 3;
  184.  
  185.         /*    âXâNâìü[âïæ¼ôx    */
  186.         at        =    getParameter( "scroll" );
  187.         scroll    =    ( at != null ) ? Integer.valueOf(at).intValue() : 1;
  188.  
  189.         /*    Äƒé╠âXâNâìü[âïé▄é┼é╠Ä₧è╘    */
  190.         at        =    getParameter( "speed" );
  191.         speed    =    ( at != null ) ? Integer.valueOf(at).intValue() : 100;
  192.  
  193.         /*
  194.          *    âIâtâXâNâèü[âôé╔ôdî⌡îfĪö┬é≡ì∞ɼé╖éΘ
  195.          */
  196.         /*    âpâ^ü[âôâtâ@âCâïé≡âIü[âvâôé╖éΘ    */
  197.         try    {
  198.             is    =    new    URL( getDocumentBase(), patFile ).openStream();
  199.         }    catch    ( Exception e )    {
  200.             errorCode    =    2;
  201.             return    ;
  202.         }
  203.  
  204.         /*    âpâ^ü[âôâtâ@âCâïé¬âIü[âvâôÅoùêé╚éóÅΩìçüAâvâìâZâXé≡ÆåÆfé╖éΘ    */
  205.         if ( is == null )
  206.         {
  207.             errorCode    =    2;
  208.             return    ;
  209.         }
  210.  
  211.         /*    âXâgâèü[âÇé≡ë₧ùpé╠ùÿé¡î`é╔ò╧éªéΘ    */
  212.         DataInputStream    ds    =    new    DataInputStream( is );
  213.  
  214.         /*    âtâ@âCâïé╠ɵô¬é╔éáéΘâRâüâôâgìsïyé╤ï≤öÆìsé≡ô╟é▌ö≥é╬é╖    */
  215.         String    lineBuffer;
  216.         while ( true )
  217.         {
  218.             try    {
  219.                 lineBuffer    =    ds.readLine();
  220.             }    catch    ( Exception e )    {
  221.                 try    {
  222.                     is.close();
  223.                 }    catch    ( Exception e2 )    {
  224.                 };
  225.                 errorCode    =    3;
  226.                 return    ;
  227.             }
  228.             if ( ( lineBuffer == null ) || ( lineBuffer.length() != 0 && lineBuffer.charAt( 0 ) != '#' ) )    break;
  229.         }
  230.  
  231.         /*    EOFé╠ÅΩìçüAÅêù¥é╡é╚éó    */
  232.         if ( lineBuffer == null )
  233.         {
  234.             try    {
  235.                 is.close();
  236.             }    catch    ( Exception e )    {
  237.             };
  238.             errorCode    =    3;
  239.             return    ;
  240.         }
  241.  
  242.         /*    âpâ^ü[âôâtâ@âCâïé┼é═é╚éóÅΩìçüAÅêù¥é╡é╚éó    */
  243.         if ( lineBuffer.charAt( 0 ) != 'S' && lineBuffer.charAt( 0 ) != 's' )
  244.         {
  245.             try    {
  246.                 is.close();
  247.             }    catch    ( Exception e )    {
  248.             };
  249.             errorCode    =    3;
  250.             return    ;
  251.         }
  252.  
  253.         /*    âLü[âÅü[âhÅIù╣ê╩Æué≡ĵô╛é╖éΘ    */
  254.         keyEnd    =    lineBuffer.indexOf( " " );
  255.  
  256.         /*    âtâHü[â}âbâgòté½é╠ò╢ÄÜù±é≡ì∞ɼé╖éΘ    */
  257.         st    =    new    StringTokenizer( lineBuffer.substring( keyEnd + 1 ), " " );
  258.  
  259.         /*    âpâ^ü[âôé╠î┬Éöé≡ĵô╛é╖éΘ    */
  260.         patCount    =    Integer.valueOf( st.nextToken() ).intValue();
  261.  
  262.         /*    âpâ^ü[âôé╠ìéé│é≡ĵô╛é╖éΘ    */
  263.         patHeight    =    Integer.valueOf( st.nextToken() ).intValue();
  264.  
  265.         /*    âpâ^ü[âôé╠ò¥é≡ĵô╛é╖éΘ    */
  266.         patWidth    =    Integer.valueOf( st.nextToken() ).intValue();
  267.  
  268.         /*    ôdî⌡îfĪö┬ù╠êµé≡èmò█é╖éΘ    */
  269.         neonWidth        =    ( patWidth * patCount * lightSize ) + ( patWidth * patCount * lightBetw );
  270.         neonHeight        =    ( patHeight * lightSize ) + ( ( patHeight + 1 ) * lightBetw );
  271.         neonScrImage    =    createImage( neonWidth, neonHeight );
  272.         neonScrGraph    =    neonScrImage.getGraphics();
  273.  
  274.         /*    öwîiÉFé≡É▌ÆΦé╡üAæSæ╠é≡ôhéΦé┬é╘é╖    */
  275.         neonScrGraph.setColor( backColor );
  276.         neonScrGraph.fillRect( 0, 0, neonWidth, neonHeight );
  277.  
  278.         /*    ôdî⌡îfĪâpâ^ü[âôì∞ɼâïü[âv    */
  279.         int    i = 0, j = 0;
  280.         while ( true )
  281.         {
  282.             /*    âpâ^ü[âôâfü[â^é≡ô╟é▌ì₧é▐    */
  283.             try    {
  284.                 lineBuffer    =    ds.readLine();
  285.             }    catch    ( Exception e )    {
  286.                 try    {
  287.                     is.close();
  288.                 }    catch    ( Exception e2 )    {
  289.                 };
  290.                 errorCode    =    4;
  291.                 return    ;
  292.             }
  293.  
  294.             /*    EOFé╚éτâïü[âvé≡ö▓é»éΘ    */
  295.             if ( lineBuffer == null )    break;
  296.  
  297.             /*    âRâüâôâgìsûöé═ï≤öÆìsé═ô╟é▌ö≥é╬é╖    */
  298.             if ( lineBuffer.length() == 0 || lineBuffer.charAt( 0 ) == '#' )    continue;
  299.  
  300.             /*    âpâ^ü[âôâfü[â^é┼é╚éóÅΩìçüAÅêù¥é╡é╚éó    */
  301.             if ( lineBuffer.charAt( 0 ) != 'P' && lineBuffer.charAt( 0 ) != 'p' )
  302.             {
  303.                 try    {
  304.                     is.close();
  305.                 }    catch    ( Exception e )    {
  306.                 };
  307.                 errorCode    =    3;
  308.                 return    ;
  309.             }
  310.  
  311.             /*    âLü[âÅü[âhÅIù╣ê╩Æué≡ĵô╛é╖éΘ    */
  312.             keyEnd    =    lineBuffer.indexOf( " " );
  313.  
  314.             /*    âpâ^ü[âôâfü[â^ò╢ÄÜù±é≡ì∞ɼé╖éΘ    */
  315.             String    patData    =    new    String( lineBuffer.substring( keyEnd + 1 ) );
  316.  
  317.             /*    âpâ^ü[âôâfü[â^é╠ò¥é¬"S"é┼ÄwÆΦé│éΩé╜ò¥é╞ê┘é╚éΘÅΩìçüAÅêù¥é╡é╚éó    */
  318.             if ( patData.length() != patWidth )
  319.             {
  320.                 try    {
  321.                     is.close();
  322.                 }    catch    ( Exception e )    {
  323.                 };
  324.                 errorCode    =    5;
  325.                 return    ;
  326.             }
  327.  
  328.             /*    âpâ^ü[âôâeü[âuâïé╔É▌ÆΦé╖éΘ    */
  329.             for ( int k = 0; k < patWidth; k++ )
  330.             {
  331.                 int        x    =    ( lightSize * ( ( patWidth * i ) + k ) ) +
  332.                                 ( lightBetw * ( ( patWidth * i ) + k + 1 ) );
  333.                 int        y    =    ( lightSize * j ) +
  334.                                 ( lightBetw * ( j + 1 ) );
  335.  
  336.                 if ( patData.charAt( k ) == ' ' )
  337.                 {
  338.                     neonScrGraph.setColor( lightColor );
  339.                     if ( lightSize == 1 )
  340.                     {
  341.                         neonScrGraph.fillRect( x, y, lightSize, lightSize );
  342.                     }
  343.                     else
  344.                     {
  345.                         neonScrGraph.fillArc( x, y, lightSize, lightSize, 0, 0 );
  346.                     }
  347.                     
  348.                 }
  349.                 else
  350.                 {
  351.                     neonScrGraph.setColor( outColor );
  352.                     if ( lightSize == 1 )
  353.                     {
  354.                         neonScrGraph.fillRect( x, y, lightSize, lightSize );
  355.                     }
  356.                     else
  357.                     {
  358.                         neonScrGraph.fillArc( x, y, lightSize, lightSize, 0, 0 );
  359.                     }
  360.                 }
  361.             }
  362.  
  363.             /*    âeü[âuâïö╘ìåé≡ìXÉVé╖éΘ    */
  364.             if ( ++j == patHeight )
  365.             {
  366.                 j    =    0;
  367.                 if ( ++i == patCount )    break;
  368.             }
  369.         }
  370.  
  371.         /*    âpâ^ü[âôâtâ@âCâïé≡âNâìü[âYé╖éΘ    */
  372.         try    {
  373.             is.close();
  374.         }    catch    ( Exception e )    {
  375.         };
  376.  
  377.         /*    âIâtâXâNâèü[âôé≡ì∞ɼé╖éΘ    */
  378.         offScrImage    =    createImage( size().width, size().height );
  379.         offScrGraph    =    offScrImage.getGraphics();
  380.         offScrGraph.fillRect( 0, 0, size().width, size().height );
  381.     }
  382.  
  383.     /*
  384.      *    âüâCâôÅêù¥
  385.      *    âpâ^ü[âôâtâ@âCâïé╔ÄwÆΦé│éΩé╜âpâ^ü[âôé≡âXâNâìü[âïé│é╣é╚é¬éτò\Īé╖éΘüB
  386.      */
  387.     public    void    run()
  388.     {
  389.         /*    è∙é╔âGâëü[é¬ö¡É╢é╡é─éóéΘÅΩìçüAÅêù¥é╡é╚éó    */
  390.         if ( errorCode != 0 )
  391.         {
  392.             switch ( errorCode )
  393.             {
  394.                 case    1:    showStatus( "pattern file name not appoint!!" );
  395.                             break;
  396.                 case    2:    showStatus( "pattern file can't open!! \"" + patFile + "\"" );
  397.                             break;
  398.                 case    3:    showStatus( "appoint file is not pattern file!! \"" + patFile + "\"" );
  399.                             break;
  400.                 case    4:    showStatus( "pattern file read error!! \"" + patFile + "\"" );
  401.                             break;
  402.                 default:    showStatus( "pattern width is not enough!! \"" + patFile + "\"" );
  403.                             break;
  404.             }
  405.             return    ;
  406.         }
  407.  
  408.         /*    î╗âXâîâbâhé╠ùDɵÅçê╩é≡É▌ÆΦé╖éΘ    */
  409.         Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
  410.  
  411.         /*    ò`ëµâXâîâbâhÅIù╣âgâèâKü[é¬É▌ÆΦé│éΩé─éóé╚éóÅΩìçé╔âïü[âvé╖éΘ    */
  412.         while ( engine != null )
  413.         {
  414.             /*    ì─ò`ëµ    */
  415.             repaint();
  416.  
  417.             /*    âXâîâbâhé≡ïxÄ~é╖éΘ    */
  418.             try    {
  419.                 Thread.sleep( speed );
  420.             }    catch    ( InterruptedException e )    {
  421.                 break;
  422.             }
  423.         }
  424.     }
  425.  
  426.     /*
  427.      *    ôdî⌡îfĪö┬é≡ò`ëµé╖éΘ
  428.      */
  429.     public void paint(Graphics g)
  430.     {
  431.         int        width    =    0;                /*    âCâüü[âWò¥                */
  432.  
  433.  
  434.         /*    âIâtâXâNâèü[âô鬠null é╠ÅΩìçüAÅêù¥é╡é╚éó    */
  435.         if ( neonScrGraph == null )    return    ;
  436.  
  437.         /*    âXâNâìü[âïé¬âIâtâXâNâèü[âôé≡Æ┤éªé╜ÅΩìçüAì┼Åëé⌐éτò`ëµé╖éΘ    */
  438.         if ( neonPos >= neonWidth )
  439.         {
  440.             neonPos    =    neonPos    -    neonWidth;
  441.         }
  442.  
  443.         /*    âIâtâXâNâèü[âôé≡Ä└ëµû╩é╔ò`ëµé╖éΘ    */
  444.         g.drawImage( neonScrImage, -neonPos, 0, this );
  445.  
  446.         /*    ò`ëµîπüAîçæ╣ù╠êµé¬é┼é½é╜ÅΩìçüAâIâtâXâNâèü[âôé╠ɵô¬òöò¬é≡ò`ëµé╖éΘ    */
  447.         if ( ( neonWidth - neonPos ) < size().width )
  448.         {
  449.             for ( width = neonWidth; width < size().width; width += neonWidth )
  450.             {
  451.                 g.drawImage( neonScrImage, -neonPos + width, 0, this );
  452.             }
  453.             int    x    =    size().width - ( width - neonPos );
  454.             g.drawImage( neonScrImage, size().width - x, 0, this );
  455.         }
  456.  
  457.         /*    Äƒé╠âlâIâôèJÄnê╩Æué≡É▌ÆΦé╖éΘ    */
  458.         neonPos    =    neonPos + ( ( lightSize + lightBetw ) * scroll );
  459.     }
  460.     public    void    update( Graphics g )
  461.     {
  462.         paint( g );
  463.     }
  464.  
  465.     /*
  466.      *    âXâîâbâhé≡èJÄné╖éΘüB
  467.      */
  468.     public    void    start()
  469.     {
  470.         /*    âXâîâbâhé≡èJÄné╖éΘ    */
  471.         if ( engine == null )
  472.         {
  473.             engine    =    new Thread( this );
  474.             engine.start();
  475.         }
  476.     }
  477.  
  478.     /*
  479.      *    âXâîâbâhé≡ÆΓÄ~é╖éΘüB
  480.      */
  481.     public    void    stop()
  482.     {
  483.         /*    âXâîâbâhé≡ÆΓÄ~é╖éΘ    */
  484.         if ( engine != null )    engine.stop();
  485.         engine    =    null;
  486.     }
  487.  
  488.     /*
  489.      *    â}âEâXé≡âNâèâbâNé│éΩé╜ÅΩìçé╔âXâîâbâhé≡Ä└ìsü^ïxÄ~é╖éΘ
  490.      */
  491.     public    boolean    mouseUp( Event evt, int x, int y )
  492.     {
  493.         /*    Ä└ìsÆåé╠ÅΩìçé╔ïxÄ~é╖éΘ    */
  494.         if ( threadSuspended == false )
  495.         {
  496.             if ( engine != null )    engine.suspend();
  497.             threadSuspended    =    true;
  498.         }
  499.         /*    ïxÄ~Æåé╠ÅΩìçé╔Ä└ìsé╖éΘ    */
  500.         else
  501.         {
  502.             if ( engine != null )    engine.resume();
  503.             threadSuspended    =    false;
  504.         }
  505.  
  506.         return    threadSuspended;
  507.     }
  508. }
  509.