public class GraphCopier
extends java.lang.Object
graphs.
After a graph was copied, the copier can be queried for the mappings of input
nodes to output nodes and input edges to output edges.
A copier is a stateful utility.| Constructor and Description |
|---|
GraphCopier(org.eclipse.gef.common.attributes.IAttributeCopier attributeCopier)
Creates a new
GraphCopier instance with the given
IAttributeCopier. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
clearInputToOutputMaps()
Discard any data that was tracked in previous copy operations.
|
Graph |
copy(Graph graph)
Creates a copy of the given
Graph. |
protected void |
copyAttributes(org.eclipse.gef.common.attributes.IAttributeStore inputStore,
org.eclipse.gef.common.attributes.IAttributeStore outputStore)
|
protected Edge |
copyEdge(Edge edge)
Creates a copy of the given edge.
|
protected void |
copyEdges(Graph graph,
Graph outputGraph)
Copies all the edges of the given graph into the output graph.
|
protected Graph |
copyGraph(Graph graph)
Copies the given
Graph using the current IAttributeCopier. |
protected Node |
copyNode(Node node)
Creates a copy of the given node.
|
protected void |
copyNodes(Graph graph,
Graph outputGraph)
Copies all the nodes of the given graph into the output graph.
|
org.eclipse.gef.common.attributes.IAttributeCopier |
getAttributeCopier()
Returns the
IAttributeCopier used by this GraphCopier. |
java.util.Map<Edge,Edge> |
getInputToOutputEdgeMap()
|
java.util.Map<Node,Node> |
getInputToOutputNodeMap()
|
protected void |
trackCopiedEdge(Edge inputEdge,
Edge outputEdge)
Maintains a mapping from the input edge to the output edge.
|
protected void |
trackCopiedNode(Node inputNode,
Node outputNode)
Maintains a mapping from the input node to the output node.
|
public GraphCopier(org.eclipse.gef.common.attributes.IAttributeCopier attributeCopier)
GraphCopier instance with the given
IAttributeCopier.protected void clearInputToOutputMaps()
public Graph copy(Graph graph)
Graph.graph - The Graph to copy.protected void copyAttributes(org.eclipse.gef.common.attributes.IAttributeStore inputStore,
org.eclipse.gef.common.attributes.IAttributeStore outputStore)
protected Edge copyEdge(Edge edge)
edge - The Edge to copy.Edge with transferred relations and (copied)
attributes.protected void copyEdges(Graph graph, Graph outputGraph)
graph - The input Graph to copy.outputGraph - The output Graph.protected Graph copyGraph(Graph graph)
Graph using the current IAttributeCopier.
Records the copied nodes in the getInputToOutputNodeMap() and the
copied edges in the getInputToOutputEdgeMap().protected Node copyNode(Node node)
node - The Node to copy.protected void copyNodes(Graph graph, Graph outputGraph)
graph - The input Graph to copy.outputGraph - The output Graph.public org.eclipse.gef.common.attributes.IAttributeCopier getAttributeCopier()
IAttributeCopier used by this GraphCopier.IAttributeCopier used by this GraphCopier.protected void trackCopiedEdge(Edge inputEdge, Edge outputEdge)
inputEdge - the input edge.outputEdge - the output edge.Copyright (c) 2014 itemis AG and others. All rights reserved.