DirectX Media for Animation Java Reference Previous
Previous
Classes
Classes
Index
Index
Next
Next

DXMCanvas Class

Constructor , Methods from java.awt.Canvas , Methods from Runnable Interface , Methods from Viewer Interface , Methods

public class DXMCanvas extends java.awt.Canvas{
    // Constructor
    public DXMCanvas();
    
    // Methods from java.awt.Canvas
    public void addNotify();
    public boolean handleEvent(Event e);
    public synchronized void hide();
    public void paint(Graphics g);
    public 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 setPreferences(Preferences p);
    public void startModel();
    public void stopModel();
    public void tick();
    public synchronized void tick (double timeToUse);
    
    // Methods
    public synchronized void addModel();
    public Model getModel();
    public synchronized void hideModel();
    public synchronized void removeModel();
    public void setModel(Model);
    public synchronized void showModel();
    }

Creates an Java canvas for creating and displaying Direct Animation 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.


Constructor


DXMCanvas();

public DXMCanvas();

Creates an DXMCanvas object.


Methods from java.awt.Canvas


addNotify

public void addNotify();

Overrides the Java implementation and calls the superclass. This method should not be overridden.


handleEvent

public boolean handleEvent(Event e);

Overrides the Java implementation and calls the superclass. For more information, see a Java reference.


hide

public synchronized void hide();

Overrides the Java implementation and calls the superclass. This method should not be overridden. For more information, see a Java reference.


paint

public void paint(Graphics g);

Overrides the Java implementation and calls the superclass. For more information, see a Java reference.


removeNotify

public void removeNotify();

Overrides the Java implementation and calls the superclass. This method should not be overridden.


reshape

public synchronized void reshape(int x, int y, int width, int height);

Overrides the Java implementation and calls the superclass. For more information, see a Java reference.


show

public synchronized void show();

Overrides the Java implementation and calls the superclass. This method should not be overridden. For more information, see a Java reference.


update

public void update(Graphics g);

Overrides the Java implementation and calls the superclass. For more information, see a Java reference.

ParameterDescription
g The object to be updated.


Methods from Runnable Interface


run

public void run();

Implements the Runnable interface to create a background thread for ticking the model. For more information about Runnable, consult a Java reference.


Methods from Viewer Interface


getCurrentTime

public double getCurrentTime();

See getCurrentTime in the Viewer Interface.


getCurrentTickTime

public void getCurrentTickTime();

See getCurrentTickTime in the Viewer Interface.


getPreferences

public Preferences getPreferences();

See getPreferences in the Viewer Interface.


registerErrorAndWarningReceiver

public ErrorAndWarningReceiver registerErrorAndWarningReceiver(ErrorAndWarningReceiver w);

See registerErrorAndWarningReceiver in the Viewer Interface section.


setPreferences

public void setPreferences(Preferences p);

See setPreferences in the Viewer Interface section.


startModel

public void startModel();

See startModel in the Viewer Interface section.


stopModel

public void stopModel();

See stopModel in the Viewer Interface section.


tick

public void tick();

See tick in the Viewer Interface section.


tick

public synchronized void tick (double timeToUse);

See tick in the Viewer Interface section.


Methods


addModel

public synchronized void addModel();

Creates a background thread to tick the model and calls startModel. To perform manual ticking, override this method.


getModel

public Model getModel();

Gets the model that was set by setModel.


hideModel

public synchronized void hideModel();

In the default implementation, this method pauses the background thread. This method can be overridden.


removeModel

public synchronized void removeModel();

This method terminates the thread and then calls stopModel. This method can be overridden.


setModel

public void setModel(Model model);

Sets the model that will be used.

ParameterDescription
model The model to be set.


showModel

public synchronized void showModel();

In the default implementation, this method ensures that the thread is resumed. This method can be overridden.



Top© 1997 Microsoft Corporation. All rights reserved. Legal Notices.