|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.LayoutGraphCopyFactory
public class LayoutGraphCopyFactory
An implementation of the GraphCopier.CopyFactory
interface used by GraphCopier
that can be used by implementations of LayoutGraph
.
Nested Class Summary | |
---|---|
static class |
LayoutGraphCopyFactory.HierarchicGraphCopyFactory
An implementation of the copy factory interface used by GraphCopier
that can be used by implementations of LayoutGraph that are hierarchically grouped
using GroupingKeys . |
Constructor Summary | |
---|---|
LayoutGraphCopyFactory()
Creates a new LayoutGraphCopyFactory instance. |
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. |
protected EdgeLabelLayout |
copyEdgeLabelLayout(EdgeLabelLayout edgeLabelLayout)
Returns a copy of the given EdgeLabelLayout . |
protected void |
copyLabels(LayoutGraph originalLayoutGraph,
Edge originalEdge,
LayoutGraph targetGraph,
Edge edge)
Copies the labels for the given edge. |
protected void |
copyLabels(LayoutGraph originalLayoutGraph,
Node originalNode,
LayoutGraph targetGraph,
Node newNode)
Copies the labels for the given node. |
Node |
copyNode(Graph targetGraph,
Node originalNode)
Copies the originalNode from the source graph to the new targetGraph |
protected NodeLabelLayout |
copyNodeLabelLayout(NodeLabelLayout nodeLabelLayout)
Returns a copy of the given NodeLabelLayout . |
Graph |
createGraph()
Creates a new DefaultLayoutGraph . |
void |
postCopyGraphData(Graph originalGraph,
Graph newGraph,
java.util.Map nodeMap,
java.util.Map edgeMap)
Callback that will be called after the copy operation has completed. |
void |
preCopyGraphData(Graph originalGraph,
Graph newGraph)
Callback that will be called before the copy operation takes place. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LayoutGraphCopyFactory()
LayoutGraphCopyFactory
instance.
Method Detail |
---|
public Node copyNode(Graph targetGraph, Node originalNode)
GraphCopier.CopyFactory
originalNode
from the source graph to the new targetGraph
copyNode
in interface GraphCopier.CopyFactory
targetGraph
- the graph to create the new node inoriginalNode
- the original node from the source graph
protected void copyLabels(LayoutGraph originalLayoutGraph, Node originalNode, LayoutGraph targetGraph, Node newNode)
All labels that belong to the original node are copied to the new node including their layout information.
This implementation expects a DefaultLayoutGraph
otherwise it does nothing. The method is called by
copyNode(Graph, Node)
. It may be overridden to customize the copying of labels.
originalLayoutGraph
- the original graph that is copiedoriginalNode
- the original node whose labels are copiedtargetGraph
- the copy of the original graphnewNode
- the copy of the original nodeprotected NodeLabelLayout copyNodeLabelLayout(NodeLabelLayout nodeLabelLayout)
NodeLabelLayout
.
nodeLabelLayout
- the original layout information for a label
public Edge copyEdge(Graph targetGraph, Node newSource, Node newTarget, Edge originalEdge)
GraphCopier.CopyFactory
originalEdge
from the source graph to the new targetGraph
using the specified new source and target node in the target graph.
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 Graph createGraph()
DefaultLayoutGraph
.
createGraph
in interface GraphCopier.CopyFactory
protected void copyLabels(LayoutGraph originalLayoutGraph, Edge originalEdge, LayoutGraph targetGraph, Edge edge)
All labels that belong to the original edge are copied to the new edge including their layout information.
This implementation expects a DefaultLayoutGraph
otherwise it does nothing. The method is called by
copyNode(Graph, Node)
. It may be overridden to customize the copying of labels.
originalLayoutGraph
- the original graph that is copiedoriginalEdge
- the original edge whose labels are copiedtargetGraph
- the copy of the original graphedge
- the copy of the original edgeprotected EdgeLabelLayout copyEdgeLabelLayout(EdgeLabelLayout edgeLabelLayout)
EdgeLabelLayout
.
edgeLabelLayout
- the original layout information for a label
public void preCopyGraphData(Graph originalGraph, Graph newGraph)
GraphCopier.CopyFactory
preCopyGraphData
in interface GraphCopier.CopyFactory
originalGraph
- the graph that will be used to copy the entities from.newGraph
- the graph that will be used to copy the entities to.public void postCopyGraphData(Graph originalGraph, Graph newGraph, java.util.Map nodeMap, java.util.Map edgeMap)
GraphCopier.CopyFactory
postCopyGraphData
in interface GraphCopier.CopyFactory
originalGraph
- 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.
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |