Index Topic Contents | |||
Previous Topic: Preferences Class Next Topic: SoundBvr Class |
PropertyDispatcher Class
public class PropertyDispatcher extends java.lang.Object { // Constructor public PropertyDispatcher(Behavior a); // Methods public void detach(); public Behavior getBvr(); public Behavior notify(int, boolean, double, double, Behavior, Behavior); public void setControl(Object object); public void setPropertyName(String name); }This class allows DirectAnimation behaviors to be attached to (and detached from) properties in ActiveX controls. For example, a NumberBvr can be attached to the width property of a frame on an HTML page.
PropertyDispatcher Class
PropertyDispatcher ConstructorConstructs a PropertyDispatcher object.
public PropertyDispatcher(
Behavior a
);Parameters
- a
- The behavior to be attached to an ActiveX control property.
Remarks
Th behavior specified by a is used only in the constructor. To attach a behavior to a property, first create the PropertyDispatcher class with that behavior, and then extract an equivalent behavior with getBvr(). Use this behavior in the model. When access to the control and its property name is available, call setControl() and setPropertyName(). Here is an example:
NumberBvr n = the behavior that will be attached to a control PropertyDispatcher pd = new PropertyDispatcher(n); NumberBvr attachedN = (NumberBvr)pd.getBvr(); //...At some other point pd.setControl(ctrl); pd.setPropertyName("width");Note that the attachedN behavior must be running to affect the attached property. The behavior is running if:
- It is part of the image or sound registered with setImage() or setSound() on the model.
- It was explicitly added to a BvrsToRun list.
PropertyDispatcher Methods
PropertyDispatcher Class
detachDetaches an already attached behavior from an ActiveX control property.
public void detach( );
PropertyDispatcher Class
getBvrReturns a behavior that, while it is the same as the behavior used in the constructor, is updated over time. This is the behavior that should be used once the PropertyDispatcher object has been constructed.
public Behavior getBvr( );
Return Values
Returns the Behavior object.
PropertyDispatcher Class
setControlSets the ActiveX control object to which a behavior will be attached.
public void setControl(
Object object
);Parameters
- object
- The ActiveX control object to which a behavior will be attached.
PropertyDispatcher Class
setPropertyNameSets the name of the ActiveX control property to which a DirectAnimation behavior will be attached.
public void setPropertyName(
String name
);Parameters
- name
- The name of the property to which a DirectAnimation behavior will be attached.
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.