home *** CD-ROM | disk | FTP | other *** search
/ IT.SOFT 22 / ITSOFTCD_22.iso / pc / shareware22 / file / COOSCALE.ZIP / README.TXT < prev    next >
Encoding:
Text File  |  1998-02-12  |  13.3 KB  |  326 lines

  1. *****************************************************************
  2. *                                                               *
  3. *                           CooScale(F1.10)                     *
  4. *                            Java Bean                          *
  5. *                         Written by Mark Qian                  *
  6. *                                                               *
  7. *****************************************************************
  8.  
  9.    
  10.  
  11. CooScale is a cool 3D-look multimedia progress bar.
  12.  
  13. Why:
  14.  
  15.    1). it supports customizable sound and animation with a variety of modes.
  16.    2). it prvides tooltips. You can show your advertisements, descriptions, and instructions
  17.        according to progress.(To see this feature, just place your mouse cursor on the bean
  18.        above to watch it display different content for different percentages).
  19.    3). it has better compitability. It can be used with both IE(4.x) and Netscape (4.x). 
  20.  
  21. This may not be the latest version, please visit 
  22.  
  23.    http://www.coolshare.com/html/bean_cs.htm
  24.  
  25. to get the latest version.
  26.  
  27.  
  28. Note: if you browse test.htm or test_cs.htm LOCALLY, you won't be able to
  29.       see any anmition and hear any sound since the default
  30.       URLs of the image files and audio file are set to somewhere else.
  31.       Be sure that you try them ONLINE.
  32.  
  33. Properties:
  34.  
  35.   textColor - percentage text color
  36.   barForeground - foreground color of progress bar(the part done)
  37.   barBackground - background color of progress bar(the rest)
  38.   beanBackground - background color of the bean
  39.   tipsForeground - foreground color of tooltips
  40.   tipsBackground - background color of tooltips        
  41.   displayText - a boolean value to determent if display the percentage text
  42.   percent - value of done
  43.   bevel - bevel of the 3D bar
  44.   outerTLShadowColor - TopLeft corner color of bar border
  45.   outerBRShadowColor - BottomRight corner color of bar border
  46.   innerTLShadowColor - TopLeft corner color of bar 
  47.   innerBRShadowColor - BottomRight corner color of bar 
  48.   tipsX - tooltips x coordinate
  49.   tipsY - tooltips y coordinate
  50.   tipsWidth - tooltips width
  51.   tipsHeight - tooltips height
  52.   buttonLabel - label of the button.  You can remove the button by seting this field to nothing
  53.   tipsText - tooltips content. You can turn the tooltips off by placing nothing in this field.
  54.   soundURL - sound file's complete URL. You can disable sound by placing nothing in this field.
  55.   firstImageFileURL - first animation image file's complete URL. You can disable animation by 
  56.                       placing nothing in this field.
  57.   numImage - number of animation image files.  You can disable animation by seting this field to 0.
  58.   soundMode - sound mode: 0 play sound when progressing; 1 play sound when mouse enter CooScale
  59.   soundPlayStyle - 0 play once; 1 loop
  60.   animationSpeed - animation interval in ms
  61.   selfTest - a boolean var. CooScale will increase it percentage when mouse enter it if set to true
  62.   topTips - tooltips will be keep on the top most when set to true
  63.   autoTipsHeight - CooScale will handle measuring tooltips's height if this is set to true
  64.   resetAfterCancel - the percentage will be set to 0 when cancel if this field is set to true
  65.   resetAfterFull - the percentage will be set to 0 when percentage reaches 100% if this field is set to true
  66.   toCancel - seting this field to true will have to the effect as clicking at the cancel button.  This property
  67.              offer you a way to cancel the progress by other beans. You can also call public
  68.              method, cancelAll(), from you codes to do the samething.
  69.  
  70.  
  71. <h3>Registered Action Events and Programming issues:</h3>
  72.  
  73.    actionPerFormed  - this event is fired when Cancel button is clicked or 
  74.                       process is done (100%).
  75.                       To interact with CooScole, you need to connect its listeners
  76.                       to the source, CooScale. 
  77.  
  78.                       You can get the resulting percentage(as a String) from 
  79.                       ActionEvent's last field, command, by calling 
  80.                       getActionCommand. For example, following System.err.println statement
  81.                       will print the resulting percentage in Java console when the cancel
  82.                       button is clicked or when process is reached 100%
  83.  
  84.                       void cooscale1_actionPerformed(java.awt.event.ActionEvent event)
  85.                   {
  86.                      System.err.println("Resulting percentage = " + event.getActionCommand());    
  87.                  ...
  88.                       }
  89.  
  90.    There are several sample applets with source codes are available 
  91.  
  92.       1). Package One - a simple Netscape compitable applet
  93.              This is a very simple hand-written applet showing you how to use Cooscale in an applet.
  94.  
  95.              http://www.coolshare.com/html/src/caller_cs.java - hand-written applet source file.
  96.              http://www.coolshare.com/html/src/cooscale.mk - makefile to build jar
  97.              http://www.coolshare.com/html/src/caller_cs.bat - a batch file which you can use to build jar file in a DOS environment.
  98.              http://www.coolshare.com/html/test_cs.htm - a html file to run the applet
  99.           
  100.       2). Package Two - a timer-driven Cooscale
  101.              This is an applet built with Visual Cafe (V1.1) showing you how to use 
  102.              Cooscale with other beans in an applet.
  103.  
  104.              http://www.coolshare.com/html/src/bean_cs.java - the applet source file.
  105.              http://www.coolshare.com/html/src/cootimer.java - a timer bean which fires ActionEvent periodically to increase CooScale's percentage.
  106.              http://www.coolshare.com/html/bean_cs.htm - a html file to run the applet
  107.           
  108.       3). Package Three - a timer-driven Cooscale in popup style
  109.              This is an applet built with Visual Cafe (V1.1) showing you how to popup
  110.              CooScale.
  111.  
  112.              http://www.coolshare.com/html/src/bean_cs.java - the applet source file.
  113.              http://www.coolshare.com/html/src/Dialog1.java - the dialog source file.
  114.              http://www.coolshare.com/html/src/cootimer.java - a timer bean which fires ActionEvent periodically to increase CooScale's percentage.
  115.              http://www.coolshare.com/html/bean_cs.htm - a html file to run the applet
  116.           
  117.                
  118.                         
  119.  
  120.   Other Public Methods
  121.  
  122.   setApplet(Applet applet) - this method has to be called from CooScale's parent so
  123.                              that it can provide animation and sound. The method should
  124.                              be called right before CooScale is shown or started.
  125.  
  126.   closeAll(void) - this method has to be called in parent's stop method so that the parent
  127.                    stop CooScale's sound playing and animation.
  128.  
  129.   
  130. Installation Instructions:
  131.  
  132.  
  133.    0). Download CooScale at
  134.  
  135.         http://www.coolshare.com/html/bean_cs.htm
  136.  
  137.    1). Unzip cooscale.zip or bean_cs.zip to, say c:\my_bean
  138.        and run setup.bat, you will get following files
  139.    
  140.        c:\my_bean\cooscale.jar
  141.        c:\my_bean\cooscale1.gif
  142.        c:\my_bean\cooscale16.gif
  143.        c:\my_bean\cooscale2.gif
  144.        c:\my_bean\cooscale3.gif
  145.        c:\my_bean\cooscale32.gif
  146.        c:\my_bean\cooscale4.gif
  147.        c:\my_bean\cooscale5.gif
  148.        c:\my_bean\cooscale6.gif
  149.        c:\my_bean\cooscale7.gif
  150.        c:\my_bean\cooscale8.gif
  151.        c:\my_bean\file_id.diz
  152.        c:\my_bean\readme.txt
  153.        c:\my_bean\setup.bat
  154.        c:\my_bean\sound25.au
  155.        c:\my_bean\test.htm
  156.        c:\my_bean\test.jar
  157.        c:\my_bean\test.java
  158.        c:\my_bean\test_cs.htm
  159.      
  160.  
  161.        Note: be sure that you run setup.bat to rename files.
  162.  
  163.  
  164.    2). Upload files on to your server, say http://www.mysite.com/
  165.        You need to upload following files to your server
  166.  
  167.        c:\my_bean\cooscale.jar
  168.        c:\my_bean\cooscale1.gif
  169.        c:\my_bean\cooscale16.gif
  170.        c:\my_bean\cooscale2.gif
  171.        c:\my_bean\cooscale3.gif
  172.        c:\my_bean\cooscale32.gif
  173.        c:\my_bean\cooscale4.gif
  174.        c:\my_bean\cooscale5.gif
  175.        c:\my_bean\cooscale6.gif
  176.        c:\my_bean\cooscale7.gif
  177.        c:\my_bean\cooscale8.gif
  178.        c:\my_bean\sound25.au
  179.        c:\my_bean\test.htm
  180.        c:\my_bean\test.jar
  181.        c:\my_bean\test_cs.htm
  182.  
  183.  
  184. There are two things to try now.
  185. If you like to see the running bean following Part I
  186. Otherwise, ignore Part I.     
  187.  
  188. Part I: Try the one package with this package
  189. *******
  190.  
  191.   a). Browse test_cs.htm with either IE 4.x or Netscape 4.x.  Or
  192.   
  193.   b). Browse test.htm with IE 4.x.  Test.htm won't work with
  194.       Netscape since it was built with Visual Cafe but Netscape 
  195.       does not support some classes files used to build Cooscale's 
  196.       caller. 
  197.  
  198.       Later in this page(see Park II below), you will see step-by-step instructions
  199.       to build test.jar which is used by test.htm.
  200.  
  201.  
  202. Part II:  Install it in your applet or application
  203. *******
  204.  
  205.    
  206.    3). Integrate it in to an applet or application.
  207.        
  208.        Let's use Visual Cafe (V1.1) as example.
  209.  
  210.        Instructions to insert Cooscale to an applet with Visual Cafe:
  211.  
  212.        A). Open Visual Cafe and select File | New Project from the pull-down menu.
  213.            Then select Basic Applet from New Project dialog.
  214.  
  215.        B). Rename your new project and applet name, say test as project name and
  216.            test as applet name too, and then save it at c:\my_test. Save the project.
  217.  
  218.        C). Selete Insert | Component into Library... from menu. Then select
  219.            cooscale.jar that you unzipped at step 1). That is, c:\my_bean\cooscale.jar
  220.  
  221.        D). Selete Insert | Component from menu. Then select
  222.            cooscale from component list and add it to the project.
  223.            Change following properties
  224.         
  225.                  FirstImageFileURL - change it to http://www.mysite.com/cooscale1.gif
  226.                  SoundURL - change it to http://www.mysite.com/sound25.au
  227.  
  228.            You have to change these properties in order to have sound and animation
  229.            since an applet can not fetch any resource from any places other than where
  230.            it comes from.
  231.  
  232.            You need to set property "selfTest" to true in the property list so that
  233.            you can simulate a progress by placing mouse cursor on the bean.
  234.  
  235.        E). Right mouse click at test in the project dialog and select Edit Source
  236.            (or click at test in the dialog and select Object | Edit Source from menu).
  237.            Then add following statement to init()
  238.  
  239.         cooscale1.setApplet(this);
  240.  
  241.            right after 
  242.  
  243.                 //{{INIT_CONTROLS
  244.         ....
  245.         //}} 
  246.  
  247.            You will get something like
  248.  
  249.                 ...            
  250.                 //{{INIT_CONTROLS
  251.         setLayout(null);
  252.         setSize(289,127);
  253.         try {
  254.         ClassLoader cl = Class.forName("cooscale").getClassLoader();
  255.         cooscale1 = (cooscale) java.beans.Beans.instantiate(cl, "cooscale");
  256.         cooscale1.setLayout(new FlowLayout(FlowLayout.CENTER,5,5));
  257.         cooscale1.setBounds(36,36,216,36);
  258.         add(cooscale1);
  259.                 cooscale1.start();
  260.         } catch (Exception e) { }
  261.         //}}
  262.         
  263.                 cooscale1.setApplet(this); //<<<<<<<< ADD IT HERE !!!!!
  264.  
  265.                   ...             
  266.  
  267.            in init().
  268.  
  269.             <b>Note</b>: you better place  cooscale1.setApplet(this) outside of
  270.  
  271.                          //{{INIT_CONTROLS
  272.                            ....
  273.                          //}} 
  274.  
  275.              Otherwise, your addition will be overwritten whenever a change is made
  276.              in IDE.
  277.  
  278.        E). Add following method to the applet
  279.  
  280.  
  281.               public void stop()                                     
  282.               { 
  283.                  cooscale1.cancelAll();
  284.               }
  285.  
  286.             This will tell the bean to stop sound and animation when the 
  287.             parent applet stops.
  288.  
  289.  
  290.        F). Compile the project and try it locally.  If it work, select
  291.            Project | JAR... from menu and click at More>>> button.
  292.            Then, click at test.class and check Bean radio button at the
  293.            bottom of the dialog. Click at OK to generate test.jar.
  294.            Note: in Visual Cafe V1.1, please don't check any other
  295.            class as Bean - test.class is the only one you need to mark
  296.            as a bean.
  297.            
  298.        G). Try it online.  Create a html document file, say test.htm, containing content
  299.            like
  300.  
  301.               <APPLET Archive="test.jar" CODE="test.class" WIDTH=240 HEIGHT=50></APPLET>
  302.  
  303.            Upload test.jar and test.htm to http://www.mysite.com and browse 
  304.  
  305.               http://www.mysite.com/test.htm 
  306.  
  307.            with IE 4.x.
  308.  
  309.            If you like to try something which can be used in both IE and Netscape, 
  310.            you need to build a simple applet that call CooScale since applets generated by Visual Cafe (V1.1)
  311.            contain some classes which are not supported by Netscape (V4.x).
  312.            You can download another package
  313.               
  314.  
  315.                 ftp://ftp.coolshare.com/adware/cooscal2.zip
  316.  
  317.  
  318.            Following the instructions in its readme.txt to build your jar file.
  319.            With this package, you will be able to build your own test_cs.jar
  320.            packed in this package.
  321.  
  322. For more info, contact the author, Mark Qian, at ok@coolshare.com or
  323. visit  http://www.coolshare.com to get more FREE Java stuff and cool screen savers.
  324.  
  325.  
  326.