Creates a Java canvas for creating and displaying Microsoft® DirectAnimation® behaviors. By default, DXMCanvas 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.
addNotify Overrides the Java implementation and calls the superclass. handleEvent Overrides the Java implementation and calls the superclass. hide Overrides the Java implementation and calls the superclass. paint Overrides the Java implementation and calls the superclass. removeNotify Overrides the Java implementation and calls the superclass. reshape Overrides the Java implementation and calls the superclass. show Overrides the Java implementation and calls the superclass. update Overrides the Java implementation and calls the superclass.
Overrides the Java implementation and calls the superclass. This method should not be overridden.
Syntax
public synchronized void addNotify( );
Overrides the Java implementation and calls the superclass. This method is called when any event occurs inside the DXMCanvas object.
Syntax
public synchronized boolean handleEvent( Event e );
Parameters
Return Value
Returns true if the event has been handled and no further action is necessary. Returns false if the event is to be given to the component's parent.
Overrides the Java implementation and calls the superclass. This method should not be overridden. Hides the DXMCanvas object. The object continues to exist and be in its containing object, but it is not visible and does not have any space allocated for it.
Syntax
public synchronized void hide( );
Overrides the Java implementation and calls the superclass. This method is called to repaint this canvas.
Syntax
public void paint( Graphics g );
Parameters
Overrides the Java implementation and calls the superclass. This method should not be overridden. Called when the DXMCanvas object is removed.
Syntax
public synchronized void removeNotify( );
Overrides the Java implementation and calls the superclass. Reshapes this component to the specified bounding box in its parent's coordinate space.
Syntax
public synchronized void reshape( int x, int y, int width, int height );
Parameters
Overrides the Java implementation and calls the superclass. This method should not be overridden. Shows the DXMCanvas object. If the object has been made invisible by a call to the hide method, makes the object visible again.
Syntax
public synchronized void show( );
Overrides the Java implementation and calls the superclass. Called in response to a call to repaint.
Syntax
public void update( Graphics g );
Parameters
run Implements the Runnable interface to create a background thread for ticking the model.
Implements the Runnable interface to create a background thread for ticking the model. For more information about Runnable, consult a Java reference.
Syntax
public void run( );
getCurrentTime Returns the number of seconds since startModel was invoked. getCurrentTickTime Returns the time provided for the most recent call to tick or 0 if tick has not yet been called. getPreferences Allows the application to dynamically view the viewer preferences. registerErrorAndWarningReceiver Allows the application to register an object that will have its methods invoked when errors are encountered. startModel Starts the behaviors associated with the model at global time 0. stopModel Forces all media to stop immediately. tick() Provides a shorthand way of writing tick(getCurrentTime()). tick(timeToUse) Explicitly performs a single sampling and display of the model, where timeToUse represents the global time.
Returns the number of seconds since startModel was invoked.
Syntax
public double getCurrentTime( );
Return Value
Returns a double floating-point number.
Returns the time provided for the most recent call to tick or 0 if tick has not yet been called.
Syntax
public void getCurrentTickTime( );
Return Value
Returns the double floating-point number representing the current tick time.
Allows the application to dynamically view the viewer preferences. For more information about preferences, see Preferences.
Syntax
public Preferences getPreferences( );
Return Value
Returns the Preferences object.
Allows the application to register an object that will have its methods invoked upon asynchronous errors encountered when DirectAnimation media is controlling the frame loop or when recoverable errors occur when sampling and displaying the model.
Syntax
public ErrorAndWarningReceiver registerErrorAndWarningReceiver ( ErrorAndWarningReceiver w );
Parameters
- w
- ErrorAndWarningReceiver object to be registered.
Return Value
Returns the ErrorAndWarningReceiver object.
Starts the behaviors associated with the model at global time 0. Also causes the createModel method on the model itself to be invoked.
Syntax
public void startModel( );
Forces all media to stop immediately. It is not required to call this method, however, without it, some media (such as sounds) will continue playing until the object is released.
Syntax
public void stopModel( );
Provides a shorthand way of writing tick(getCurrentTime()). It is the easiest way to explicitly sample and display model and provides a real-time clock for global time.
Syntax
public void tick( );
Explicitly performs a single sampling and display of the model, where timeToUse represents the global time.
Syntax
public synchronized void tick ( double timeToUse );
Parameters
- timeToUse
- Global time for the single sampling.
addModel Creates a background thread to tick the model and calls startModel. addModel - abstract method Implement this to override addModel. DXMCanvas Creates a DXMCanvas object. getModel Gets the model that was set by setModel. hideModel In the default implementation, pauses the background thread. hideModel - abstract method Implement this to override hideModel. removeModel Terminates the thread and then calls stopModel. removeModel - abstract method Implement this to override removeModel. setModel Sets the model that will be used. showModel In the default implementation, ensures that the thread is resumed. showModel - abstract method Implement this to override showModel.
Creates a background thread to tick the model and calls startModel. To perform manual ticking, override this method.
Syntax
public synchronized void addModel( );
Implement this to override addModel.
Syntax
public abstract synchronized void addModel( );
Creates a DXMCanvas object.
Syntax
public DXMCanvas( );
Gets the model that was set by setModel.
Syntax
public Model getModel( );
In the default implementation, this method pauses the background thread. This method can be overridden.
Syntax
public synchronized void hideModel( );
Implement this to override hideModel.
Syntax
public synchronized abstract void hideModel( );
This method terminates the thread and then calls stopModel. This method can be overridden.
Syntax
public synchronized void removeModel( );
Implement this to override removeModel.
Syntax
public synchronized abstract void removeModel
Sets the model that will be used.
Syntax
public void setModel( Model model );
Parameters
In the default implementation, this method ensures that the thread is resumed. This method can be overridden.
Syntax
public synchronized void showModel( );
Implement this to override showModel.
Syntax
public synchronized abstract void showModel( );
Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.