Class TKObject

Object
   |
   +--TKObject

class TKObject


The TKObject class is the base class for all TuneKit objects and provides a way to receive and trigger notifications when a JavaScript property changes.

Observing a property on an object is done through the addPropertyObserver method, specifying the property to observe as well as the object that will receive the notifications of the property change. Likewise, an object can stop observing such changes using the removePropertyObserver method. When a property value changes, the author needs to call the notifyPropertyChange method so that registered observers will be notified. Note that synthetized properties will automatically trigger notifications when changed, so in this case, setters need not manually call notifyPropertyChange.

Finally, TKObject also provides the callSuper method to call the superclass's implementation of an overload method.


Defined in Object.js


Field Summary
 Object observedProperties
          
 
Constructor Summary
TKObject()
           
 
Method Summary
 void addPropertyObserver(<String> propertyName, <Object> observer, <String> methodName)
           Adds an observer for the named property on this object.
 int callMethodNameAfterDelay(<String> methodName, <int> delay)
           Calls a method on this object after a delay, allowing any number of optional extra arguments to be passed after the first two mandatory ones.
 Object callSuper()
           This method calls the object's superclass implementation of the current method
 void notifyPropertyChange(<String> propertyName)
           Triggers a notification that the given property on this object has changed.
 bool removePropertyObserver(<String> propertyName, <Object> observer)
           Removes the observer for the named property on this object.

Field Detail

observedProperties

Object observedProperties

Constructor Detail

TKObject

TKObject()

Method Detail

addPropertyObserver

void addPropertyObserver(<String> propertyName, <Object> observer, <String> methodName)

callMethodNameAfterDelay

int callMethodNameAfterDelay(<String> methodName, <int> delay)

callSuper

Object callSuper()

notifyPropertyChange

void notifyPropertyChange(<String> propertyName)

removePropertyObserver

bool removePropertyObserver(<String> propertyName, <Object> observer)


Documentation generated by JSDoc on Tue Sep 15 21:24:36 2009