HighlightIndicatorManager<T extends ILookup>
A ModelManager<T> implementation that manages the visual decorations of highlighted elements in a canvas.
Remarks
For each item in the domain that should be highlighted, this class uses the ILookup mechanism of the items to loo kup an IHighlightRenderer<T> implementation which will render the decoration in the canvas.
If a new HighlightIndicatorManager<T> instance is not set via the highlightIndicatorManager property, it is important to set the domain and items properties after instantiation. Also, make sure to call the install life-cycle method.
The default implementation of the renderer is using the yfiles-highlight-template
CSS class and possibly one of the following CSS classes depending on the item type: yfiles-node-highlight-template
, yfiles-edge-highlight-template
, yfiles-label-highlight-template
, yfiles-port-highlight-template
.
Related Reading in the Developer's Guide
Type Parameters
- T: ILookup
- The type of the items.
Type Details
- yFiles module
- view
See Also
Constructors
Creates a new instance.
Remarks
If a new HighlightIndicatorManager<T> instance of this is set to a GraphComponent's highlightIndicatorManager property, the old instance is uninstalled and the new instance is installed automatically.
If a new HighlightIndicatorManager<T> instance is not set via the highlightIndicatorManager property, it is important to call the install life-cycle method.
Properties
Gets the canvas instance this instance is managing.
Remarks
Defined in
Gets or sets the model that describes the domain for the highlight.
Remarks
Gets or sets whether this ModelManager<T> is enabled.
Remarks
If the manager is disabled, it will not install the IRenderTreeElements into the associated CanvasComponent.
The default is true
, i.e. this manager is enabled by default.
Property Value
true
if enabled; false
otherwise.Defined in
Gets or sets the item collection that determines which items are highlighted.
Methods
Installs an item and adds it to this manager's set of managed items.
Remarks
false
, the item will not be installed.Parameters
A map of options to pass to the method.
- item - T
- The item to add.
Returns
- ↪IRenderTreeElement?
- The newly created render tree element or
null
if nothing was installed.
Defined in
Called by installItem to retrieve the renderer for a given item.
Remarks
Parameters
A map of options to pass to the method.
- item - T
- The item to find a renderer for.
Returns
- ↪IObjectRenderer<T>?
- A renderer or
null
Implements
Called by installItem to retrieve the render tree group for a given item.
Remarks
Parameters
A map of options to pass to the method.
- item - T
- The item to find a render tree group for.
Returns
- ↪IRenderTreeGroup?
- An IRenderTreeGroup or
null
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.
- canvasComponent - CanvasComponent
- The CanvasComponent instance to install this manager instance in.
Throws
- Exception({ name: 'ArgumentError' })
- if
canvasComponent
isnull
.
Overrides
Installs a member of the collection into the canvas using the IObjectRenderer<T> which is returned by getRenderer.
Parameters
A map of options to pass to the method.
- item - T
- The member to install.
Returns
- ↪IRenderTreeElement?
- The new render tree element or
null
if the item was not installed.
Defined in
Called when this manager gets disabled.
Implements
Called when this manager gets enabled.
Implements
Uninstalls the provided item and removes it from this manager's set of managed items.
Parameters
A map of options to pass to the method.
- item - T
- The item to remove.
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.
- canvasComponent - CanvasComponent
- The CanvasComponent to remove this manager instance from.
Overrides
Removes the given IRenderTreeElement.
Parameters
A map of options to pass to the method.
- renderTreeElement - IRenderTreeElement
- The render tree element that has been associated with the renderer.