Arcs & Curves |
Arc2D Open, Chord, & Pie arcs; Animated Pie Arc. |
|
|
|
Animated Bezier Curve includes controls for changing graphic attributes.
|
|
|
|
CubicCurve2D & QuadCurve2D curves includes FlatteningPathIterator example.
|
|
|
|
Ellipse2D 25 animated expanding ellipses.
|
|
|
|
Clipping |
CAG (Constructive Area Geometry) operations : Add(union), Subtract, Intersect, and ExclusiveOR.
|
|
|
|
Animated clipping of an image & composited shapes.
|
|
|
|
Animated intersection clipping of lines, an image and a textured rectangle.
|
|
|
|
Clipping an image, lines, and text with text.
|
|
|
|
Colors |
Animated colored balls bouncing.
|
|
|
|
Creating colors with an alpha value.
|
|
|
|
ColorConvertOp a ColorSpace.TYPE_RGB BufferedImage to a ColorSpace.CS_GRAY BufferedImage.
|
|
|
|
3D objects with color & lighting translated, rotated and scaled.
|
|
|
|
Composite |
Compositing shapes on images. |
|
|
|
All the AlphaCompositing rules demonstrated. |
|
|
|
Animation of compositing shapes, text, and images fading in and out.
|
|
|
|
Fonts |
Scrolling text of fonts returned from GraphicsEnvironment.getAllFonts().
|
|
|
|
Build an AttributedString and then render the string broken over lines.
|
|
|
|
Highlighting of text showing the caret, the highlight & the character advances.
|
|
|
|
Rendering text as an outline shape.
|
|
|
|
Transformation of characters. |
|
|
|
Image |
Animated gif with a transparent background. |
|
|
|
Images drawn using operators such as ConvolveOp LowPass & Sharpen, LookupOp and RescaleOp.
|
|
|
|
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.
|
|
|
|
Warps a image on a CubicCurve2D flattened path. |
|
|
|
Lines |
Various shapes stroked with a dashing pattern. |
|
|
|
Lines & Paths animation illustrating all of BasicStroke attributes.
|
|
|
|
Modify a star's BasicStroke attributes. |
|
|
|
Paint |
GradientPaint animation. |
|
|
|
GradientPaint burst effect, controls for different colors.
|
|
|
|
TexturePaint of shapes, gradients and rgb values. |
|
|
|
Texture animation with controls for transformations. |
|
|
|
Paths |
Simple append of rectangle to path with and without the connect. |
|
|
|
Cubic & Quad curves implemented through GeneralPath. |
|
|
|
Basic implementation of GeneralPath, filling & drawing a path.
|
|
|
|
3D text shape with GeneralPath & a 300 of small multi-colored rectangles
|
|
|
|
Rectangles filled to illustrate the GeneralPath winding rule, determining the interior of a path.
|
|
|
|
Transforms |
Simple 45 degree rotate of a rectangle. |
|
|
|
Scaling or Shearing or Rotating an image & rectangle. |
|
|
|
Animation of shapes, text and images rotating, scaling and translating around a canvas. |
|
|
|
You can compile the samples by changing to the sample
program's directory and compiling the *.java files, e.g.
For your convenience, we have provided a script to compile all the
samples -- execute compile.bat (for Windows)
or compile.sh (for Solaris).
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.
For your convenience, we have provided another script to run
the samples -- execute run.bat (for Windows)
or run.sh (for Solaris).