Search this API

y.util
Interface GraphCopier.CopyFactory

All Known Implementing Classes:
Graph2DCopyFactory, Graph2DCopyFactory.HierarchicGraph2DCopyFactory, Graph2DCopyFactory.RecursiveGraph2DCopyFactory, GraphCopier.DataProviderCopyFactory, GraphCopier.EdgeDataProviderCopyFactory, GraphCopier.EdgeMapCopyFactory, GraphCopier.GraphDataCopyFactory, GraphCopier.ItemDataProviderCopyFactory, GraphCopier.NodeDataProviderCopyFactory, GraphCopier.NodeMapCopyFactory, GraphCopyFactory, LayoutGraphCopyFactory, LayoutGraphCopyFactory.HierarchicGraphCopyFactory
Enclosing class:
GraphCopier

public static interface GraphCopier.CopyFactory

The copy factory interface used by GraphCopier to delegate the actual work to.

 
Your browser does not support SVG content.

Method Summary
 Edge copyEdge(Graph targetGraph, Node newSource, Node newTarget, Edge originalEdge)
          Copies the originalEdge from the source graph to the new targetGraph using the specified new source and target node in the target graph.
 Node copyNode(Graph targetGraph, Node originalNode)
          Copies the originalNode from the source graph to the new targetGraph
 Graph createGraph()
          Creates a new graph instance that will be the target graph of the copy operation.
 void postCopyGraphData(Graph sourceGraph, Graph targetGraph, java.util.Map nodeMap, java.util.Map edgeMap)
          Callback that will be called after the copy operation has completed.
 void preCopyGraphData(Graph sourceGraph, Graph targetGraph)
          Callback that will be called before the copy operation takes place.
 

Method Detail

copyNode

Node copyNode(Graph targetGraph,
              Node originalNode)
Copies the originalNode from the source graph to the new targetGraph

Parameters:
targetGraph - the graph to create the new node in
originalNode - the original node from the source graph
Returns:
the newly created node

copyEdge

Edge copyEdge(Graph targetGraph,
              Node newSource,
              Node newTarget,
              Edge originalEdge)
Copies the originalEdge from the source graph to the new targetGraph using the specified new source and target node in the target graph.

Parameters:
targetGraph - the graph to create the new node in
newSource - the source node in the target graph to use for the newly created edge
newTarget - the target node in the target graph to use for the newly created edge
originalEdge - the original edge from the source graph
Returns:
the newly created edge

createGraph

Graph createGraph()
Creates a new graph instance that will be the target graph of the copy operation. This method is called if no target graph is specified by the user.

Returns:
the graph to use as the target graph

preCopyGraphData

void preCopyGraphData(Graph sourceGraph,
                      Graph targetGraph)
Callback that will be called before the copy operation takes place. At that point in time no entities have been copied to the new graph.

Parameters:
sourceGraph - the graph that will be used to copy the entities from.
targetGraph - the graph that will be used to copy the entities to.

postCopyGraphData

void postCopyGraphData(Graph sourceGraph,
                       Graph targetGraph,
                       java.util.Map nodeMap,
                       java.util.Map edgeMap)
Callback that will be called after the copy operation has completed. At that point in time all entities have been copied to the new graph.

Parameters:
sourceGraph - the graph that was used to copy the entities from.
targetGraph - the graph that was used to copy the entities to.
nodeMap - a map that contains a mapping between the nodes in the source graph to their corresponding nodes in the new graph.
edgeMap - a map that contains a mapping between the edges in the source graph to their corresponding edges in the new graph.

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.