public class JgraphtBackendImpl<V,E extends Edge<V>> extends org.jgrapht.graph.DefaultListenableGraph<V,E> implements GraphBackend<V,E>
Modifier and Type | Method and Description |
---|---|
boolean |
addEdgeInBackend(E edge)
Add an edge in the JGraphT Graph
|
boolean |
addNodeInBackend(V vertex)
Add a vertex in the JGraphT graph
|
boolean |
containsEdge(V from,
V to) |
boolean |
containsNode(V vertex) |
void |
damage(Object o)
Declare an object visual setting change
|
EdgeViewInfo<V,E> |
ensureEdgeViewInfo(E edge)
Get raw view information for an edge, create it if needed.
|
Collection<E> |
getEdges() |
EdgeViewInfo<V,E> |
getEdgeViewInfo(E edge)
Get raw view information for an edge.
|
V |
getExistingNode(V node) |
static GraphBackend |
getGraphBackend(Graph graph) |
Collection<E> |
getIncomingEdges(V vertex) |
V |
getNodeByName(String id)
Give access to the vertex named with the given name
|
int |
getNodeCount() |
Collection<V> |
getNodes() |
NodeViewInfo |
getNodeViewInfo(V vertex)
Get the Raw view info for a node.
|
Collection<E> |
getOutgoingEdges(V vertex) |
List<E> |
getShortestPath(V source,
V target)
Find the shortest path between the two given vertices
|
List<Set<V>> |
getStronglyConnectedComponents()
Return a list of set of vertex, each set containing a strongly connected component of the graph
|
boolean |
removeNode(V node)
remove a node from the JgraphT graph
|
void |
repaint()
Trigger a repaint of the damaged areas
|
void |
setDefaultEdgeStyle(EdgeStyle<V,E> style) |
void |
setViewListener(GraphViewListener l) |
addEdge, addEdge, addGraphListener, addVertex, addVertexSetListener, clone, fireEdgeAdded, fireEdgeRemoved, fireEdgeWeightUpdated, fireVertexAdded, fireVertexRemoved, isReuseEvents, removeEdge, removeEdge, removeGraphListener, removeVertex, removeVertexSetListener, setEdgeWeight, setReuseEvents
addVertex, containsEdge, containsVertex, degreeOf, edgeSet, edgesOf, getAllEdges, getDelegate, getEdge, getEdgeFactory, getEdgeSource, getEdgeSupplier, getEdgeTarget, getEdgeWeight, getType, getVertexSupplier, incomingEdgesOf, inDegreeOf, outDegreeOf, outgoingEdgesOf, toString, vertexSet
assertVertexExist, equals, hashCode, removeAllEdges, removeAllEdges, removeAllEdges, removeAllVertices, toStringFromSets
finalize, getClass, notify, notifyAll, wait, wait, wait
getEdge, removeEdge
addVertex, containsEdge, containsVertex, degreeOf, edgeSet, edgesOf, getAllEdges, getEdge, getEdgeFactory, getEdgeSource, getEdgeSupplier, getEdgeTarget, getEdgeWeight, getType, getVertexSupplier, incomingEdgesOf, inDegreeOf, outDegreeOf, outgoingEdgesOf, removeAllEdges, removeAllEdges, removeAllVertices, vertexSet
public static GraphBackend getGraphBackend(Graph graph)
public boolean addEdgeInBackend(E edge)
addEdgeInBackend
in interface GraphBackend<V,E extends Edge<V>>
edge
- public boolean addNodeInBackend(V vertex)
addNodeInBackend
in interface GraphBackend<V,E extends Edge<V>>
vertex
- public boolean removeNode(V node)
removeNode
in interface GraphBackend<V,E extends Edge<V>>
node
- the node to removepublic int getNodeCount()
getNodeCount
in interface GraphBackend<V,E extends Edge<V>>
public Collection<E> getEdges()
public Collection<V> getNodes()
public V getNodeByName(String id)
getNodeByName
in interface GraphBackend<V,E extends Edge<V>>
id
- name of a vertexpublic Collection<E> getIncomingEdges(V vertex)
getIncomingEdges
in interface GraphBackend<V,E extends Edge<V>>
public Collection<E> getOutgoingEdges(V vertex)
getOutgoingEdges
in interface GraphBackend<V,E extends Edge<V>>
public NodeViewInfo getNodeViewInfo(V vertex)
GraphBackend
getNodeViewInfo
in interface GraphBackend<V,E extends Edge<V>>
public boolean containsNode(V vertex)
containsNode
in interface GraphBackend<V,E extends Edge<V>>
vertex
- public V getExistingNode(V node)
getExistingNode
in interface GraphBackend<V,E extends Edge<V>>
public boolean containsEdge(V from, V to)
containsEdge
in interface GraphBackend<V,E extends Edge<V>>
containsEdge
in interface org.jgrapht.Graph<V,E extends Edge<V>>
containsEdge
in class org.jgrapht.graph.AbstractGraph<V,E extends Edge<V>>
from
- to
- public List<E> getShortestPath(V source, V target)
getShortestPath
in interface GraphBackend<V,E extends Edge<V>>
source
- the vertex at the beginning of the searched pathtarget
- the vertex at the end of the searched pathpublic List<Set<V>> getStronglyConnectedComponents()
getStronglyConnectedComponents
in interface GraphBackend<V,E extends Edge<V>>
public void damage(Object o)
GraphBackend
public void repaint()
GraphBackend
public void setViewListener(GraphViewListener l)
setViewListener
in interface GraphBackend<V,E extends Edge<V>>
public EdgeViewInfo<V,E> getEdgeViewInfo(E edge)
GraphBackend
getEdgeViewInfo
in interface GraphBackend<V,E extends Edge<V>>
public EdgeViewInfo<V,E> ensureEdgeViewInfo(E edge)
GraphBackend
ensureEdgeViewInfo
in interface GraphBackend<V,E extends Edge<V>>
public void setDefaultEdgeStyle(EdgeStyle<V,E> style)
setDefaultEdgeStyle
in interface GraphBackend<V,E extends Edge<V>>
Copyright © 2005–2020. All rights reserved.