Creates a Java applet for creating and displaying Microsoft® 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 ... } }
For relevant methods from the Statics class, see Statics Methods Relevant to DXMApplet Objects.
DXMApplet Methods
DXMApplet Creates a DXMApplet object. getCanvas Gets a DXMCanvas. getModel Gets the model that was set by setModel. setModel Sets the model that will be used. start Starts the canvas rendering DirectAnimation behaviors. stop Stops the canvas rendering DirectAnimation behaviors.
Creates a DXMApplet object.
Syntax
public DXMApplet( );
Gets a DXMCanvas. This method should only be called if you are implementing your own ticking.
Syntax
public DXMCanvas getCanvas( );
Return Value
Returns the DXMCanvas object.
Gets the model that was set by setModel.
Syntax
public Model getModel( );
Sets the model that will be used.
Syntax
public void setModel( Model model );
Parameters
- model
- Model to be set.
Remarks
This method must be called before the model is started. Calling it after the model has started causes an exception.
Adds the canvas.
Syntax
public start( );
Stops the canvas rendering DirectAnimation behaviors.
Syntax
public stop( );
Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.