V
- the type of the verticesE
- the type of the edgespublic class DefaultGraphTransferProtocol<V extends Vertex,E extends Edge> extends GraphTransferProtocol<V,E>
GraphTransferProtocol
that makes it possible to transfer a graph of one graph view to another
or to the same.
// create the GTP final DefaultGraphTransferProtocol<Vertex, Edge> gtp = new DefaultGraphTransferProtocol<Vertex, Edge>(myGraphView); // change the type of the graph to a mixed graph myGraphView.setGraph(new Graph(Type.MIXED)); // afterwards transfer the data of the old graph (e.g. a simple undirected graph) to the mixed graph myGraphView.transferGraph(gtp);
GraphTransferProtocol.TransferData
Constructor and Description |
---|
DefaultGraphTransferProtocol(GraphView<V,E> graphView)
Creates a new default graph transfer protocol.
|
Modifier and Type | Method and Description |
---|---|
protected void |
applyTransferData(GraphView.VisualEdge edge,
GraphTransferProtocol.TransferData data)
Applies a given transfer data to a visual edge.
|
protected void |
applyTransferData(GraphView.VisualVertex vertex,
GraphTransferProtocol.TransferData data)
Applies a given transfer data to a visual vertex.
|
protected GraphTransferProtocol.TransferData |
getTransferData(E edge)
Gets the transfer data for a given edge.
|
protected GraphTransferProtocol.TransferData |
getTransferData(V vertex)
Gets the transfer data for a given vertex.
|
getGraph
public DefaultGraphTransferProtocol(GraphView<V,E> graphView) throws java.lang.NullPointerException
graphView
- the graph view its graph should be transferedjava.lang.NullPointerException
- protected GraphTransferProtocol.TransferData getTransferData(V vertex)
GraphTransferProtocol
getTransferData
in class GraphTransferProtocol<V extends Vertex,E extends Edge>
vertex
- a vertex of the graphnull
if the object should not be transferedprotected GraphTransferProtocol.TransferData getTransferData(E edge)
GraphTransferProtocol
getTransferData
in class GraphTransferProtocol<V extends Vertex,E extends Edge>
edge
- an edge of the graphnull
if the object should not be transferedprotected void applyTransferData(GraphView.VisualVertex vertex, GraphTransferProtocol.TransferData data)
GraphTransferProtocol
applyTransferData
in class GraphTransferProtocol<V extends Vertex,E extends Edge>
vertex
- the vertexdata
- the transfer dataprotected void applyTransferData(GraphView.VisualEdge edge, GraphTransferProtocol.TransferData data)
GraphTransferProtocol
applyTransferData
in class GraphTransferProtocol<V extends Vertex,E extends Edge>
edge
- the edgedata
- the transfer data