    Contents  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 Constructor
> - PropertyDispatcher Methods

> ###

> PropertyDispatcher Constructor

> PropertyDispatcher Class

> Constructs 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

> detach

> getBvr

> setControl

> setPropertyName

> ####

> detach

> PropertyDispatcher Class

> Detaches an already attached behavior from an ActiveX control property.

> public void detach( );

> ####

> getBvr

> PropertyDispatcher Class

> Returns 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.

> ####

> setControl

> PropertyDispatcher Class

> Sets 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.

> ####

> setPropertyName

> PropertyDispatcher Class

> Sets 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.

> Top of Page