Remarks
See Also
Developer's Guide
Members
Constructors
Properties
Gets or sets the types of items that should be cloned for the copy operation.
Property Value
Gets or sets a property that determines whether additional folding states should be copied to target graphs.
true.With this property set to false the GraphCopier can be used to flatten a grouped graph, i.e. remove the grouping information.
The default is true.
Gets or sets the types of objects where the referential identity should be kept across clipboard operations.
For each of the types that are set via this property, this implementation will use a caching copy mechanism as follows: If there has already been an instance copied via this clipboard (getCopy), that instance will instead be returned, otherwise, this implementation will clone the original instance (depending on the setting of cloneTypes) and cache the copy until after the operation the cache is cleared. This feature is implemented directly by the various CopyXXX methods.
Let's say nodes n1 and n2 share the same style instance s1. Then its copies share the same style instance s2 which is, however, another reference than the original s1.
By default, this is enabled for all types.
Property Value
See Also
Methods
Adds a bend to the targetEdge in the targetGraph as a copy of the sourceBend.
targetEdge in the targetGraph as a copy of the sourceBend.Parameters
- context: ClipboardOperationContext
- The operation context to get, e.g., the targetGraph from.
- targetEdge: IEdge
- The target edge to add the bend to.
- sourceBend: IBend
- The source bend to copy the values from.
- offset: Point
- The offset to apply to the copied bend.
- index: number
- The index to add the bend at.
Return Value
- IBend
- The newly created bend or
nullif none is created.
Adds a label to the targetOwner in the targetGraph as a copy of the sourceLabel.
targetOwner in the targetGraph as a copy of the sourceLabel.Parameters
- context: ClipboardOperationContext
- The operation context to get, e.g., the targetGraph from.
- targetOwner: ILabelOwner
- The item owner in the target graph to add the label to.
- sourceLabel: ILabel
- The source label in the source graph.
Return Value
- ILabel
- The newly created label or
nullif none is created.
Adds a port to the targetOwner in the targetGraph as a copy of the sourcePort.
targetOwner in the targetGraph as a copy of the sourcePort.sourcePort. This implementation uses copyPortLocationParameter, copyPortStyle, and copyPortTag as callbacks.Parameters
- context: ClipboardOperationContext
- The operation context to get, e.g., the targetGraph from.
- targetOwner: IPortOwner
- The port owner in the target graph to add the port to.
- sourcePort: IPort
- The source port in the source graph.
Return Value
- IPort
- The newly created port or
nullif none is created.
Parameters
- original: T
- The original item.
- copy: T
- The copy of the item.
See Also
Clears the cache for the cached copies of the instance copied using this class.
itemCopiedCallback will be invoked.Parameters
- context: ClipboardOperationContext
- The information which items to copy.
- targetRootNode: INode
- The group node that should act as the root node for the pasted items. May be
nullif there is no such node. - offset?: Point
- The offset to apply to the copied items. Only nodes and bends will be offset explicitly, while other items will move implicitly.
- itemCopiedCallback?: function(IModelItem, IModelItem): void
- A delegate to invoke for each item being copied.
Throws
- Exception ({ name: 'ArgumentError' })
- if
targetRootNodeis not in targetGraph
Copies an IEdgeStyle instance.
Copies a ILabelModelParameter for a given label.
Parameters
- graph: IGraph
- The graph that contains the label.
- label: ILabel
- The label to copy the label model parameter from.
Return Value
- ILabelModelParameter
- The copy of the parameter to apply for the copy.
See Also
API
- copy
Copies an ILabelStyle instance.
Parameters
Return Value
- ILabelStyle
- The style to apply for the copy.
See Also
API
- copy
Copies an INodeStyle instance.
Copies a IPortLocationModelParameter for a given port.
Parameters
Return Value
- IPortLocationModelParameter
- The copy of the parameter to apply for the copy.
See Also
API
- copy
Copies an IPortStyle instance.
Callback that will copy a tag for the target graph.
tag if the cloneTypes property has the TAGS flag set. If this is not the case or the tag is not ICloneable, the instance will be returned.Parameters
- owner: IModelItem
- The old owner of the tag.
- tag: any
- The tag to copy.
Return Value
- any
- A copy of the tag.
Adds an edge to the targetGraph as a copy of the sourceEdge.
sourceEdge.sourceEdge, nor should it copy IPorts or ILabels. This implementation uses copyEdgeStyle and copyEdgeTag as callbacks.Parameters
- context: ClipboardOperationContext
- The operation context to get, e.g., the targetGraph from.
- sourceEdge: IEdge
- The edge in the source graph.
- targetSourcePort: IPort
- The new source port in the target graph.
- targetTargetPort: IPort
- The new target port in the target graph.
Return Value
- IEdge
- The newly created edge or
nullif none is created.
Creates a copy of the sourceGroupNode in the targetGraph.
sourceGroupNode in the targetGraph.Parameters
- context: ClipboardOperationContext
- The operation context to get, e.g. the targetGraph from.
- sourceGroupNode: INode
- The source node to create a copy of in the targetGraph.
- targetParent: INode
- The parent of the group node in the target graph.
- offset: Point
- The offset to apply to the copied node.
Return Value
- INode
- The newly created node or
nullif none is created.
Creates a copy of the sourceNode in the targetGraph.
sourceNode in the targetGraph.false. Otherwise, createNode and createGroupNode are called instead.Parameters
- context: ClipboardOperationContext
- The operation context to get, e.g., the targetGraph from.
- sourceNode: INode
- The source node to create a copy of in the targetGraph.
- offset: Point
- The offset to apply to the copied node.
Return Value
- INode
- The newly created node or
nullif none is created.
Creates a copy of the sourceNode in the targetGraph.
sourceNode in the targetGraph.Parameters
- context: ClipboardOperationContext
- The operation context to get, e.g. the targetGraph from.
- sourceNode: INode
- The source node to create a copy of in the targetGraph.
- targetParent: INode
- The parent of the group node in the target graph.
- offset: Point
- The offset to apply to the copied node.
Return Value
- INode
- The newly created node or
nullif none is created.
Tries to obtain a previously cached copy for the given original.
Parameters
- itemType: Constructor<T>
- The type of the item to copy.
- original: T
- The original item.
Return Value
- T
- The copy of
originalor NO_COPY if no copy has been found.
See Also
Either yields a previously cached copy for the given original or uses the copyDelegate to create the copy of the original.
copyDelegate to create the copy of the original.Parameters
- tType: Constructor<T>
- The type of the item to copy.
- original: T
- The original item.
- copyDelegate: function(T): T
- The copy delegate to create the copy.
Return Value
- T
- A copy of the original, either cached, or newly created and then cached.
Retrieves the FoldingManager from the given source graph.
Parameters
- sourceGraph: IGraph
- The source graph.
Return Value
- FoldingManager
- The folding manager as obtained from the lookup of the graph.
Retrieves the FoldingManager from the given target graph.
Parameters
- targetGraph: IGraph
- The target graph.
Return Value
- FoldingManager
- The folding manager as obtained from the lookup of the graph.
Parameters
Parameters
Parameters
Parameters
Parameters
Triggers the object-copied event.
Parameters
Events
Occurs after a bend has been copied.
This event is dispatched after the item copied callback has been executed.
If this GraphCopier instance is used as GraphClipboard's toClipboardCopier (Cut/Copy) and the source graph is a folding view graph the original item is a master item, i.e. it belongs to the masterGraph.
If this GraphCopier instance is used as GraphClipboard's fromClipboardCopier (Paste) and the target graph is a folding view graph the copied item is a master item, i.e. it belongs to the masterGraph.
For folding edge bends, their view state representation is passed. These items are neither part of the masterGraph nor the view graph.
Properties of
ItemCopiedEventArgs<IBend>- copy: T
- Gets the copied item.
- original: T
- Gets the original of the copied item.
See Also
Developer's Guide
Occurs after an edge has been copied.
This event is dispatched after the item copied callback has been executed.
If this GraphCopier instance is used as GraphClipboard's toClipboardCopier (Cut/Copy) and the source graph is a folding view graph the original item is a master item, i.e. it belongs to the masterGraph.
If this GraphCopier instance is used as GraphClipboard's fromClipboardCopier (Paste) and the target graph is a folding view graph the copied item is a master item, i.e. it belongs to the masterGraph.
Properties of
ItemCopiedEventArgs<IEdge>- copy: T
- Gets the copied item.
- original: T
- Gets the original of the copied item.
See Also
Developer's Guide
Occurs after the entire graph has been copied.
This event is dispatched at the end of the copy method.
If this GraphCopier instance is used as GraphClipboard's toClipboardCopier (Cut/Copy) and the source graph is a folding view graph the source graph item is the masterGraph of the folding view.
If this GraphCopier instance is used as GraphClipboard's fromClipboardCopier (Paste) and the target graph is a folding view graph the target graph is the masterGraph of the folding view.
Properties of
ItemCopiedEventArgs<IGraph>- copy: T
- Gets the copied item.
- original: T
- Gets the original of the copied item.
Occurs after a label has been copied.
This event is dispatched after the item copied callback has been executed.
If this GraphCopier instance is used as GraphClipboard's toClipboardCopier (Cut/Copy) and the source graph is a folding view graph the original item is a master item, i.e. it belongs to the masterGraph.
If this GraphCopier instance is used as GraphClipboard's fromClipboardCopier (Paste) and the target graph is a folding view graph the copied item is a master item, i.e. it belongs to the masterGraph.
For folding edge or helper node labels, their view state representation is passed. These items are neither part of the masterGraph nor the view graph.
Properties of
ItemCopiedEventArgs<ILabel>- copy: T
- Gets the copied item.
- original: T
- Gets the original of the copied item.
See Also
Developer's Guide
Occurs after a node has been copied.
This event is dispatched after the item copied callback has been executed.
If this GraphCopier instance is used as GraphClipboard's toClipboardCopier (Cut/Copy) and the source graph is a folding view graph the original item is a master item, i.e. it belongs to the masterGraph.
If this GraphCopier instance is used as GraphClipboard's fromClipboardCopier (Paste) and the target graph is a folding view graph the copied item is a master item, i.e. it belongs to the masterGraph.
Properties of
ItemCopiedEventArgs<INode>- copy: T
- Gets the copied item.
- original: T
- Gets the original of the copied item.
See Also
Developer's Guide
Occurs after a style or tag has been copied.
This event is triggered for all minor objects the graph items are made up of, e.g. the styles and tags.
This event will not be triggered for the graph items themselves and will not be triggered if the object reference is reused, i.e. it will only be triggered if the old and new references actually differ.
Properties of
ItemCopiedEventArgs<any>- copy: T
- Gets the copied item.
- original: T
- Gets the original of the copied item.
See Also
Developer's Guide
Occurs after a port has been copied.
This event is dispatched after the item copied callback has been executed.
If this GraphCopier instance is used as GraphClipboard's toClipboardCopier (Cut/Copy) and the source graph is a folding view graph the original item is a master item, i.e. it belongs to the masterGraph.
If this GraphCopier instance is used as GraphClipboard's fromClipboardCopier (Paste) and the target graph is a folding view graph the copied item is a master item, i.e. it belongs to the masterGraph.
Properties of
ItemCopiedEventArgs<IPort>- copy: T
- Gets the copied item.
- original: T
- Gets the original of the copied item.
See Also
Developer's Guide