Path: blob/master/src/demo/share/jfc/J2Ddemo/README.txt
41152 views
The classes for the Java2D(TM) demo are contained in the J2Ddemo.jar file.1To run the J2D demo:23% java -jar J2Ddemo.jar45-----------------------------------------------------------------------6Introduction7-----------------------------------------------------------------------89This Java2D demo consists of a set of demos housed in one GUI10framework that uses a JTabbedPane. You can access different groups of11demos by clicking the tabs at the top of the pane. There are demo12groups for Arcs_Curves, Clipping, Colors, Composite, Fonts, Images,13Lines, Mix, Paint, Paths and Transforms. On the right-hand side of the14pane, the GUI framework features individual and global controls for15changing graphics attributes. There's also a memory-usage monitor, and16a monitor for tracking the performance, in frames per second, of17animation demos.181920-----------------------------------------------------------------------21Tips on usage22-----------------------------------------------------------------------2324Click on one of the tabs at the top of the pane to select a demo group.25When you select a group, a set of surfaces is displayed, each of which26contains one of the group's demos. At the bottom of each surface is27a set of tools for controlling the demo. The tools can be displayed28by selecting the Tools checkbox in the Global Controls panel or29by clicking on the slim strip of gray bumps at the bottom of the demo30panel.3132If you click on a demo surface, that demo is laid out by itself. A33new icon button will appear in the demo's tools toolbar one that enables34you to create new instances of that demo's surface.3536To run the demo continuously without user interaction, select the37Run Window item in the Options menu and press the run button in the38new window that's displayed. To do this from the command line:3940java -jar J2Ddemo.jar -runs=104142To view all the command line options for customizing demo runs:4344java -jar J2Ddemo.jar -help4546You can run the demos in stand-alone mode by issuing a command like this4748java -cp J2Ddemo.jar java2d.demos.Clipping.ClipAnim4950You can run the demos in groups by issuing a command like this5152java -cp J2Ddemo.jar java2d.DemoGroup Clipping5354To increase or decrease the Memory Monitor sampling rate click on the55Memory Monitor's title border, a panel with a TextField will appear.5657The J2Ddemo Intro (the 'J2D demo' tab) contains a scene table, click in58the gray border and a table will appear.5960Animated demos have a slider to control the animation rate. Bring up61the animated demo toolbar, then click in the gray area of the toolbar62panel, the toolbar goes away and the slider appears.6364Demos that have Custom Controls can have their Custom Control Thread65activated and stopped by clicking in the gray area of the demos Custom66Control panel.6768-----------------------------------------------------------------------69NOTE about demo surfaces70-----------------------------------------------------------------------7172The demo groups are in separate packages with their class files stored73in directories named according to the demo group name. All drawing74demos extend either the Surface, AnimatingSurface, ControlsSurface or75AnimatingControlsSurface classes. Surface is the base class, demos76must implement the Surface's render method. All animated demos extend77either the AnimatingSurface or the AnimatingControlsSurface classes.78Animated demos must implement the reset and step methods. The demos79with gui controls extend either the ControlsSurface or the80AnimatingControlsSurface classes. Demos with controls must implement81the methods in the CustomControlsContext interface.828384======================================================================8586Here are some resources for learning about and using the Java2D(TM)8788OpenJDK group page: http://openjdk.java.net/groups/2d/8990Learning Java 2D: http://www.oracle.com/technetwork/articles/java/java2dpart1-137217.html9192Tutorial : http://download.oracle.com/javase/tutorial/2d/93Specification: http://download.oracle.com/javase/8/docs/technotes/guides/2d/spec/j2d-bookTOC.html94Java 2D (TM) API White Paper : http://www.oracle.com/technetwork/java/javase/tech/2d-142228.html952D FAQ: http://www.oracle.com/technetwork/java/index-137037.html969798