Packagecom.yworks.graph.model
Classpublic class GraphCopier

Utility class that copies parts of an IGraph to another instance.

Instances of this class can be used in GraphClipboard, e.g.



Public Properties
 PropertyDefined by
  copyGrouping : Boolean
Determines whether grouping information should be copied to IGroupedGraph target graphs.
GraphCopier
Public Methods
 MethodDefined by
  
copy(sourceGraph:IGraph, filter:Function, targetGraph:IGraph, elementCopiedDelegate:Function):void
Copies a subgraph described by a predicate function from the sourceGraph to the targetGraph.
GraphCopier
  
Copies an IEdgeStyle instance.
GraphCopier
  
Copies a ILabelModelParameter for a given label.
GraphCopier
  
Copies an ILabelStyle instance.
GraphCopier
  
Copies an INodeStyle instance.
GraphCopier
  
Copies an IPortStyle instance.
GraphCopier
Property detail
copyGroupingproperty
copyGrouping:Boolean  [read-write]

Determines whether grouping information should be copied to IGroupedGraph target graphs.

The default value is true.

Implementation
    public function get copyGrouping():Boolean
    public function set copyGrouping(value:Boolean):void
Method detail
copy()method
public function copy(sourceGraph:IGraph, filter:Function, targetGraph:IGraph, elementCopiedDelegate:Function):void

Copies a subgraph described by a predicate function from the sourceGraph to the targetGraph.

Parameters
sourceGraph:IGraph — The graph to copy the elements from.
 
filter:Function — The filter that decides which elements to copy: a function which takes a IModelItem as parameter and returns true if the item should be copied.
 
targetGraph:IGraph — The graph to copy the elements to.
 
elementCopiedDelegate:Function — A delegate to invoke for each element being copied.
copyEdgeStyle()method 
public function copyEdgeStyle(graph:IGraph, edge:IEdge):IEdgeStyle

Copies an IEdgeStyle instance.

This implementation uses the ICloneable.clone() method to create the copy.

Parameters
graph:IGraph — The graph that contains the edge.
 
edge:IEdge — The edge to copy the style from.

Returns
IEdgeStyle — The style to apply for the copy.

See also

copyLabelModelParameter()method 
public function copyLabelModelParameter(graph:IGraph, label:ILabel):ILabelModelParameter

Copies a ILabelModelParameter for a given label.

This implementation uses the ICloneable.Clone method to create a copy.

Parameters
graph:IGraph — The graph that contains the label.
 
label:ILabel — The label to copy the label model parameter from.

Returns
ILabelModelParameter — The copy of the parameter to apply for the copy.

See also

copyLabelStyle()method 
public function copyLabelStyle(graph:IGraph, label:ILabel):ILabelStyle

Copies an ILabelStyle instance.

This implementation uses the ICloneable.clone() method to create a copy.

Parameters
graph:IGraph — The graph that contains the label.
 
label:ILabel — The label to copy the style from.

Returns
ILabelStyle — The style to apply for the copy.

See also

copyNodeStyle()method 
public function copyNodeStyle(graph:IGraph, node:INode):INodeStyle

Copies an INodeStyle instance.

This implementation uses the ICloneable.clone() method to create a copy. Parameters

graph:IGraph — The graph that contains the node.
 
node:INode — The node to copy the style from.

Returns
INodeStyle — The style to apply for the copy.

See also

copyPortStyle()method 
public function copyPortStyle(graph:IGraph, port:IPort):IPortStyle

Copies an IPortStyle instance.

This implementation uses the ICloneable.clone() method to create a copy.

Parameters
graph:IGraph — The graph that contains the port.
 
port:IPort — The port to copy the style from.

Returns
IPortStyle — The style to apply for the copy.

See also