Package org.eclipse.gef.graph
Class GraphCopier
java.lang.Object
org.eclipse.gef.graph.GraphCopier
A copier for 
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 SummaryConstructorsConstructorDescriptionGraphCopier(org.eclipse.gef.common.attributes.IAttributeCopier attributeCopier) Creates a newGraphCopierinstance with the givenIAttributeCopier.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidDiscard any data that was tracked in previous copy operations.Creates a copy of the givenGraph.protected voidcopyAttributes(org.eclipse.gef.common.attributes.IAttributeStore inputStore, org.eclipse.gef.common.attributes.IAttributeStore outputStore) protected EdgeCreates a copy of the given edge.protected voidCopies all the edges of the given graph into the output graph.protected GraphCopies the givenGraphusing the currentIAttributeCopier.protected NodeCreates a copy of the given node.protected voidCopies all the nodes of the given graph into the output graph.org.eclipse.gef.common.attributes.IAttributeCopierReturns theIAttributeCopierused by thisGraphCopier.protected voidtrackCopiedEdge(Edge inputEdge, Edge outputEdge) Maintains a mapping from the input edge to the output edge.protected voidtrackCopiedNode(Node inputNode, Node outputNode) Maintains a mapping from the input node to the output node.
- 
Constructor Details- 
GraphCopierpublic GraphCopier(org.eclipse.gef.common.attributes.IAttributeCopier attributeCopier) Creates a newGraphCopierinstance with the givenIAttributeCopier.
 
- 
- 
Method Details- 
clearInputToOutputMapsprotected void clearInputToOutputMaps()Discard any data that was tracked in previous copy operations.- Since:
- 5.1
 
- 
copyCreates a copy of the givenGraph.- Parameters:
- graph- The Graph to copy.
- Returns:
- A new graph that is the result of the copy operation.
 
- 
copyAttributesprotected void copyAttributes(org.eclipse.gef.common.attributes.IAttributeStore inputStore, org.eclipse.gef.common.attributes.IAttributeStore outputStore) 
- 
copyEdgeCreates a copy of the given edge.- Parameters:
- edge- The Edge to copy.
- Returns:
- A new Edgewith transferred relations and (copied) attributes.
 
- 
copyEdgesCopies all the edges of the given graph into the output graph.- Parameters:
- graph- The input- Graphto copy.
- outputGraph- The output Graph.
- Since:
- 5.1
 
- 
copyGraphCopies the givenGraphusing the currentIAttributeCopier. Records the copied nodes in thegetInputToOutputNodeMap()and the copied edges in thegetInputToOutputEdgeMap().
- 
copyNodeCreates a copy of the given node.- Parameters:
- node- The- Nodeto copy.
- Returns:
- A new Node with transferred relations and (copied) attributes.
 
- 
copyNodesCopies all the nodes of the given graph into the output graph.- Parameters:
- graph- The input- Graphto copy.
- outputGraph- The output Graph.
- Since:
- 5.1
 
- 
getAttributeCopierpublic org.eclipse.gef.common.attributes.IAttributeCopier getAttributeCopier()Returns theIAttributeCopierused by thisGraphCopier.- Returns:
- The IAttributeCopierused by thisGraphCopier.
 
- 
getInputToOutputEdgeMap
- 
getInputToOutputNodeMap
- 
trackCopiedEdgeMaintains a mapping from the input edge to the output edge.- Parameters:
- inputEdge- the input edge.
- outputEdge- the output edge.
- Since:
- 5.1
 
- 
trackCopiedNodeMaintains a mapping from the input node to the output node.- Parameters:
- inputNode- the input node.
- outputNode- the output node.
- Since:
- 5.1
 
 
-