Packagecom.yworks.canvas.drawing
Classpublic class PaintableDisplayObjectCreator
InheritancePaintableDisplayObjectCreator Inheritance Object
Implements IDisplayObjectCreator

Simple IDisplayObjectCreator implementation which uses an IPaintable to render the generated DisplayObject.

Can be used to use an IPaintable as IDisplayObjectCreator.

See also

IPaintable
IDisplayObjectCreator


Public Methods
 MethodDefined By
  
Creates a new instance which uses the given paintable to render the DisplayObject
PaintableDisplayObjectCreator
  
Creates a new DisplayObject from scratch.
PaintableDisplayObjectCreator
  
updateDisplayObject(oldDisplayObject:DisplayObject, context:IDisplayObjectContext):DisplayObject
Updates the given DisplayObject or returns a new one.
PaintableDisplayObjectCreator
Constructor Detail
PaintableDisplayObjectCreator()Constructor
public function PaintableDisplayObjectCreator(paintable:IPaintable)

Creates a new instance which uses the given paintable to render the DisplayObject

Parameters
paintable:IPaintable — The paintable to be used as renderer.
Method Detail
createDisplayObject()method
public function createDisplayObject(context:IDisplayObjectContext):DisplayObject

Creates a new DisplayObject from scratch.

Parameters

context:IDisplayObjectContext — The context for which the display object is created.

Returns
DisplayObject — A DisplayObject.
updateDisplayObject()method 
public function updateDisplayObject(oldDisplayObject:DisplayObject, context:IDisplayObjectContext):DisplayObject

Updates the given DisplayObject or returns a new one.

If the old display object was created by this implementation, its graphics will be cleared and the paintable will be used to re-paint on the same display object.

Parameters

oldDisplayObject:DisplayObject — The display object to update.
 
context:IDisplayObjectContext — The rendering context.

Returns
DisplayObject — The updated DisplayObject. May be a different instance.