SelectionIndicatorManager<Textends ILookup>
A ModelManager<T> implementation that manages the visual decorations of selected elements in a canvas.
Remarks
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 ISelectionIndicatorInstaller implementation which will do the actual installation of the decoration in the canvas.
See GraphSelectionIndicatorManager for a specialized subclass for graph items that uses item styles for the visualization.
Type Parameters
- T: ILookup
- The type of the items in the collection and selection model.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.view.SelectionIndicatorManager
See Also
Constructors
Creates a new instance that for all selected items in the model dynamically installs a selection indicator visualization.
Remarks
If a new SelectionIndicatorManager<T> instance is set to a GraphComponent's selectionIndicatorManager property, the old instance is uninstalled and the new instance is installed automatically.
If a new SelectionIndicatorManager<T> instance is not set via the selectionIndicatorManager property, it is important that the model and selectionModel properties are set after instantiation. Also, make sure to call the install life-cycle method.
Properties
Gets the canvas instance this instance is managing.
Remarks
Defined in
Gets or sets whether this ModelManager<T> is enabled.
Remarks
If the manager is disabled, it will not install the ICanvasObjects into the associated CanvasComponent.
The default is true
, i.e. this manager is enabled by default.
Defined in
Gets or sets the model that describes the domain for the selection.
Gets or sets the selection model that determines which items are selected.
Remarks
null
, in which case no elements are considered selected.Methods
Installs an item and adds it to this managers set of managed items.
Remarks
Parameters
A map of options to pass to the method.
- item - T
- The item to add.
Returns
- ↪ICanvasObject
- The newly created canvas object or
null
if nothing was installed.
See Also
Defined in
Adds an item to the current selection.
Parameters
A map of options to pass to the method.
- item - T
- The item whose selection indicator will added.
Returns
- ↪ICanvasObject
- The newly created canvas object for the selection indicator or
null
if nothing was installed.
Called by installItem to retrieve the installer for a given item.
Remarks
Parameters
A map of options to pass to the method.
- item - T
- The item to find a canvas object group for.
Returns
- ↪ICanvasObjectGroup
- An ICanvasObjectGroup or
null
See Also
Implements
Called by installItem to retrieve the installer for a given item.
Remarks
Parameters
A map of options to pass to the method.
- item - T
- The item to find an installer for.
Returns
- ↪ICanvasObjectInstaller
- An installer or
null
See Also
Implements
Installs this instance in the given CanvasComponent instance.
Remarks
If this manager instance is set to a CanvasComponent instance using one of the properties focusIndicatorManager, selectionIndicatorManager, or highlightIndicatorManager, this method is called automatically.
In all other cases, this method must be called before using this manager instance.
Overriders must either call the base implementation or set the canvasComponent.
Parameters
A map of options to pass to the method.
- canvas - CanvasComponent
- The CanvasComponent instance to install this manager instance in.
Throws
- Exception({ name: 'ArgumentError' })
- if
canvas
isnull
.
Defined in
Installs a member of the collection into the canvas using the ICanvasObjectDescriptor which is returned by getInstaller.
Parameters
A map of options to pass to the method.
- item - T
- The member to install.
Returns
- ↪ICanvasObject
- The canvas object that has been returned by the installer.
Defined in
Called when this manager gets disabled.
Called when this manager gets enabled.
Uninstalls the provided item and removes it from this managers set of managed items.
Parameters
A map of options to pass to the method.
- item - T
- The item to remove.
See Also
Defined in
Uninstalls this instance from the given CanvasComponent instance.
Remarks
If this manager instance has been set to a CanvasComponent instance using one of the properties focusIndicatorManager, selectionIndicatorManager, or highlightIndicatorManager, this method is called automatically when the property value is changed.
In all other cases, this method must be called when this manager instance is not used anymore.
Overriders must either call the base implementation or set the canvasComponent to null
.
Parameters
A map of options to pass to the method.
- canvas - CanvasComponent
- The CanvasComponent to remove this manager instance from.
Defined in
Removes the given ICanvasObject.
Parameters
A map of options to pass to the method.
- canvasObject - ICanvasObject
- The canvas objects that have been associated with the descriptor.