public class DXMApplet extends java.applet.Applet { // Constructor public DXMApplet(); // Methods public DXMCanvas getCanvas(); public Model getModel(); public Model setModel(); public start(); public stop(); }
Creates a Java applet for creating and displaying DirectAnimation behaviors. By default, DXMApplet provides its own frameloop which means the applications need not provide one explicitly. It is possible, of course, to do so by overriding the default behavior. Here is an example of using the DXMApplet to view a model called MyModel:
import com.ms.dxmedia.*; //Create an applet called MyApplet public class MyApplet extends DXMApplet{ public class MyApplet() { // Set the model setModel(new MyModel()); } } // Code fragment for MyModel class MyModel extends Model { // The createModel method is where the animation is constructed public void createModel(BvrsToRun extraBvrsToRun) { //Whatever MyModel does ... } }
Creates an DXMApplet object.
public DXMApplet( );
Gets a DXMCanvas. This method should only be called if you are implementing your own ticking.
public DXMCanvas getCanvas( );
Returns the DXMCanvas object.
Gets the model that was set by setModel.
public Model getModel( );
Sets the model that will be used.
public void setModel(
Model model
);
This method must be called before the model is started. Calling it after the model has started causes an exception.
Adds the canvas.
public start( );
Adds the canvas.
public stop( );
The following methods are defined in the Statics class and are most relevant to objects of type DXMApplet.
public static ErrorAndWarningReceiver registerErrorAndWarningReceiver(ErrorAndWarningReceiver w)
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.