Packagecom.yworks.canvas
Interfacepublic interface ICanvasObjectDescriptor
Implementors CanvasObjectDescriptor, CanvasObjectDescriptorAdapter

Central interface used by the CanvasComponent to render elements from the canvas object tree.

Implementations will be queried using the user object obtained from ICanvasObject.userObject for the corresponding implementations of the various aspects of the user object. Implementations of this interface need to be provided by the application programmer to the canvas control's various add... methods.



Public Methods
 MethodDefined By
  
getBoundsProvider(forUserObject:Object):IBoundsProvider
Returns an implementation of IBoundsProvider that can determine the visible bounds of the rendering of the user object.
ICanvasObjectDescriptor
  
ICanvasObjectDescriptor
  
getHitTestable(forUserObject:Object):IHitTestable
Returns an implementation of IHitTestable that can determine whether the rendering of the user object has been hit at a given coordinate.
ICanvasObjectDescriptor
  
isDirty(obj:ICanvasObject):Boolean
Returns true if the canvas object needs to be repainted.
ICanvasObjectDescriptor
Method Detail
getBoundsProvider()method
public function getBoundsProvider(forUserObject:Object):IBoundsProvider

Returns an implementation of IBoundsProvider that can determine the visible bounds of the rendering of the user object.

This method may always return the same instance. By contract, clients will not cache instances returned, but will always call this method before the methods on the instance will be called. This contract enables the use of the fly-weight design pattern. Implementations of this class can always return the same instance and reconfigure this instance upon each call to this method.

Parameters

forUserObject:Object — The user object to query the bounds for

Returns
IBoundsProvider — An implementation or null if the bounds are not known, in which case the bounds are treated as infinite
getDisplayObjectCreator()method 
public function getDisplayObjectCreator(forUserObject:Object):IDisplayObjectCreator

Parameters

forUserObject:Object

Returns
IDisplayObjectCreator
getHitTestable()method 
public function getHitTestable(forUserObject:Object):IHitTestable

Returns an implementation of IHitTestable that can determine whether the rendering of the user object has been hit at a given coordinate.

This method may always return the same instance. By contract, clients will not cache instances returned, but will always call this method before the methods on the instance will be called. This contract enables the use of the fly-weight design pattern. Implementations of this class can always return the same instance and reconfigure this instance upon each call to this method.

Parameters

forUserObject:Object — The user object to do the hit testing for

Returns
IHitTestable — An implementation or null if the rendering cannot be hit tested
isDirty()method 
public function isDirty(obj:ICanvasObject):Boolean

Returns true if the canvas object needs to be repainted.

Parameters

obj:ICanvasObject — The canvas object.

Returns
Booleantrue if the canvas object needs to be repainted.