Packagecom.yworks.graph.model
Classpublic class SelectionPaintManager
InheritanceSelectionPaintManager Inheritance ModelManager Inheritance Object

A ModelManager implementation that manages the visual decorations of selected elements in a canvas.

For each item in the model that is marked as selected by the selectionModel this class uses the ILookup mechanism of the items to lookup an ISelectionPaintable implementation which will do the actual installation of the decoration in the canvas.



Public Properties
 PropertyDefined By
 Inheritedcanvas : CanvasComponent
[read-only] Gets the canvas instance this instance is managing.
ModelManager
  groupProvider : ICanvasGroupProvider
The group provider that will be used in install to determine the canvas group where the selection paint should be installed into.
SelectionPaintManager
  model : ICollectionModel
The model that describes the domain for the selection.
SelectionPaintManager
  selectionModel : ISelectionModel
The selection model that determines which items are selected.
SelectionPaintManager
Protected Properties
 PropertyDefined By
 Inherited_canvas : CanvasComponent
The canvas instance this instance is managing.
ModelManager
Public Methods
 MethodDefined By
  
Creates an instance that for all selected items in the model dynamically installs a selection paint decoration.
SelectionPaintManager
 Inherited
Adds an item to the canvas.
ModelManager
  
Adds an item to the current selection.
SelectionPaintManager
 Inherited
Checks whether this descriptor is currently being managed by this instance.
ModelManager
 Inherited
Removes the canvas objects associated with the given descriptor handle.
ModelManager
  
Removes an item from the current selection.
SelectionPaintManager
 Inherited
Updates the item in the canvas by uninstalling and reinstalling it into the canvas.
ModelManager
Protected Methods
 MethodDefined By
  
Callback used by install to retrieve the selection paintable for a given item.
SelectionPaintManager
  
install(member:Object):Array
[override] Abstract method that actually adds the visual representation of an item to the canvas.
SelectionPaintManager
  
remove(item:IModelItem):void
Removes the provided item from this managers set of managed items.
SelectionPaintManager
 Inherited
uninstall(descriptor:IModelItemDescriptor, canvasObjects:Array):void
Simple implementation that removes all of the given canvasObjects.
ModelManager
Property Detail
groupProviderproperty
groupProvider:ICanvasGroupProvider

The group provider that will be used in install to determine the canvas group where the selection paint should be installed into.


Implementation
    public function get groupProvider():ICanvasGroupProvider
    public function set groupProvider(value:ICanvasGroupProvider):void
modelproperty 
model:ICollectionModel

The model that describes the domain for the selection. Only item contained in this model can be rendered as selected.


Implementation
    public function get model():ICollectionModel
    public function set model(value:ICollectionModel):void
selectionModelproperty 
selectionModel:ISelectionModel

The selection model that determines which items are selected. May be null, in which case no elements are considered selected.


Implementation
    public function get selectionModel():ISelectionModel
    public function set selectionModel(value:ISelectionModel):void
Constructor Detail
SelectionPaintManager()Constructor
public function SelectionPaintManager(canvas:CanvasComponent, model:ICollectionModel, selectionModel:ISelectionModel)

Creates an instance that for all selected items in the model dynamically installs a selection paint decoration.

Parameters
canvas:CanvasComponent — The canvas to add the selection marks to.
 
model:ICollectionModel — The model that holds the domain.
 
selectionModel:ISelectionModel — The model that determines which items are selected.
Method Detail
addSelection()method
public function addSelection(item:IModelItem):IModelItemDescriptor

Adds an item to the current selection.

Parameters

item:IModelItem — The item whose selection decorator will added.

Returns
IModelItemDescriptor — A handle that can be used for the removeDescriptor and updateDescriptor methods.
getSelectionPaintable()method 
protected function getSelectionPaintable(item:IModelItem):ISelectionPaintable

Callback used by install to retrieve the selection paintable for a given item.

This implementation uses the ILookup.lookup of the item.

Parameters

item:IModelItem — The item to find a selection paintable for.

Returns
ISelectionPaintable — An ISelectionPaintable or null
install()method 
override 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.

Returns
Array — An array of canvas objects this instance has added to the canvas for the given item.
remove()method 
protected function remove(item:IModelItem):void

Removes the provided item from this managers set of managed items.

Parameters

item:IModelItem — the item to remove

removeSelection()method 
public function removeSelection(item:IModelItem):void

Removes an item from the current selection.

Parameters

item:IModelItem — The item whose selection decorator will be removed.