Search this API

y.layout
Class LayoutGraphCopyFactory

java.lang.Object
  extended by y.layout.LayoutGraphCopyFactory
All Implemented Interfaces:
GraphCopier.CopyFactory

public class LayoutGraphCopyFactory
extends Object
implements GraphCopier.CopyFactory

An implementation of the copy factory 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()
           
 
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)
          Copies the edge label's layout.
protected  void copyLabels(LayoutGraph originalLayoutGraph, Edge originalEdge, LayoutGraph layoutGraph, Edge edge)
          Callback that copies the labels for a given edge.
protected  void copyLabels(LayoutGraph originalLayoutGraph, Node originalNode, LayoutGraph targetGraph, Node newNode)
          Callback that copies the labels for a given node.
 Node copyNode(Graph targetGraph, Node originalNode)
          Copies the originalNode from the source graph to the new targetGraph
protected  NodeLabelLayout copyNodeLabelLayout(NodeLabelLayout nodeLabelLayout)
          Copies the node label's layout.
 Graph createGraph()
          Creates a new DefaultLayoutGraph.
 void postCopyGraphData(Graph originalGraph, Graph newGraph, Map nodeMap, 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

LayoutGraphCopyFactory

public LayoutGraphCopyFactory()
Method Detail

copyNode

public Node copyNode(Graph targetGraph,
                     Node originalNode)
Description copied from interface: GraphCopier.CopyFactory
Copies the originalNode from the source graph to the new targetGraph

Specified by:
copyNode in interface GraphCopier.CopyFactory
Parameters:
targetGraph - the graph to create the new node in
originalNode - the original node from the source graph
Returns:
the newly created node

copyLabels

protected void copyLabels(LayoutGraph originalLayoutGraph,
                          Node originalNode,
                          LayoutGraph targetGraph,
                          Node newNode)
Callback that copies the labels for a given node.


copyNodeLabelLayout

protected NodeLabelLayout copyNodeLabelLayout(NodeLabelLayout nodeLabelLayout)
Copies the node label's layout.


copyEdge

public Edge copyEdge(Graph targetGraph,
                     Node newSource,
                     Node newTarget,
                     Edge originalEdge)
Description copied from interface: GraphCopier.CopyFactory
Copies the originalEdge from the source graph to the new targetGraph using the specified new source and target node in the target graph.

Specified by:
copyEdge in interface GraphCopier.CopyFactory
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

public Graph createGraph()
Creates a new DefaultLayoutGraph.

Specified by:
createGraph in interface GraphCopier.CopyFactory
Returns:
the graph to use as the target graph

copyLabels

protected void copyLabels(LayoutGraph originalLayoutGraph,
                          Edge originalEdge,
                          LayoutGraph layoutGraph,
                          Edge edge)
Callback that copies the labels for a given edge.


copyEdgeLabelLayout

protected EdgeLabelLayout copyEdgeLabelLayout(EdgeLabelLayout edgeLabelLayout)
Copies the edge label's layout.


preCopyGraphData

public void preCopyGraphData(Graph originalGraph,
                             Graph newGraph)
Description copied from interface: GraphCopier.CopyFactory
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.

Specified by:
preCopyGraphData in interface GraphCopier.CopyFactory
Parameters:
originalGraph - the graph that will be used to copy the entities from.
newGraph - the graph that will be used to copy the entities to.

postCopyGraphData

public void postCopyGraphData(Graph originalGraph,
                              Graph newGraph,
                              Map nodeMap,
                              Map edgeMap)
Description copied from interface: GraphCopier.CopyFactory
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.

Specified by:
postCopyGraphData in interface GraphCopier.CopyFactory
Parameters:
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-2013,
yWorks GmbH.
All rights reserved.