Package | com.yworks.canvas.model |
Class | public class ModelManager |
Inheritance | ModelManager Object |
Subclasses | CollectionModelManager, FocusPaintManager, HighlightPaintManager, SelectionPaintManager |
CanvasComponent
Property | Defined By | ||
---|---|---|---|
canvas : CanvasComponent [read-only]
Gets the canvas instance this instance is managing. | ModelManager |
Property | Defined By | ||
---|---|---|---|
_canvas : CanvasComponent
The canvas instance this instance is managing. | ModelManager |
Method | Defined By | ||
---|---|---|---|
ModelManager(canvas:CanvasComponent)
Creates a new instance that will manage the items for the given canvas. | ModelManager | ||
add(item:Object):IModelItemDescriptor
Adds an item to the canvas. | ModelManager | ||
containsDescriptor(descriptor:IModelItemDescriptor):Boolean
Checks whether this descriptor is currently being managed by this instance. | ModelManager | ||
removeDescriptor(descriptor:IModelItemDescriptor):void
Removes the canvas objects associated with the given descriptor handle. | ModelManager | ||
updateDescriptor(descriptor:IModelItemDescriptor):Boolean
Updates the item in the canvas by uninstalling and reinstalling it
into the canvas. | ModelManager |
Method | Defined By | ||
---|---|---|---|
install(member:Object):Array
Abstract method that actually adds the visual representation of an item
to the canvas. | ModelManager | ||
uninstall(descriptor:IModelItemDescriptor, canvasObjects:Array):void
Simple implementation that removes all of the given canvasObjects. | ModelManager |
_canvas | property |
protected var _canvas:CanvasComponent
The canvas instance this instance is managing.
canvas | property |
canvas:CanvasComponent
[read-only] Gets the canvas instance this instance is managing.
public function get canvas():CanvasComponent
ModelManager | () | Constructor |
public function ModelManager(canvas:CanvasComponent)
Creates a new instance that will manage the items for the given canvas.
Parameterscanvas:CanvasComponent — The canvas to manage.
|
add | () | method |
public function add(item:Object):IModelItemDescriptor
Adds an item to the canvas.
This method will call the install( Object )
method
and create a IModelItemDescriptor
handle that can later be used
to remove or update the item's visual representation from or in the canvas.
Parameters
item:Object — The item to add to the canvas.
|
IModelItemDescriptor — A handle that can be used for the removeDescriptor and updateDescriptor methods.
|
containsDescriptor | () | method |
public function containsDescriptor(descriptor:IModelItemDescriptor):Boolean
Checks whether this descriptor is currently being managed by this instance.
Parameters
descriptor:IModelItemDescriptor — The descriptor handle.
|
Boolean — Whether the descriptor is actively managed by this instance.
|
install | () | method |
protected function install(member:Object):Array
Abstract method that actually adds the visual representation of an item to the canvas.
Parameters
member:Object — The item whose visual representation is to be added to the canvas.
|
Array — An array of canvas objects this instance has added to the canvas for the given item.
|
removeDescriptor | () | method |
public function removeDescriptor(descriptor:IModelItemDescriptor):void
Removes the canvas objects associated with the given descriptor handle.
Parameters
descriptor:IModelItemDescriptor — The handle as obtained from add( Object ) .
|
uninstall | () | method |
protected function uninstall(descriptor:IModelItemDescriptor, canvasObjects:Array):void
Simple implementation that removes all of the given canvasObjects.
Parameters
descriptor:IModelItemDescriptor — The descriptor as obtained from a previous add call.
| |
canvasObjects:Array — The canvas objects that have been associated with the descriptor.
|
updateDescriptor | () | method |
public function updateDescriptor(descriptor:IModelItemDescriptor):Boolean
Updates the item in the canvas by uninstalling and reinstalling it into the canvas.
Parameters
descriptor:IModelItemDescriptor — The descriptor to update.
|
Boolean |