DirectAnimation Animated Header --DXMApplet Class DirectAnimation Animated Header --DXMApplet Class* Microsoft DirectAnimation SDK
*Contents  *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 Constructor

DXMApplet Class

Creates an DXMApplet object.

public DXMApplet( );



DXMApplet Methods

bullet1.gifgetCanvas

bullet1.gifgetModel

bullet1.gifsetModel

bullet1.gifstart

bullet1.gifstop


getCanvas

DXMApplet Class

Gets a DXMCanvas. This method should only be called if you are implementing your own ticking.

public DXMCanvas getCanvas( );

Return Values

Returns the DXMCanvas object.


getModel

DXMApplet Class

Gets the model that was set by setModel.

public Model getModel( );


setModel

DXMApplet Class

Sets 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.


start

DXMApplet Class

Adds the canvas.

public start( );


stop

DXMApplet Class

Adds 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.

*Top of Page