DirectX Media for Animation Java Reference |
![]() Previous |
![]() Classes |
![]() Index |
![]() Next |
public class AppTriggeredEvent extends DXMEvent { // Constructor public AppTriggeredEvent(BehaviorCtx ctx); // Methods public void trigger(); public void trigger(Behavior eventData);
Creates the event. The event can be used in the until and untilNotify methods to create reactive behaviors based on external events.
In the following example, a cube turns from red to blue, based upon some external application event:
//Turn a cube from red to blue when an external event occurs //The following code is a fragment from some larger program //Get the cube GeometryBvr cube = importGeometry("cube.wrl"); //Create the external event AppTriggeredEvent appEvent = new AppTriggeredEvent(BehaviorCtx ctx); //Set up the color of the cube -- red until the event, then blue ColorBvr col = (ColorBvr)until(red, appEvent, blue); //Map the color to all points of the cube GeometryBvr coloredCube = cube.diffuseColor(col); //...elsewhere, when the application receives the event... appEvent.trigger(); //...now coloredCube (assuming it's running) will turn blue
public AppTriggeredEvent (BehaviorCtx ctx);Constructs an AppTriggeredEvent object.
Parameter Description ctx Contains state information (such as the view).
public void trigger();Triggers the event.
Remarks:
The triggered event occurs as soon as possible.
public void trigger(Behavior eventData);Triggers the event and passes the given data to the event handler or notifier.
Parameter Description eventData An object that contains any data representing the event. Remarks:
The triggered event occurs as soon as possible.
© 1997 Microsoft Corporation. All rights reserved. Legal Notices.