Clipboard implementation for IGraph instances.
Remarks
This implementation copies a given graph to an internally held clipboard graph. The clipboard graph can then be pasted to a target graph instance.
The clipboard can be configured to copy and paste items that depend on other items without copying the items it depends on, e.g. labels, ports, edges, and bends.
Also depending on the selection in the target graph, items can be pasted at multiple locations at once, e.g. a single label can be copied to the clipboard independently and pasted onto several selected target items.
Related Programming Samples
- Graph Editor
- Shows the graph editing features of the graph component.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.graph.GraphClipboard
See Also
Constructors
Creates a new initially empty clipboard.
Parameters
A map of options to pass to the method.
- pasteDelta - Point
A vector that will be used to move nodes and bends by after they have been pasted to the target graph. This option sets the pasteDelta property on the created object.
- toClipboardCopier - GraphCopier
The GraphCopier instance that will be used to copy the graph to the clipboard. This option sets the toClipboardCopier property on the created object.
- fromClipboardCopier - GraphCopier
The GraphCopier instance that will be used to copy the graph from the clipboard to the target graph. This option sets the fromClipboardCopier property on the created object.
- duplicateCopier - GraphCopier
The GraphCopier instance that will be used to duplicate elements inside the graph. This option sets the duplicateCopier property on the created object.
- idProvider - IClipboardIdProvider
The IClipboardIdProvider used by this instance to provide IDs for copied items. This option sets the idProvider property on the created object.
- clipboardGraph - IGraph
The graph that contains the clipboard's contents. This option sets the clipboardGraph property on the created object.
- parentNodeDetection - ParentNodeDetectionModes
Whether or not nodes should be automatically put into a group node and if so how this group will be determined. This option sets the parentNodeDetection property on the created object.
- dependentCopyItems - GraphItemTypes
The type of items that depend on other elements but should automatically be copied implicitly to the clipboard if all elements that it depends on are explicitly selected for copying. This option sets the dependentCopyItems property on the created object.
- independentCopyItems - GraphItemTypes
The type of items that can be copied and pasted independently of their owning element. This option sets the independentCopyItems property on the created object.
- copyItems - GraphItemTypes
The type of items that can be copied and pasted at all using the clipboard. This option sets the copyItems property on the created object.
- ignoreEdgesWithOneNode - boolean
Whether to paste edges whose source or target node was selected when copying to the clipboard while the other node was not. This option sets the ignoreEdgesWithOneNode property on the created object.
Properties
Gets the clipboard context for the current clipboard operation.
Remarks
Gets or sets the type of items that can be copied and pasted at all using the clipboard.
Remarks
If the corresponding element type is set in this property, items can be effectively copied.
If the corresponding element type is not set in this property, items will not be pasted, even if they have been explicitly selected. They may copied to the clipboard and become part of the clipboardGraph, nevertheless though, if they are required as dummy elements. But these elements will not be pasted to the target during paste or duplicate operations.
The default is ALL.
See Also
Gets or sets the type of items that depend on other elements but should automatically be copied implicitly to the clipboard if all elements that it depends on are explicitly selected for copying.
Remarks
Labels depend on their owner, like ports depend on their owner. Also bends of course depend on their owning edge.
If the corresponding element type is set in this property, items that depend on other items are implicitly included in the copy operation, if all of the items that they depend on are included recursively, even if they are not included explicitly themselves.
The default is ALL minus NODE, which means that selecting a number of nodes will automatically select all elements that directly and indirectly depend on the existence of this set of nodes will be copied to the clipboard, too.
Technically nodes do not depend on anything. Setting this property to a value that includes NODE will include all child nodes for every selected group node.
See Also
Gets or sets the GraphCopier instance that will be used to duplicate elements inside the graph.
Gets or sets the GraphCopier instance that will be used to copy the graph from the clipboard to the target graph.
Gets or sets the IClipboardIdProvider used by this instance to provide IDs for copied items.
Remarks
The default implementation simply uses a reference to the original item as ID.
Custom ID can be used to map between elements in different graphs.
Gets or sets the type of items that can be copied and pasted independently of their owning element.
Remarks
Labels depend on their owner, like ports depend on their owner. Also bends of course depend on their owning edge.
If the corresponding element type is set in this property, items can be copied alone to the clipboard and be pasted onto different owning elements.
This enables copying of a label to one or more owners, without having to copy the owner of the label. Also ports can be copied to other IPortOwners and bends to other edges.
The default is ALL which means that all elements can be copied to the clipboard even if the items that they depend on are not copied to the clipboard.
Technically owning elements are still part of the clipboard as dummy elements, but these elements will not be pasted to the target during paste or duplicate operations.
See Also
Gets or sets whether or not nodes should be automatically put into a group node and if so how this group will be determined.
Remarks
This property is used by getTargetNode to decide what node to yield as the target group node for the newly pasted node.
The default is SELECTION|PREVIOUS_PARENT.
See Also
Gets or sets a vector that will be used to move nodes and bends by after they have been pasted to the target graph.
See Also
Gets or sets the GraphCopier instance that will be used to copy the graph to the clipboard.
Methods
Copies the elements indicated by the filter to the clipboard graph.
Remarks
Parameters
A map of options to pass to the method.
- sourceGraph - IGraph
- The graph to copy the contents from.
- filter - function(IModelItem):boolean
- The filter to apply to the source graph's elements.
Signature Details
function(obj: IModelItem) : boolean
Represents the method that defines a set of criteria and determines whether the specified object meets those criteria.Parameters
- obj - IModelItem
- The object to compare against the criteria defined within the method represented by this delegate.
Returns
- boolean
true
if obj meets the criteria defined within the method represented by this delegate; otherwise,false
.
Creates the graph used for the clipboard.
Returns
- ↪IGraph
- A new readily configured DefaultGraph instance.
Creates a predicate that is based upon the outcome of the shouldCopy method that can be found in the lookup of the provided IModelItem.
Returns
- ↪function(IModelItem):boolean
- A predicate that uses shouldCopy.
Signature Details
function(obj: IModelItem) : boolean
Represents the method that defines a set of criteria and determines whether the specified object meets those criteria.Parameters
- obj - IModelItem
- The object to compare against the criteria defined within the method represented by this delegate.
Returns
- boolean
true
if obj meets the criteria defined within the method represented by this delegate; otherwise,false
.
See Also
Creates a predicate that is based upon the outcome of the shouldCut method that can be found in the lookup of the provided IModelItem.
Returns
- ↪function(IModelItem):boolean
- A predicate that uses shouldCut.
Signature Details
function(obj: IModelItem) : boolean
Represents the method that defines a set of criteria and determines whether the specified object meets those criteria.Parameters
- obj - IModelItem
- The object to compare against the criteria defined within the method represented by this delegate.
Returns
- boolean
true
if obj meets the criteria defined within the method represented by this delegate; otherwise,false
.
See Also
Creates a predicate that is based upon the outcome of the shouldPaste method that can be found in the lookup of the provided IModelItem.
Returns
- ↪function(IModelItem):boolean
- A predicate that uses shouldPaste.
Signature Details
function(obj: IModelItem) : boolean
Represents the method that defines a set of criteria and determines whether the specified object meets those criteria.Parameters
- obj - IModelItem
- The object to compare against the criteria defined within the method represented by this delegate.
Returns
- boolean
true
if obj meets the criteria defined within the method represented by this delegate; otherwise,false
.
See Also
Factory method that creates the context for the upcoming calls to the IClipboardHelper methods.
Parameters
A map of options to pass to the method.
- sourceGraph - IGraph
- The source graph of the operation.
- targetGraph - IGraph
- The target graph of the operation.
Returns
- ↪IGraphClipboardContext
- A context that has the properties configured according to the parameters.
Creates the default IClipboardIdProvider used by this instance to provide IDs for copied items.
Remarks
The default implementation simply uses a reference to the original item as ID.
Custom ID can be used to map between elements in different graphs.
Creates a predicate for use in the onCopy method.
Remarks
false
for the item itself or any item this item depends on, then the item will not be copied. Items without such a predicate are handled solely according to their selection state.Parameters
A map of options to pass to the method.
- selection - IGraphSelection
- The selection model to base the filter on.
- graph - IGraph
- The graph to use for determining adjacency.
Returns
- ↪function(IModelItem):boolean
- A predicate that filters subgraph induced by the selection of nodes and restricted by an optional shouldCopy predicate.
Signature Details
function(obj: IModelItem) : boolean
Represents the method that defines a set of criteria and determines whether the specified object meets those criteria.Parameters
- obj - IModelItem
- The object to compare against the criteria defined within the method represented by this delegate.
Returns
- boolean
true
if obj meets the criteria defined within the method represented by this delegate; otherwise,false
.
See Also
Creates a predicate for use in the cut method.
Remarks
false
for the item itself or any item this item depends on, then the item will not be cut. Items without such a predicate are handled solely according to their selection state.Parameters
A map of options to pass to the method.
- selection - IGraphSelection
- The selection model to base the filter on.
- graph - IGraph
- The graph to use for determining adjacency.
Returns
- ↪function(IModelItem):boolean
- A predicate that filters subgraph induced by the selection of nodes and restricted by an optional shouldCut predicate.
Signature Details
function(obj: IModelItem) : boolean
Represents the method that defines a set of criteria and determines whether the specified object meets those criteria.Parameters
- obj - IModelItem
- The object to compare against the criteria defined within the method represented by this delegate.
Returns
- boolean
true
if obj meets the criteria defined within the method represented by this delegate; otherwise,false
.
See Also
createDefaultDuplicateFilter
(selection: IGraphSelection, graph: IGraph) : function(IModelItem):booleanCreates a predicate for use in the duplicate method.
Remarks
false
for the item itself or any item this item depends on, then the item will not be copied. Items without such a predicate are handled solely according to their selection state.Parameters
A map of options to pass to the method.
- selection - IGraphSelection
- The selection model to base the filter on.
- graph - IGraph
- The graph to use for determining adjacency.
Returns
- ↪function(IModelItem):boolean
- A predicate that filters subgraph induced by the selection of nodes and restricted by an optional shouldCopy predicate.
Signature Details
function(obj: IModelItem) : boolean
Represents the method that defines a set of criteria and determines whether the specified object meets those criteria.Parameters
- obj - IModelItem
- The object to compare against the criteria defined within the method represented by this delegate.
Returns
- boolean
true
if obj meets the criteria defined within the method represented by this delegate; otherwise,false
.
See Also
Factory method that creates the duplicateCopier.
Returns
- ↪GraphCopier
- A new GraphCopier instance.
Factory method that creates the fromClipboardCopier.
Returns
- ↪GraphCopier
- A new GraphCopier instance.
Creates a predicate for use in the cut and onCopy methods.
Remarks
false
.Parameters
A map of options to pass to the method.
- selection - IGraphSelection
- The selection model to base the filter on.
- graph - IGraph
- The graph to use for determining adjacency.
Returns
- ↪function(IModelItem):boolean
- A predicate that filters subgraph induced by the selection of nodes.
Signature Details
function(obj: IModelItem) : boolean
Represents the method that defines a set of criteria and determines whether the specified object meets those criteria.Parameters
- obj - IModelItem
- The object to compare against the criteria defined within the method represented by this delegate.
Returns
- boolean
true
if obj meets the criteria defined within the method represented by this delegate; otherwise,false
.
Factory method that creates the toClipboardCopier.
Returns
- ↪GraphCopier
- A new GraphCopier instance.
Cuts the items indicated by filter
to the clipboard and removes them from the graph.
Remarks
Parameters
A map of options to pass to the method.
- sourceGraph - IGraph
- The graph to cut the items from.
- filter - function(IModelItem):boolean
- The filter to use.
Signature Details
function(obj: IModelItem) : boolean
Represents the method that defines a set of criteria and determines whether the specified object meets those criteria.Parameters
- obj - IModelItem
- The object to compare against the criteria defined within the method represented by this delegate.
Returns
- boolean
true
if obj meets the criteria defined within the method represented by this delegate; otherwise,false
.
See Also
duplicate
(context: IInputModeContext, sourceGraph: IGraph, filter: function(IModelItem):boolean, elementDuplicated?: function(IModelItem, IModelItem):void)Duplicates the elements indicated by the filter.
Remarks
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The current IInputModeContext.
- sourceGraph - IGraph
- The graph whose elements should be duplicated.
- filter - function(IModelItem):boolean
- A predicate which returns
true
for elements which should be duplicated.Signature Details
function(obj: IModelItem) : boolean
Represents the method that defines a set of criteria and determines whether the specified object meets those criteria.Parameters
- obj - IModelItem
- The object to compare against the criteria defined within the method represented by this delegate.
Returns
- boolean
true
if obj meets the criteria defined within the method represented by this delegate; otherwise,false
.
- elementDuplicated - function(IModelItem, IModelItem):void
- An element copied callback which gets invoked for each element which has been duplicated. The two parameters passed into the callback are guaranteed to be part of the
sourceGraph
.Signature Details
function(original: IModelItem, copy: IModelItem)
Callback delegate used by GraphCopier and the like.Parameters
- original - IModelItem
- The element that has been copied.
- copy - IModelItem
- The copy of the original element.
Retrieves the IClipboardHelper instance associated with the given item.
Remarks
Parameters
A map of options to pass to the method.
- item - IModelItem
- The item to find the clipboard helper for.
Returns
- ↪IClipboardHelper
- An instance or
null
.
Gets a folding state of an edge for a given FoldingEdgeStateId.
Remarks
Parameters
A map of options to pass to the method.
- edge - IEdge
- The edge to get the folding state for.
- id - FoldingEdgeStateId
- The original FoldingEdgeStateId to get the folding state for. Passing
null
will return the folding state which was visible when the edge was copied into the clipboard.
Returns
- ↪IEdge
- The folding state which is mapped to the given
id
. May benull
.
Returns the ID which is linked with the given clipboard item.
Remarks
clipboardItem
has been copied.Parameters
A map of options to pass to the method.
- clipboardItem - IModelItem
- An IModelItem which lives in the clipboard graph.
Returns
- ↪any
- The IModelItem which lives in the original graph. The ID which represents the item from which
clipboardItem
has originally been copied into the clipboard. idProvider's getItem can be used to retrieve the original item. Note that both, the returned ID as well as the item returned by getItem might benull
.
Examples
getLabelLayoutParameter
(copier: GraphCopier, graph: IGraph, label: ILabel, newOwner: ILabelOwner) : ILabelModelParameterGets a ILabelModelParameter for the given label
to be placed at the given newOwner
.
Remarks
Parameters
A map of options to pass to the method.
- copier - GraphCopier
- The GraphCopier whose copyLabelLayoutParameter method can be used to copy the existing parameter.
- graph - IGraph
- label - ILabel
- The label to be copied.
- newOwner - ILabelOwner
- The new owner for the label.
Returns
- ↪ILabelModelParameter
- An ILabelModelParameter for the copied label.
Retrieves the memento associated with an item in the clipboard graph that has been stored with the item during onElementCopied and onElementCut.
Parameters
A map of options to pass to the method.
- clipboardItem - IModelItem
- The item in the clipboard graph.
Returns
- ↪any
- The object returned by the IClipboardHelper methods or
null
.
getPortLocationParameter
(copier: GraphCopier, graph: IGraph, originalPort: IPort, newOwner: IPortOwner) : IPortLocationModelParameterGets a IPortLocationModelParameter for the given originalPort
to be placed at the given newOwner
.
Remarks
Parameters
A map of options to pass to the method.
- copier - GraphCopier
- The GraphCopier whose copyPortLocationParameter method can be used to copy the existing parameter.
- graph - IGraph
- originalPort - IPort
- The port to be copied.
- newOwner - IPortOwner
- The new owner for the port.
Returns
- ↪IPortLocationModelParameter
- An IPortLocationModelParameter for the copied port.
Provides an IEdge where the given clipboardBend
can be added to.
Remarks
null
if no target for the given clipboardBend
is found. In this case the bend will not be copied.Parameters
A map of options to pass to the method.
- clipboardBend - IBend
- The bend to be copied from the clipboardGraph.
Returns
See Also
Provides an ILabelOwner where the given clipboardLabel
can be added to.
Remarks
null
if no target for the given clipboardLabel
is found. In this case the label will not be copied.Parameters
A map of options to pass to the method.
- clipboardLabel - ILabel
- The label to be copied from the clipboardGraph.
Returns
- ↪ILabelOwner
- An ILabelOwner for the label to be added to or
null
if the label should not be copied.
Examples
See Also
Provides a parent group node for the given clipboardNode
.
Remarks
null
if the given node should be placed at the root or if the graph is not grouped.Parameters
A map of options to pass to the method.
- clipboardNode - INode
- The node to be copied from the clipboardGraph.
Returns
- ↪INode
- The new parent group of the node or
null
if the node should be placed at the root of the hierarchy or if the graph is not grouped.
See Also
Provides an IPort where the given clipboardEdge
can be added to.
Remarks
null
if no target for the given clipboardEdge
is found. In this case the edge will not be copied.Parameters
A map of options to pass to the method.
- clipboardEdge - IEdge
- The edge to be copied from the clipboardGraph.
- atSource - boolean
- Whether to look for a source port.
Returns
See Also
Provides an IPortOwner where the given clipboardPort
can be added to.
Remarks
null
if no target for the given clipboardPort
is found. In this case the port will not be copied.Parameters
A map of options to pass to the method.
- clipboardPort - IPort
- The port to be copied from the clipboardGraph.
Returns
- ↪IPortOwner
- An IPortOwner for the port to be added to or
null
if the port should not be copied.
See Also
Whether the given item
is a "dummy" item which should not be pasted.
Remarks
Parameters
A map of options to pass to the method.
- item - IModelItem
- The item to test.
Returns
- ↪boolean
true
if the item is a "dummy" item.
onCopy
(sourceGraph: IGraph, filter: function(IModelItem):boolean, targetGraph: IGraph, targetRootNode: INode, elementCopiedCallback: function(IModelItem, IModelItem):void)Calls copy on the current toClipboardCopier instance or fromClipboardCopier instance, depending on whether the targetGraph
is the clipboardGraph instance.
Parameters
A map of options to pass to the method.
- sourceGraph - IGraph
- The source graph to pass to copy
- filter - function(IModelItem):boolean
- The predicate to pass on.
Signature Details
function(obj: IModelItem) : boolean
Represents the method that defines a set of criteria and determines whether the specified object meets those criteria.Parameters
- obj - IModelItem
- The object to compare against the criteria defined within the method represented by this delegate.
Returns
- boolean
true
if obj meets the criteria defined within the method represented by this delegate; otherwise,false
.
- targetGraph - IGraph
- The target graph to pass on.
- targetRootNode - INode
- The node to use as the root node in the grouped
targetGraph
. - elementCopiedCallback - function(IModelItem, IModelItem):void
- The delegate to pass on. For each element that is copied during the operation to the clipboard, this callback will be passed the original and the copy of the item. In case the
sourceGraph
is a folding view graph both elements are passed as master elements or folding state elements if a master element does not exist.Signature Details
function(original: IModelItem, copy: IModelItem)
Callback delegate used by GraphCopier and the like.Parameters
- original - IModelItem
- The element that has been copied.
- copy - IModelItem
- The copy of the original element.
A callback that will be invoked for each item that has been copied into the clipboard graph in response to a onCopy operation.
Remarks
Parameters
A map of options to pass to the method.
- original - IModelItem
- The original element from the source graph instance. If the source graph is a managed folding view, this is always a master item.
- copy - IModelItem
- The copy from the clipboard graph.
A callback function that will be invoked for each item that has been copied into the clipboard graph in response to a cut operation.
Remarks
Parameters
A map of options to pass to the method.
- original - IModelItem
- The original element from the source graph instance. If the source graph is a managed folding view, this is always a master item.
- copy - IModelItem
- The copy from the clipboard graph.
A callback function that will be invoked for each item that has been pasted into the target graph in response to a pasteAndSelect operation.
Remarks
Parameters
A map of options to pass to the method.
- original - IModelItem
- The original element from the clipboard graph instance. If the target graph is a managed folding view, this is always a master item.
- copy - IModelItem
- The copy from the target graph.
onPaste
(sourceGraph: IGraph, filter: function(IModelItem):boolean, targetGraph: IGraph, targetRootNode: INode, elementCopiedCallback: function(IModelItem, IModelItem):void, targetFilter: function(IModelItem):boolean)Calls copy on the current fromClipboardCopier instance, depending on whether the targetGraph
is the clipboardGraph instance.
Parameters
A map of options to pass to the method.
- sourceGraph - IGraph
- The source graph to pass to copy
- filter - function(IModelItem):boolean
- The predicate to pass on.
Signature Details
function(obj: IModelItem) : boolean
Represents the method that defines a set of criteria and determines whether the specified object meets those criteria.Parameters
- obj - IModelItem
- The object to compare against the criteria defined within the method represented by this delegate.
Returns
- boolean
true
if obj meets the criteria defined within the method represented by this delegate; otherwise,false
.
- targetGraph - IGraph
- The target graph to pass on.
- targetRootNode - INode
- The node to use as the root node in the grouped
targetGraph
. - elementCopiedCallback - function(IModelItem, IModelItem):void
- The delegate to pass on. For each element that is copied during the operation to the clipboard, this callback will be passed the original and the copy of the item. In case the
targetGraph
is a folding view graph the original element is passed as master elements or folding state elements if a master element does not exist. The copied element is always part of thetargetGraph
.Signature Details
function(original: IModelItem, copy: IModelItem)
Callback delegate used by GraphCopier and the like.Parameters
- original - IModelItem
- The element that has been copied.
- copy - IModelItem
- The copy of the original element.
- targetFilter - function(IModelItem):boolean
- This predicate is used to determine which INodes and IEdges can be used as targets for paste operations, e.g. if a labels or ports are copied without their owners. If
null
all model items can be used as targets.Signature Details
function(obj: IModelItem) : boolean
Represents the method that defines a set of criteria and determines whether the specified object meets those criteria.Parameters
- obj - IModelItem
- The object to compare against the criteria defined within the method represented by this delegate.
Returns
- boolean
true
if obj meets the criteria defined within the method represented by this delegate; otherwise,false
.
paste
(targetGraph: IGraph, filter?: function(IModelItem):boolean, elementPasted?: function(IModelItem, IModelItem):void, targetFilter?: function(IModelItem):boolean, context?: IInputModeContext)Pastes the contents from the clipboardGraph to the targetGraph
after applying a filter
.
Remarks
elementPasted
delegate will be invoked and the onElementPasted method will be called. The actual work of this method is delegated to the fromClipboardCopier's copy method. Providing a valid targetFilter
allows for pasting ILabels, IPorts, and IEdges without valid owners.Parameters
A map of options to pass to the method.
- targetGraph - IGraph
- The graph to paste the contents in.
- filter - function(IModelItem):boolean
- The filter to apply to the clipboard graph.
Signature Details
function(obj: IModelItem) : boolean
Represents the method that defines a set of criteria and determines whether the specified object meets those criteria.Parameters
- obj - IModelItem
- The object to compare against the criteria defined within the method represented by this delegate.
Returns
- boolean
true
if obj meets the criteria defined within the method represented by this delegate; otherwise,false
.
- elementPasted - function(IModelItem, IModelItem):void
- The callback to use for each element that has been pasted. For each element that is copied during the operation to the clipboard, this callback will be passed the original and the copy of the item. In case the
targetGraph
is a folding view graph the original element is passed as master elements or folding state elements if a master element does not exist. The copied element is always part of thetargetGraph
.Signature Details
function(original: IModelItem, copy: IModelItem)
Callback delegate used by GraphCopier and the like.Parameters
- original - IModelItem
- The element that has been copied.
- copy - IModelItem
- The copy of the original element.
- targetFilter - function(IModelItem):boolean
- A filter which returns
true
for model items which can be used as target for clipboard items which need an owner (e.g. ILabels which were copied without their owner). Ifnull
all model items can be used as targets.Signature Details
function(obj: IModelItem) : boolean
Represents the method that defines a set of criteria and determines whether the specified object meets those criteria.Parameters
- obj - IModelItem
- The object to compare against the criteria defined within the method represented by this delegate.
Returns
- boolean
true
if obj meets the criteria defined within the method represented by this delegate; otherwise,false
.
- context - IInputModeContext
- A valid input mode context. Passing a valid input mode context is required for keeping orthogonal edges at group nodes whose size might be adjusted after the paste operation.
Pastes the clipboardGraph's contents into the targetGraph
, selecting all pasted elements.
Remarks
Parameters
A map of options to pass to the method.
- targetGraph - IGraph
- The graph to paste into.
- selection - IGraphSelection
- The selection model to set the selection on.
Removes elements from the graph based on a predicate.
Parameters
A map of options to pass to the method.
- sourceGraph - IGraph
- The graph to remove elements from.
- predicate - function(IModelItem):boolean
- The predicate that decides which elements to remove.
Signature Details
function(obj: IModelItem) : boolean
Represents the method that defines a set of criteria and determines whether the specified object meets those criteria.Parameters
- obj - IModelItem
- The object to compare against the criteria defined within the method represented by this delegate.
Returns
- boolean
true
if obj meets the criteria defined within the method represented by this delegate; otherwise,false
.
See Also
Events
Static Methods
createWrappedFilter
(coreFilter: function(IModelItem):boolean, graph: IGraph, restrictive: boolean) : function(IModelItem):booleanCreates an induced predicate from coreFilter
for use in the cut and onCopy methods that takes dependent items into account.
Remarks
This method can create a predicate for only a core set of items which is then extended or restricted depending on the predicate values of graph item dependencies.
The restrictive
parameter determines whether the result restricts or extends the set of elements handled by coreFilter
:
- If
restrictive
isfalse
, an item is allowed if eithercoreFilter
returnstrue
for itself or if all items it depends on (e.g. label/port owner, source/target port etc.) are allowed bycoreFilter
. - If
restrictive
istrue
, an item is forbidden if eithercoreFilter
returnsfalse
for itself or if any item it depends on (e.g. label/port owner, source/target port etc.) is forbidden bycoreFilter
.
Parameters
A map of options to pass to the method.
- coreFilter - function(IModelItem):boolean
- The core predicate for the base set of elements.
Signature Details
function(obj: IModelItem) : boolean
Represents the method that defines a set of criteria and determines whether the specified object meets those criteria.Parameters
- obj - IModelItem
- The object to compare against the criteria defined within the method represented by this delegate.
Returns
- boolean
true
if obj meets the criteria defined within the method represented by this delegate; otherwise,false
.
- graph - IGraph
- The graph to use for determining adjacency.
- restrictive - boolean
- Whether to create a restriction or extension for the
coreFilter
predicate
Whether the given item
exists in a folding state of its owner
.
Parameters
A map of options to pass to the method.
- owner - IModelItem
- The owner of the given item.
- item - IModelItem
Returns
- ↪boolean
true
if the given item exists in a folding state.