Index of /home/futrelle/teaching/csg140sp2004/examps/examps/allJavaSun2D/Java2D-samples

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory   -  
[DIR]Arcs_Curves/ 2004-01-13 17:11 -  
[DIR]Clipping/ 2004-01-13 17:11 -  
[DIR]Colors/ 2004-01-13 17:12 -  
[DIR]Composite/ 2004-01-13 17:12 -  
[DIR]Fonts/ 2004-01-13 17:12 -  
[DIR]Image/ 2004-01-13 17:12 -  
[   ] 2004-01-13 17:16 315K 
[DIR]Lines/ 2004-01-13 17:12 -  
[DIR]Paint/ 2004-01-13 17:15 -  
[DIR]Paths/ 2004-01-13 17:15 -  
[DIR]Transforms/ 2004-01-13 17:16 -  
[   ]compile.bat 2004-01-13 17:12 683  
[   ] 2004-01-13 17:12 505  
[DIR]images/ 2004-01-13 17:12 -  
[TXT]run.bat 2004-01-13 17:16 1.1K 
[   ] 2004-01-13 17:16 1.2K 

Java(TM) 2D Sample Programs

JavaTM 2D Sample Programs

These sample programs demonstrate new JavaTM 2D features available in the Java Development Kit, version 1.2 -- you will need to download JDKTM 1.2 to run these programs.

List of Sample Programs

Arcs & Curves
Arc2D Open, Chord, & Pie arcs; Animated Pie Arc. Source Applet Plugin
Animated Bezier Curve includes controls for changing graphic attributes. Source Applet Plugin
CubicCurve2D & QuadCurve2D curves includes FlatteningPathIterator example. Source Applet Plugin
Ellipse2D 25 animated expanding ellipses. Source Applet Plugin
CAG (Constructive Area Geometry) operations : Add(union), Subtract, Intersect, and ExclusiveOR. Source Applet Plugin
Animated clipping of an image & composited shapes. Source Applet Plugin
Animated intersection clipping of lines, an image and a textured rectangle. Source Applet Plugin
Clipping an image, lines, and text with text. Source Applet Plugin
Animated colored balls bouncing. Source Applet Plugin
Creating colors with an alpha value. Source Applet Plugin
ColorConvertOp a ColorSpace.TYPE_RGB BufferedImage to a ColorSpace.CS_GRAY BufferedImage. Source Applet Plugin
3D objects with color & lighting translated, rotated and scaled. Source Applet Plugin
Compositing shapes on images. Source Applet Plugin
All the AlphaCompositing rules demonstrated. Source Applet Plugin
Animation of compositing shapes, text, and images fading in and out. Source Applet Plugin
Scrolling text of fonts returned from GraphicsEnvironment.getAllFonts(). Source Applet Plugin
Build an AttributedString and then render the string broken over lines. Source Applet Plugin
Highlighting of text showing the caret, the highlight & the character advances. Source Applet Plugin
Rendering text as an outline shape. Source Applet Plugin
Transformation of characters. Source Applet Plugin
Animated gif with a transparent background. Source Applet Plugin
Images drawn using operators such as ConvolveOp LowPass & Sharpen, LookupOp and RescaleOp. Source Applet Plugin
Render into a BufferedImage, save the BufferedImage as a JPEG, display the BufferedImage, using the decoded JPEG BufferedImage DataBuffer flip the elements, display the JPEG flipped BufferedImage. Source Applet Plugin
Warps a image on a CubicCurve2D flattened path. Source Applet Plugin
Various shapes stroked with a dashing pattern. Source Applet Plugin
Lines & Paths animation illustrating all of BasicStroke attributes. Source Applet Plugin
Modify a star's BasicStroke attributes. Source Applet Plugin
GradientPaint animation. Source Applet Plugin
GradientPaint burst effect, controls for different colors. Source Applet Plugin
TexturePaint of shapes, gradients and rgb values. Source Applet Plugin
Texture animation with controls for transformations. Source Applet Plugin
Simple append of rectangle to path with and without the connect. Source Applet Plugin
Cubic & Quad curves implemented through GeneralPath. Source Applet Plugin
Basic implementation of GeneralPath, filling & drawing a path. Source Applet Plugin
3D text shape with GeneralPath & a 300 of small multi-colored rectangles Source Applet Plugin
Rectangles filled to illustrate the GeneralPath winding rule, determining the interior of a path. Source Applet Plugin
Simple 45 degree rotate of a rectangle. Source Applet Plugin
Scaling or Shearing or Rotating an image & rectangle. Source Applet Plugin
Animation of shapes, text and images rotating, scaling and translating around a canvas. Source Applet Plugin

Compiling the Sample Programs

You can compile the samples by changing to the sample program's directory and compiling the *.java files, e.g.

cd Arcs_Curves
javac *.java

(This assumes javac is in your executible path, and you are using JDK 1.2 or greater)

For your convenience, we have provided a script to compile all the samples -- execute compile.bat (for Windows) or (for Solaris).

Running the Sample Programs

These sample programs are designed to run as standalone Java applications. To run them, you need to change to the sample program's directory and execute the java command on the class name, e.g.

cd Arcs_Curves
java Arcs

(This assumes java is in your executible path, and you are using JDK 1.2 or greater)

For your convenience, we have provided another script to run the samples -- execute run.bat (for Windows) or (for Solaris).