Java Samples

This section describes the Java samples included with Microsoft® DirectAnimation®.

To build the samples, you need to have the Microsoft SDK for Java installed. When built, the applet needs to be put in the directory above the \Media subdirectory to run. Otherwise, you will get a security violation.

This section describes the following types of samples.

Java Exercises

Java exercises provide the Java class files and an HTML file to display the applet. You can run the samples without compiling, but if you modify a sample for your own uses you will need to recompile the Java class files. These samples are subdirectories contained in the DXMedia\Samples\Multimedia\DAnim\Java\Exercises folder. The following table lists the available Java exercises and the concepts that they illustrate.

Java exercise directoryDescription
Apple The Apple Java sample imports three images, tiles one for the background, animates the transform and opacity of a second, and layers the three images on top of one another.
Geometry The Geometry Java sample imports and spins a cube on a blue background.
Hello The Hello Java sample displays a "Hello, World" message on a blue background.
HelloBvr The HelloBvr Java sample displays a "Hello, World" message with a time-varying color.
HelloCycle The HelloCycle Java sample displays a "Hello, World" message with a color that cycles between a time-varying color and a red color when the user clicks the left mouse button.
HelloRBvr The HelloRBvr Java sample displays a "Hello, World" message with a time-varying color that reacts to a mouse click by switching to red.
Image The Image Java sample imports an image and oscillates it on a blue background.
Import The Import Java sample imports a media file (an image) and displays the result.
Movie The Movie Java sample imports and plays a movie repeatedly.
Sound The Sound Java sample oscillates an image on a black background and attenuates a looping sound.
Switch The Switch Java sample demonstrates the switcher/switching functionality; in this case, an image and a sound behavior that are switched to new values in reaction to external events.

Java Templates

Java templates provide the Java class files and an HTML file to display the applet. You can run the samples without compiling, but if you modify a sample for your own uses you will need to recompile the Java class files. These samples are subdirectories contained in the DXMedia\Samples\Multimedia\DAnim\Java\Templates folder. The following table lists the available Java templates and the concepts that they illustrate.

Java template directoryDescription
Async_Load The Async_Load Java sample demonstrates how to use an animation to mask download time for a large media file.
BasicApplet The BasicApplet Java sample demonstrates a minimal applet.
ButtonPick The ButtonPick Java sample demonstrates a button that changes color when the mouse pointer is over it or when the user clicks a mouse button.
ExtendedApplet The ExtendedApplet Java sample demonstrates a basic applet with an animated two-dimensional (2-D) image. This includes initialization, creating the model, and scaling the image to fit the size of the applet's window.
GeoApplet1 The GeoApplet1 Java sample demonstrates a basic applet with an animated geometry. It includes the use of viewport dimensions to scale the geometry, and basic camera settings to render an animated geometry.
GeoApplet2 The GeoApplet2 Java sample demonstrates an applet that self-controls the frame generation through the tick interface and animates primarily through switching behaviors. Effectively, this looks like a traditional retained-mode API such as Direct3D Retained Mode.
GeometryDrag The GeometryDrag Java sample demonstrates a draggable geometry.
IE4_Windowless The IE4_Windowless Java sample demonstrates how to construct a windowless control based on a DirectAnimation Java applet.
ImageDrag The ImageDrag Java sample demonstrates a draggable image.
JumpURL The JumpURL Java sample demonstrates how to create a pickable image that jumps to a Web site when clicked, and plays a sound and displays a message when the mouse pointer is over it.
Splines The Splines Java sample demonstrates how to use splines as paths and behaviors.
Using_AFCMenus The Using_AFCMenus Java sample demonstrates using AFC (Applet Foundation Classes) to create menus in DirectAnimation.
Using_AFCScrollBar The Using_AFCScrollBar Java sample demonstrates using AFC (Applet Foundation Classes) to create a scroll bar in DirectAnimation.
Using_VBScript The Using_VBScript Java sample demonstrates using VBScript objects in conjunction with an animation applet.
VCR The VCR Java sample demonstrates how to control the rate of video playback.

Java Showcase Samples

Java showcase samples provide the Java class files and an HTML file to display the applet. You can run the samples without compiling, but if you modify a sample for your own uses you will need to recompile the Java class files.

These samples are subdirectories contained in the DXMedia\Samples\Multimedia\DAnim\Java\Showcase folder. The following table lists the available Java showcase samples and the concepts that they illustrate.

Java showcase directoryDescription
Album3D The Album3D Java sample constructs a 3-D photo album that enables you to flip through the pages. It shows a state machine that controls the interaction with the album, including the visual animation and corresponding stereo sound effects.
Americana The Americana Java sample contrasts autonomous animation and interaction. It shows composition of sprites, how to use interactive sprite animation as a texture on 3-D objects, and the use of Microsoft Visual Basic® buttons to interact with the animation.
CityScape The CityScape Java sample shows 3-D overlaying a sprite animation with hot spots, live URLs, and sound effects.
Coffee The Coffee Java sample shows animated montages with sound.
Encarta The Encarta Java sample illustrates a streaming advertisement. Features include 2-D/3-D interplay, including the use of interactive animations as textures in 3-D, punctuation of the advertisement with MIDI audio, and asynchronous download of media for fast startup time. It also illustrates 3-D animation with audio and camera, 2-D sprite animation with audio and affine transforms applied to sprites, 2-D vector graphics with interactivity, and video with a control panel for play, pause, fast forward, and rewind.
FifteenPuzzle The FifteenPuzzle Java sample constructs a classic 15-image sorting puzzle using video, 2-D, and 3-D animations as images on the puzzle, which also has a 3-D mode.
GeoImage The GeoImage Java sample shows 2-D/3-D interplay and the synchronization between a visual animation and a sound effect.
Lighthouse The Lighthouse Java sample illustrates the use of 3-D in a 2-D composition space by adding 3-D animate and interactive elements to a sprite animation background. This sample also illustrates the use of synthetic sound for the ocean ambient sound.
Magnify The Magnify Java sample integrates 2-D and 3-D images and sound, and creates a magnifying glass controlled by the user. It illustrates compound compositions in DirectAnimation, first in the magnifying glass and second in texturing the animations on the 3-D parts.
MsCubes The MsCubes Java sample illustrates tumbling cubes textured with motion .gif files. Includes MIDI sound.
Pick3 The Pick3 Java sample demonstrates 3-D picking on a significantly changing image.
Solar The Solar Java sample shows several textured 3-D objects with sound sources, illustrates spatialization and mixing of sound, and has a simple 2-D user interface for restricted manipulation of the camera.
Tile The Tile Java sample demonstrates animated cropping and tiling.
Union The Union Java sample demonstrates a cluster of geometry with color and transform behaviors, and a simple looping background sound.

Chess Application

The Java Chess application demonstrates how to import and view an animated playback of chess games from PGN (Portable Game Notation) files. You can move forward and backward in the games, rotate the board, and zoom in or out.


Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.