home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / JBuilder8.iso / Solaris / resource / jre / demo / jfc / Java2D / README.txt < prev   
Encoding:
Text File  |  2002-09-06  |  7.3 KB  |  190 lines

  1. The classes for the Java2D demo are contained in the Java2Demo.jar file.  
  2. To run the Java2D demo:
  3.  
  4. % java -jar Java2Demo.jar
  5.    - or -
  6. % appletviewer Java2Demo.html
  7.  
  8. Although it's not necessary to unpack the Java2Demo.jar file to run 
  9. the demo, you may want to extract its contents if you plan to modify
  10. any of the demo source code. To extract the contents of Java2Demo.jar, 
  11. run this command from the Java2D directory:
  12.  
  13.     jar xvf Java2Demo.jar
  14.  
  15. Note: These instructions assume that the 1.4 versions of the java,
  16. appletviewer, and jar commands are in your path.  If they aren't,
  17. then you should either specify the complete path to the commands
  18. or update your PATH environment variable as described in the
  19. installation instructions for the Java 2 SDK.
  20.  
  21.  
  22. -----------------------------------------------------------------------
  23. Introduction
  24. -----------------------------------------------------------------------
  25.  
  26. This Java2D demo consists of a set of demos housed in one GUI 
  27. framework that uses a JTabbedPane.  You can access different groups of 
  28. demos by clicking the tabs at the top of the pane. There are demo 
  29. groups for Arcs_Curves, Clipping, Colors, Composite, Fonts, Images, 
  30. Lines, Mix, Paint, Paths and Transforms.  On the right-hand side of the 
  31. pane, the GUI framework features individual and global controls for 
  32. changing graphics attributes. There's also a memory-usage monitor, and 
  33. a monitor for tracking the performance, in frames per second, of 
  34. animation demos.
  35.  
  36.  
  37. -----------------------------------------------------------------------
  38. Tips on usage 
  39. ----------------------------------------------------------------------- 
  40.  
  41. Click on one of the tabs at the top of the pane to select a demo group.  
  42. When you select a group, a set of surfaces is displayed, each of which 
  43. contains one of the group's demos. At the bottom of each surface is 
  44. a set of tools for controlling the demo.  The tools can be displayed
  45. by selecting the Tools checkbox in the Global Controls panel or
  46. by clicking on the slim strip of gray bumps at the bottom of the demo
  47. panel.
  48.  
  49. If you click on a demo surface, that demo is laid out by itself. A
  50. new icon button will appear in the demo's tools toolbar one that enables 
  51. you to create new instances of that demo's surface. 
  52.  
  53. To run the demo continuously without user interaction, select the 
  54. Run Window item in the Options menu and press the run button in the 
  55. new window that's displayed.  To do this from the command line:
  56.  
  57.     java -jar Java2Demo.jar -runs=10
  58.  
  59. To view all the command line options for customizing demo runs:
  60.  
  61.     java -jar Java2Demo.jar -help
  62.  
  63. Parameters that can be used in the Java2Demo.html file inside the applet 
  64. tag to customize demo runs:
  65.               <param name="runs" value="10">
  66.               <param name="delay" value="10">
  67.               <param name="ccthread" value=" ">
  68.               <param name="screen" value="5">
  69.               <param name="antialias" value="true">
  70.               <param name="rendering" value="true">
  71.               <param name="texture" value="true">
  72.               <param name="composite" value="true">
  73.               <param name="verbose" value=" ">
  74.               <param name="buffers" value="3,10">
  75.               <param name="verbose" value=" ">
  76.               <param name="zoom" value=" ">
  77.  
  78. You can run the demos in stand-alone mode by issuing a command like 
  79. this from the Java2D directory:
  80.  
  81.     java -cp Java2Demo.jar java2d.demos.Clipping.ClipAnim
  82.  
  83. You can run the demos in groups by issuing a command like this from
  84. the Java2D directory:
  85.  
  86.     java -cp Java2Demo.jar java2d.DemoGroup Clipping    
  87.  
  88. To recompile a demo, first extract the contents of the Java2Demo.jar 
  89. file, then issue this command from the Java2D directory:
  90.  
  91.     For Win32:
  92.  
  93.         javac src\java2d\demos\Clipping\ClipAnim.java -d .
  94.  
  95.     For Solaris:
  96.  
  97.         javac src/java2d/demos/Clipping/ClipAnim.java -d .
  98.  
  99. To increase or decrease the Memory Monitor sampling rate click on the
  100. Memory Monitor's title border, a panel with a TextField will appear.
  101.  
  102. The Java2Demo Intro (the 'Java2D' tab) contains a scene table, click in 
  103. the gray border and a table will appear.
  104.  
  105. Animated demos have a slider to control the animation rate.  Bring up
  106. the animated demo toolbar, then click in the gray area of the toolbar
  107. panel, the toolbar goes away and the slider appears.
  108.  
  109. Demos that have Custom Controls can have their Custom Control Thread
  110. activated and stopped by clicking in the gray area of the demos Custom 
  111. Control panel.
  112.  
  113. For less garbage collection and smoother animation for the Intro and
  114. other animated demos run with command line argument:
  115.  
  116.     java -jar -ms48m Java2Demo.jar
  117.  
  118. To allow printing of surfaces while running the demo in applet mode,
  119. you must first run policytool to change your .java.policy file.  In 
  120. policytool, add the permission for java.lang.RuntimePermission with a 
  121. target name of queuePrintJob.  The .java.policy file should then include
  122. the following:
  123.  
  124.     grant {
  125.         permission java.lang.RuntimePermission "queuePrintJob";
  126.     };
  127.  
  128.  
  129.  
  130. -----------------------------------------------------------------------
  131. NOTE about demo surfaces 
  132. ----------------------------------------------------------------------- 
  133.  
  134. The demo groups are in separate packages with their class files stored 
  135. in directories named according to the demo group name.  All drawing 
  136. demos extend either the Surface, AnimatingSurface, ControlsSurface or
  137. AnimatingControlsSurface classes.  Surface is the base class, demos
  138. must implement the Surface's render method.  All animated demos extend 
  139. either the AnimatingSurface or the AnimatingControlsSurface classes.  
  140. Animated demos must implement the reset and step methods.  The demos
  141. with gui controls extend either the ControlsSurface or the 
  142. AnimatingControlsSurface classes.  Demos with controls must implement
  143. the methods in the CustomControlsContext interface.
  144.  
  145.  
  146. -----------------------------------------------------------------------
  147. Known Issue
  148. -----------------------------------------------------------------------
  149.  
  150. This problem is present on Microsoft Windows 95 with DirectX and 
  151. Windows 98 and 98SE operating systems. Solaris(TM) and Windows NT 
  152. operating systems are not affected.
  153.     
  154. Java2Demo exhibits random lockups in lengthy looping runs or in runs 
  155. having "custom Thread" activated specific tabs such as Transform.  This 
  156. lockup occurs mostly on slower machines, PII233 and below, but is also 
  157. seen less frequently on faster machines.  The cause is possibly 
  158. DirectDraw and/or videocard driver or combination thereof.  Please do 
  159. one of the following to either prevent or reduce the chances of a 
  160. lockup:
  161.    
  162. Run with following parameter: -Dsun.java2d.noddraw=true
  163.    
  164.    java -Dsun.java2d.noddraw=true -jar Java2Demo.jar
  165.    
  166. and/or visit Microsoft's DirectX and dnload the latest as well as the 
  167. latest of your videocard driver.
  168.  
  169.  
  170. ======================================================================
  171.  
  172. Most of the Java2Demo demos can be found as stand-alone Samples:
  173.  
  174. http://java.sun.com/products/java-media/2D/samples/
  175.  
  176.  
  177. For a Java2D API Guide & Tutorial:
  178.  
  179. http://java.sun.com/j2se/1.4/docs/guide/2d/spec/j2d-bookTOC.doc.html
  180. http://java.sun.com/docs/books/tutorial/2d/
  181.  
  182.  
  183. For the latest version of the Java2D demo:
  184.  
  185. http://java.sun.com/products/java-media/2D/
  186.  
  187. You may send comments via the java2d-comments@sun.com alias, 
  188. which is a one-way alias to Sun's Java 2D API developers, or via the
  189. java2d-interest@sun.com alias, which is a public discussion list. 
  190.