*****************************************************************
*                                                               *
*                           CooScale(F1.10)                     *
*                            Java Bean                          *
*                     (A package for both IE and Netscape)      *
*                         Written by Mark Qian                  *
*                                                               *
*****************************************************************

   

CooScale is a cool 3D-look multimedia progress bar.

Why:

   1). it supports customizable sound and animation with a variety of modes.
   2). it prvides tooltips. You can show your advertisements, descriptions, and instructions
       according to progress.(To see this feature, just place your mouse cursor on the bean
       above to watch it display different content for different percentages).
   3). it has better compitability. It can be used with both IE(4.x) and Netscape (4.x). 

This may not be the latest version, please visit 

   http://www.coolshare.com/html/bean_cs.htm

to get the latest version.


Note: if you browse test.htm or test_cs.htm LOCALLY, you won't be able to
      see any anmition and hear any sound since the default
      URLs of the image files and audio file are set to somewhere else.
      Be sure that you try them ONLINE.


Properties:

  textColor - percentage text color
  barForeground - foreground color of progress bar(the part done)
  barBackground - background color of progress bar(the rest)
  beanBackground - background color of the bean
  tipsForeground - foreground color of tooltips
  tipsBackground - background color of tooltips        
  displayText - a boolean value to determent if display the percentage text
  percent - value of done
  bevel - bevel of the 3D bar
  outerTLShadowColor - TopLeft corner color of bar border
  outerBRShadowColor - BottomRight corner color of bar border
  innerTLShadowColor - TopLeft corner color of bar 
  innerBRShadowColor - BottomRight corner color of bar 
  tipsX - tooltips x coordinate
  tipsY - tooltips y coordinate
  tipsWidth - tooltips width
  tipsHeight - tooltips height
  buttonLabel - label of the button.  You can remove the button by seting this field to nothing
  tipsText - tooltips content. You can turn the tooltips off by placing nothing in this field.
  soundURL - sound file's complete URL. You can disable sound by placing nothing in this field.
  firstImageFileURL - first animation image file's complete URL. You can disable animation by 
                      placing nothing in this field.
  numImage - number of animation image files.  You can disable animation by seting this field to 0.
  soundMode - sound mode: 0 play sound when progressing; 1 play sound when mouse enter CooScale
  soundPlayStyle - 0 play once; 1 loop
  animationSpeed - animation interval in ms
  selfTest - a boolean var. CooScale will increase it percentage when mouse enter it if set to true
  topTips - tooltips will be keep on the top most when set to true
  autoTipsHeight - CooScale will handle measuring tooltips's height if this is set to true
  resetAfterCancel - the percentage will be set to 0 when cancel if this field is set to true
  resetAfterFull - the percentage will be set to 0 when percentage reaches 100% if this field is set to true
  toCancel - seting this field to true will have to the effect as clicking at the cancel button.  This property
             offer you a way to cancel the progress by other beans. You can also call public
             method, cancelAll(), from you codes to do the samething.


<h3>Registered Action Events and Programming issues:</h3>

   actionPerFormed  - this event is fired when Cancel button is clicked or 
                      process is done (100%).
                      To interact with CooScole, you need to connect its listeners
                      to the source, CooScale. 

                      You can get the resulting percentage(as a String) from 
                      ActionEvent's last field, command, by calling 
                      getActionCommand. For example, following System.err.println statement
                      will print the resulting percentage in Java console when the cancel
                      button is clicked or when process is reached 100%

                      void cooscale1_actionPerformed(java.awt.event.ActionEvent event)
	              {
	                 System.err.println("Resulting percentage = " + event.getActionCommand());    
		         ...
                      }

   There are several sample applets with source codes are available 

      1). Package One - a simple Netscape compitable applet
             This is a very simple hand-written applet showing you how to use Cooscale in an applet.

             http://www.coolshare.com/html/src/caller_cs.java - hand-written applet source file.
             http://www.coolshare.com/html/src/cooscale.mk - makefile to build jar
             http://www.coolshare.com/html/src/caller_cs.bat - a batch file which you can use to build jar file in a DOS environment.
             http://www.coolshare.com/html/test_cs.htm - a html file to run the applet
          
      2). Package Two - a timer-driven Cooscale
             This is an applet built with Visual Cafe (V1.1) showing you how to use 
             Cooscale with other beans in an applet.

             http://www.coolshare.com/html/src/bean_cs.java - the applet source file.
             http://www.coolshare.com/html/src/cootimer.java - a timer bean which fires ActionEvent periodically to increase CooScale's percentage.
             http://www.coolshare.com/html/bean_cs.htm - a html file to run the applet
          
      3). Package Three - a timer-driven Cooscale in popup style
             This is an applet built with Visual Cafe (V1.1) showing you how to popup
             CooScale.

             http://www.coolshare.com/html/src/bean_cs.java - the applet source file.
             http://www.coolshare.com/html/src/Dialog1.java - the dialog source file.
             http://www.coolshare.com/html/src/cootimer.java - a timer bean which fires ActionEvent periodically to increase CooScale's percentage.
             http://www.coolshare.com/html/bean_cs.htm - a html file to run the applet
          
               
                        

  Other Public Methods

  setApplet(Applet applet) - this method has to be called from CooScale's parent so
                             that it can provide animation and sound. The method should
                             be called right before CooScale is shown or started.

  closeAll(void) - this method has to be called in parent's stop method so that the parent
                   stop CooScale's sound playing and animation.
  

Here is the instructions to use this package

       0). Unzip cooscal2.zip to say, c:\test2, and run setup.bat. Then you will get
                  
               c:\test2\caller_cs.java
               c:\test2\coolab.class
               c:\test2\cooscale.bat
               c:\test2\cooscale.class
               c:\test2\cooscale.jar
               c:\test2\cooscale.mk
               c:\test2\cooscale1.gif
               c:\test2\cooscale16.gif
               c:\test2\cooscale2.gif
               c:\test2\cooscale3.gif
               c:\test2\cooscale32.gif
               c:\test2\cooscale4.gif
               c:\test2\cooscale5.gif
               c:\test2\cooscale6.gif
               c:\test2\cooscale7.gif
               c:\test2\cooscale8.gif
               c:\test2\cooscaleBeanInfo.class
               c:\test2\cootips.class
               c:\test2\File_id.diz
               c:\test2\readme.txt
               c:\test2\setup.bat
               c:\test2\sound25.au
               c:\test2\test_cs.htm

      1). Run cooscale.bat to compile caller_ca.java and create cooscale.jar.
          (A cooscale.jar compiled with JDK1.1.5 is also packed with this package.)

      2). Upload following files to your server, say http://www.mysite.com

               c:\test2\cooscale.jar
               c:\test2\cooscale1.gif
               c:\test2\cooscale16.gif
               c:\test2\cooscale2.gif
               c:\test2\cooscale3.gif
               c:\test2\cooscale32.gif
               c:\test2\cooscale4.gif
               c:\test2\cooscale5.gif
               c:\test2\cooscale6.gif
               c:\test2\cooscale7.gif
               c:\test2\cooscale8.gif
               c:\test2\sound25.au
               c:\test2\test_cs.htm

      3). Browse http://www.mysite.com/test_cs.htm with either IE 4.x or Netscape 4.x

      4). If it works, you can then modify caller_cs.java to meet you need.


For more info, contact the author, Mark Qian, at ok@coolshare.com or
go  http://www.coolshare.com to get more FREE Java stuff and cool screen savers.
