public class DXMCanvas extends java.awt.Canvas{ // Constructor public DXMCanvas(); // Methods from java.awt.Canvas public synchronized void addNotify(); public synchronized boolean handleEvent(Event e); public synchronized void hide(); public void paint(Graphics g); public synchronized void removeNotify(); public synchronized void reshape(int x, int y, int width, int height); public synchronized void show(); public void update(Graphics g); //Methods from Runnable Interface public void run(); // Methods from Viewer Interface public double getCurrentTime(); public double getCurrentTickTime(); public Preferences getPreferences(); public ErrorAndWarningReceiver registerErrorAndWarningReceiver(ErrorAndWarningReceiver w); public void startModel(); public void stopModel(); public void tick(); public synchronized void tick (double timeToUse); // Methods public synchronized void addModel(); public synchronized abstract void addModel(); public Model getModel(); public synchronized void hideModel(); public synchronized abstract void hideModel(); public synchronized void removeModel(); public synchronized abstract void removeModel(); public void setModel(Model); public synchronized void showModel(); public synchronized abstract void showModel(); }
Creates an Java canvas for creating and displaying 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.
Creates an DXMCanvas object.
public DXMCanvas( );
Overrides the Java implementation and calls the superclass. This method should not be overridden.
public synchronized void addNotify( );
Overrides the Java implementation and calls the superclass. For more information, see a Java reference.
public synchronized boolean handleEvent(
Event e
);
Overrides the Java implementation and calls the superclass. This method should not be overridden. For more information, see a Java reference.
public synchronized void hide( );
Overrides the Java implementation and calls the superclass. For more information, see a Java reference.
public void paint(
Graphics g
);
Overrides the Java implementation and calls the superclass. This method should not be overridden.
public synchronized void removeNotify( );
Overrides the Java implementation and calls the superclass. For more information, see a Java reference.
public synchronized void reshape(
int x,
int y,
int width,
int height
);
Overrides the Java implementation and calls the superclass. This method should not be overridden. For more information, see a Java reference.
public synchronized void show( );
Overrides the Java implementation and calls the superclass. For more information, see a Java reference.
public void update(
Graphics g
);
Implements the Runnable interface to create a background thread for ticking the model. For more information about Runnable, consult a Java reference.
public void run( );
registerErrorAndWarningReceiver
See getCurrentTime in the Viewer Interface.
public double getCurrentTime( );
See getCurrentTickTime in the Viewer Interface.
public void getCurrentTickTime( );
See getPreferences in the Viewer Interface.
public Preferences getPreferences( );
See registerErrorAndWarningReceiver in the Viewer Interface section.
public ErrorAndWarningReceiver registerErrorAndWarningReceiver(
ErrorAndWarningReceiver w
);
See startModel in the Viewer Interface section.
public void startModel( );
See stopModel in the Viewer Interface section.
public void stopModel( );
See tick in the Viewer Interface section.
public void tick( );
See tick in the Viewer Interface section.
public synchronized void tick (
double timeToUse
);
Creates a background thread to tick the model and calls startModel. To perform manual ticking, override this method.
public synchronized void addModel( );
Implement this to override addModel.
public abstract synchronized void addModel( );
Gets the model that was set by setModel.
public Model getModel( );
In the default implementation, this method pauses the background thread. This method can be overridden.
public synchronized void hideModel( );
Implement this to override hideModel.
public synchronized abstract void hideModel( );
This method terminates the thread and then calls stopModel. This method can be overridden.
public synchronized void removeModel( );
Implement this to override removeModel.
public synchronized abstract void removeModel
Sets the model that will be used.
public void setModel(
Model model
);
In the default implementation, this method ensures that the thread is resumed. This method can be overridden.
public synchronized void showModel( );
Implement this to override showModel.
public synchronized abstract void showModel( );
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.