|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.view.Graph2DCopyFactory.RecursiveGraph2DCopyFactory
public static class Graph2DCopyFactory.RecursiveGraph2DCopyFactory
A decorator for the a GraphCopier.CopyFactory
that recursively copies the contents
of folder nodes
and correctly
adjusts the inter-edge
state.
This factory can be used as follows:
GraphCopier.CopyFactory factory = graph.getGraphCopyFactory(); Graph2DCopyFactory.RecursiveGraph2DCopyFactory recursiveFactory = new Graph2DCopyFactory.RecursiveGraph2DCopyFactory(factory); GraphCopier copier = new GraphCopier(recursiveFactory); recursiveFactory.setFolderGraphCopier(copier); copier.copy(sourceGraph, sourceNodes, targetGraph);
copyRecursively(Graph2D, Graph2D)
Constructor Summary | |
---|---|
Graph2DCopyFactory.RecursiveGraph2DCopyFactory(GraphCopier.CopyFactory delegateFactory)
Creates a new instance that delegates the actual creation to a Graph2DCopyFactory . |
Method Summary | |
---|---|
protected void |
convertToInterEdge(Edge srcEdge,
HierarchyManager dstHierarchyManager,
Edge dstEdge,
Node newRealSource,
Node newRealTarget)
Callback method that is used after the contents have been copied recursively Converts the edge to an interEdge using the HierarchyManager.convertToInterEdge(y.base.Edge, y.base.Node, y.base.Node) method. |
Edge |
copyEdge(Graph targetGraph,
Node newSource,
Node newTarget,
Edge originalEdge)
Delegates to the wrapped factory. |
protected void |
copyFolderNodeContents(Node src,
HierarchyManager srcHierarchyManager,
Node dst,
HierarchyManager dstHierarchyManager)
Callback method that actually copies the contents of a folder node |
Node |
copyNode(Graph targetGraph,
Node originalNode)
Delegates to the wrapped factory. |
void |
copyRecursively(Graph2D sourceGraph,
Graph2D targetGraph)
Convenience method that creates a new GraphCopier , sets the copier as this
getFolderGraphCopier() and then calls GraphCopier.copy(y.base.Graph, y.base.Graph)
on it. |
Graph |
createGraph()
Delegates to the wrapped factory. |
protected GraphCopier |
getFoldedGraphCopier(Node src,
HierarchyManager srcHierarchyManager,
Node dst,
HierarchyManager dstHierarchyManager)
Obtains the copier to use for copying the folder node contents. |
GraphCopier |
getFolderGraphCopier()
Gets the copier to use for recursively copying the contents of the folder nodes. |
void |
postCopyGraphData(Graph src,
Graph newGraph,
java.util.Map nodeMap,
java.util.Map edgeMap)
Delegates to the wrapped factory and then recursively copies folder nodes contents |
void |
preCopyGraphData(Graph sourceGraph,
Graph targetGraph)
Delegates to the wrapped factory and performs initialization steps |
void |
setFolderGraphCopier(GraphCopier folderGraphCopier)
Sets the copier to use for recursively copying the contents of the folder nodes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Graph2DCopyFactory.RecursiveGraph2DCopyFactory(GraphCopier.CopyFactory delegateFactory)
Graph2DCopyFactory
.
Method Detail |
---|
public Edge copyEdge(Graph targetGraph, Node newSource, Node newTarget, Edge originalEdge)
copyEdge
in interface GraphCopier.CopyFactory
targetGraph
- the graph to create the new node innewSource
- the source node in the target graph to use for the newly created edgenewTarget
- the target node in the target graph to use for the newly created edgeoriginalEdge
- the original edge from the source graph
public Node copyNode(Graph targetGraph, Node originalNode)
copyNode
in interface GraphCopier.CopyFactory
targetGraph
- the graph to create the new node inoriginalNode
- the original node from the source graph
public void copyRecursively(Graph2D sourceGraph, Graph2D targetGraph)
GraphCopier
, sets the copier as this
getFolderGraphCopier()
and then calls GraphCopier.copy(y.base.Graph, y.base.Graph)
on it.
sourceGraph
- The graph to copytargetGraph
- The graph to copy into.public Graph createGraph()
createGraph
in interface GraphCopier.CopyFactory
public GraphCopier getFolderGraphCopier()
null
the folder contents will not be copied.
setFolderGraphCopier(y.util.GraphCopier)
public void setFolderGraphCopier(GraphCopier folderGraphCopier)
null
the folder contents will not be copied.
folderGraphCopier
- The copier to use for copying the folder node contents.getFolderGraphCopier()
public void postCopyGraphData(Graph src, Graph newGraph, java.util.Map nodeMap, java.util.Map edgeMap)
postCopyGraphData
in interface GraphCopier.CopyFactory
src
- the graph that was used to copy the entities from.newGraph
- 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.public void preCopyGraphData(Graph sourceGraph, Graph targetGraph)
preCopyGraphData
in interface GraphCopier.CopyFactory
sourceGraph
- the graph that will be used to copy the entities from.targetGraph
- the graph that will be used to copy the entities to.protected void convertToInterEdge(Edge srcEdge, HierarchyManager dstHierarchyManager, Edge dstEdge, Node newRealSource, Node newRealTarget)
HierarchyManager.convertToInterEdge(y.base.Edge, y.base.Node, y.base.Node)
method.
srcEdge
- The edge in the source Graph.dstHierarchyManager
- The hierarchy manager in the target graph.dstEdge
- The edge to convertnewRealSource
- The new real source.newRealTarget
- The new real target.protected void copyFolderNodeContents(Node src, HierarchyManager srcHierarchyManager, Node dst, HierarchyManager dstHierarchyManager)
src
- The original folder node in the source graph.srcHierarchyManager
- The hierarchy manager in the source graph.dst
- the target node to convert to a folder.dstHierarchyManager
- The hierarchy manager in the target graph.protected GraphCopier getFoldedGraphCopier(Node src, HierarchyManager srcHierarchyManager, Node dst, HierarchyManager dstHierarchyManager)
getFolderGraphCopier()
src
- The source folder nodesrcHierarchyManager
- The hierarchy manager of the source graph.dst
- The target folder nodedstHierarchyManager
- The hierarchy manager of the target graph.
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |