Index Topic Contents | |||
Previous Topic: DXMApplet Class Next Topic: DXMEvent Class |
DXMCanvas Class
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.
- DXMCanvas Constructor
- DXMCanvas Methods from java.awt.Canvas
- DXMCanvas Methods from Runnable Interface
- DXMCanvas Methods from Viewer Interface
- DXMCanvas Methods
DXMCanvas Class
DXMCanvas ConstructorCreates an DXMCanvas object.
public DXMCanvas( );
DXMCanvas Methods from java.awt.Canvas
DXMCanvas Class
addNotifyOverrides the Java implementation and calls the superclass. This method should not be overridden.
public synchronized void addNotify( );
DXMCanvas Class
handleEventOverrides the Java implementation and calls the superclass. For more information, see a Java reference.
public synchronized boolean handleEvent(
Event e
);DXMCanvas Class
hideOverrides the Java implementation and calls the superclass. This method should not be overridden. For more information, see a Java reference.
public synchronized void hide( );
DXMCanvas Class
paintOverrides the Java implementation and calls the superclass. For more information, see a Java reference.
public void paint(
Graphics g
);DXMCanvas Class
removeNotifyOverrides the Java implementation and calls the superclass. This method should not be overridden.
public synchronized void removeNotify( );
DXMCanvas Class
reshapeOverrides 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
);DXMCanvas Class
showOverrides the Java implementation and calls the superclass. This method should not be overridden. For more information, see a Java reference.
public synchronized void show( );
DXMCanvas Class
updateOverrides the Java implementation and calls the superclass. For more information, see a Java reference.
public void update(
Graphics g
);Parameters
- g
- The object to be updated.
DXMCanvas Methods from Runnable Interface
DXMCanvas Class
runImplements the Runnable interface to create a background thread for ticking the model. For more information about Runnable, consult a Java reference.
public void run( );
DXMCanvas Methods from Viewer Interface
getCurrentTime getCurrentTickTime getPreferences registerErrorAndWarningReceiver startModel stopModel tick() tick(timeToUse) DXMCanvas Class
getCurrentTimeSee getCurrentTime in the Viewer Interface.
public double getCurrentTime( );
DXMCanvas Class
getCurrentTickTimeSee getCurrentTickTime in the Viewer Interface.
public void getCurrentTickTime( );
DXMCanvas Class
getPreferencesSee getPreferences in the Viewer Interface.
public Preferences getPreferences( );
DXMCanvas Class
registerErrorAndWarningReceiverSee registerErrorAndWarningReceiver in the Viewer Interface section.
public ErrorAndWarningReceiver registerErrorAndWarningReceiver(
ErrorAndWarningReceiver w
);DXMCanvas Class
startModelSee startModel in the Viewer Interface section.
public void startModel( );
DXMCanvas Class
stopModelSee stopModel in the Viewer Interface section.
public void stopModel( );
DXMCanvas Class
tickSee tick in the Viewer Interface section.
public void tick( );
DXMCanvas Class
tickSee tick in the Viewer Interface section.
public synchronized void tick (
double timeToUse
);DXMCanvas Methods
addModel addModel - abstract method getModel hideModel hideModel - abstract method removeModel removeModel - abstract method setModel showModel showModel - abstract method DXMCanvas Class
addModelCreates a background thread to tick the model and calls startModel. To perform manual ticking, override this method.
public synchronized void addModel( );
DXMCanvas Class
addModelImplement this to override addModel.
public abstract synchronized void addModel( );
DXMCanvas Class
getModelGets the model that was set by setModel.
public Model getModel( );
DXMCanvas Class
hideModelIn the default implementation, this method pauses the background thread. This method can be overridden.
public synchronized void hideModel( );
DXMCanvas Class
hideModelImplement this to override hideModel.
public synchronized abstract void hideModel( );
DXMCanvas Class
removeModelThis method terminates the thread and then calls stopModel. This method can be overridden.
public synchronized void removeModel( );
DXMCanvas Class
removeModelImplement this to override removeModel.
public synchronized abstract void removeModel
DXMCanvas Class
setModelSets the model that will be used.
public void setModel(
Model model
);Parameters
- model
- The model to be set.
DXMCanvas Class
showModelIn the default implementation, this method ensures that the thread is resumed. This method can be overridden.
public synchronized void showModel( );
DXMCanvas Class
showModelImplement this to override showModel.
public synchronized abstract void showModel( );
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.