C

SelectionIndicatorManager<T>

A ModelManager<T> implementation that manages the visual decorations of selected elements in a canvas.
Inheritance Hierarchy

Remarks

For each item in the domain that is marked as selected by the items, this class uses the ILookup mechanism of the items to look up an ISelectionRenderer<T> implementation which will render the decoration in the canvas.

The default implementation of the renderer is using the yfiles-selection-template CSS class and possibly one of the following CSS classes depending on the item type: yfiles-node-selection-template, yfiles-edge-selection-template, yfiles-label-selection-template, yfiles-port-selection-template.

Type Parameters

T

The type of the items in the collection and selection model.

See Also

An overview of the different CSS styling options is presented in detail in the section Using CSS Styling for the Indicators .

API

SelectionIndicatorManager, FocusIndicatorManager, HighlightIndicatorManager

Members

Show:

Constructors

Creates a new instance that for all selected items in the model dynamically installs a selection indicator visualization.

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 to set the domain and items properties after instantiation. Also, make sure to call the install life-cycle method.

Properties

Gets the canvas instance this instance is managing.
The canvas must be set to a non-null value in install and set back to null in uninstall.
final
Gets or sets the model that describes the domain for the selection.
Only items contained in this model are rendered as selected.
final

See Also

Developer's Guide
Gets or sets whether this ModelManager<T> is enabled.

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.

final

Property Value

true if enabled; false otherwise.
Gets or sets the selection model that determines which items are selected.
final

Methods

Installs an item and adds it to this manager's set of managed items.
If enabled is set to false, the item will not be installed.
protected

Parameters

item: T
The item to add.

Return Value

IRenderTreeElement
The newly created render tree element or null if nothing was installed.

See Also

Developer's Guide
Called by installItem to retrieve the renderer for a given item.
This implementation uses the lookup of the item to retrieve an ISelectionRenderer<T> instance.
protected

Parameters

item: T
The item to find a renderer for.

Return Value

IObjectRenderer<T>
A renderer or null

See Also

Developer's Guide
Called by installItem to retrieve the render tree group for a given item.
This implementation always returns the selectionGroup of the renderTree of the canvasComponent of this instance.
protected

Parameters

item: T
The item to find a render tree group for.

Return Value

IRenderTreeGroup
An IRenderTreeGroup or null

See Also

Developer's Guide
Installs this instance in the given CanvasComponent instance.

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

canvasComponent: CanvasComponent
The CanvasComponent instance to install this manager instance in.
Installs a member of the collection into the canvas using the IObjectRenderer<T> which is returned by getRenderer.
protected

Parameters

item: T
The member to install.

Return Value

IRenderTreeElement
The new render tree element or null if the item was not installed.
Called when this manager gets disabled.
protected
Called when this manager gets enabled.
protected
Uninstalls the provided item and removes it from this manager's set of managed items.
protected

Parameters

item: T
The item to remove.

See Also

Developer's Guide
Uninstalls this instance from the given CanvasComponent instance.

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

canvasComponent: CanvasComponent
The CanvasComponent to remove this manager instance from.
Removes the given IRenderTreeElement.
protected

Parameters

renderTreeElement: IRenderTreeElement
The render tree element that has been associated with the renderer.

See Also

API
remove