Index Topic Contents | |||
Previous Topic: DashStyleBvr Class Next Topic: DXMCanvas Class |
DXMApplet Class
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 ... } }DXMApplet Class
DXMApplet ConstructorCreates an DXMApplet object.
public DXMApplet( );
DXMApplet Methods
DXMApplet Class
getCanvasGets a DXMCanvas. This method should only be called if you are implementing your own ticking.
public DXMCanvas getCanvas( );
Return Values
Returns the DXMCanvas object.
DXMApplet Class
getModelGets the model that was set by setModel.
public Model getModel( );
DXMApplet Class
setModelSets the model that will be used.
public void setModel(
Model model
);Parameters
- model
- The 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.
DXMApplet Class
startAdds the canvas.
public start( );
DXMApplet Class
stopAdds the canvas.
public stop( );
Relevant Methods from the Statics Class
The following methods are defined in the Statics class and are most relevant to objects of type DXMApplet.
public static ErrorAndWarningReceiver registerErrorAndWarningReceiver(ErrorAndWarningReceiver w)
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.