SelectionAPI¶
Interface SelectionAPI
addToSelection(
nodeID: number | number[],
silent?: boolean,
): Promise<ChangeSelectionResult>;
clearSelection(silent?: boolean): Promise<ChangeSelectionResult>;
getSelectedLeafNodes(): number[];
getSelectedNodes(): number[];
getSelection(): Promise<number[]>;
invertSelection(silent?: boolean): Promise<ChangeSelectionResult>;
isSelected(nodeID: number): Promise<boolean>;
removeFromSelection(
nodeID: number | number[],
silent?: boolean,
): Promise<ChangeSelectionResult>;
selectCollection(
collectionID: number,
silent?: boolean,
): Promise<void | ChangeSelectionResult>;
setSelection(
nodeID: number | number[],
silent?: boolean,
): Promise<ChangeSelectionResult>;
}
Hierarchy (View Summary)
- SelectionAPI
Methods
add To Selection
- addToSelection(
nodeID: number | number[],
silent?: boolean,
): Promise<ChangeSelectionResult> Adds the given Nodes to the Selection.
Parameters
- nodeID: number | number[]
The ID of the Node that should be added to the current Selection
Optional
silent: booleanIf set to true, no event will be emitted.
Returns Promise<ChangeSelectionResult>
- nodeID: number | number[]
clear Selection
- clearSelection(silent?: boolean): Promise<ChangeSelectionResult>
Clears the current Selection.
Parameters
Optional
silent: booleanIf set to true, no event will be emitted.
Returns Promise<ChangeSelectionResult>
get Selected Leaf Nodes
get Selected Nodes
get Selection
- getSelection(): Promise<number[]>
Returns a list of all selected nodes.
Returns Promise<number[]>
An array which contains the IDs of all leaf Nodes in the current Selection.
Deprecated
getSelection is deprecated, please use getSelectedNodes instead.
invert Selection
- invertSelection(silent?: boolean): Promise<ChangeSelectionResult>
Inverts the current Selection.
Parameters
Optional
silent: booleanIf set to true, no event will be emitted.
Returns Promise<ChangeSelectionResult>
is Selected
remove From Selection
- removeFromSelection(
nodeID: number | number[],
silent?: boolean,
): Promise<ChangeSelectionResult> Removes the given nodes from the Selection
Parameters
- nodeID: number | number[]
The ID of the Node that should be removed from the current Selection
Optional
silent: booleanIf set to true, no event will be emitted.
Returns Promise<ChangeSelectionResult>
- nodeID: number | number[]
select Collection
- selectCollection(
collectionID: number,
silent?: boolean,
): Promise<void | ChangeSelectionResult> Replaces the current Selection with the Nodes from the given Collection.
Parameters
- collectionID: number
The ID of the Collection.
Optional
silent: booleanIf set to true, no event will be emitted.
Returns Promise<void | ChangeSelectionResult>
- collectionID: number
set Selection
- setSelection(
nodeID: number | number[],
silent?: boolean,
): Promise<ChangeSelectionResult> Replaces the current Selection with the specified nodes.
Parameters
- nodeID: number | number[]
The nodeID(s) to select.
Optional
silent: booleanIf set to true, no event will be emitted.
Returns Promise<ChangeSelectionResult>
- nodeID: number | number[]
The SelectionAPI provides basic functionalities to manipulate the current selection of Nodes.