Package | com.yworks.graph.model |
Class | public class SelectionPaintManager |
Inheritance | SelectionPaintManager ModelManager Object |
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.
Property | Defined By | ||
---|---|---|---|
canvas : 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 |
Method | Defined By | ||
---|---|---|---|
SelectionPaintManager(canvas:CanvasComponent, model:ICollectionModel, selectionModel:ISelectionModel)
Creates an instance that for all selected items in the model dynamically
installs a selection paint decoration. | SelectionPaintManager | ||
add(item:Object):IModelItemDescriptor
Adds an item to the canvas. | ModelManager | ||
Adds an item to the current selection. | SelectionPaintManager | ||
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 | ||
removeSelection(item:IModelItem):void
Removes an item from the current selection. | SelectionPaintManager | ||
updateDescriptor(descriptor:IModelItemDescriptor):Boolean
Updates the item in the canvas by uninstalling and reinstalling it
into the canvas. | ModelManager |
Method | Defined 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 | ||
uninstall(descriptor:IModelItemDescriptor, canvasObjects:Array):void
Simple implementation that removes all of the given canvasObjects. | ModelManager |
groupProvider | property |
groupProvider:ICanvasGroupProvider
The group provider that will be used in install
to determine the canvas group where the selection paint should be installed into.
public function get groupProvider():ICanvasGroupProvider
public function set groupProvider(value:ICanvasGroupProvider):void
model | property |
model:ICollectionModel
The model that describes the domain for the selection. Only item contained in this model can be rendered as selected.
public function get model():ICollectionModel
public function set model(value:ICollectionModel):void
selectionModel | property |
selectionModel:ISelectionModel
The selection model that determines which items are selected.
May be null
, in which case no elements are considered selected.
public function get selectionModel():ISelectionModel
public function set selectionModel(value:ISelectionModel):void
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.
Parameterscanvas: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.
|
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.
|
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.
|
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.
|
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.
|