Class FilteringVisualGraph<V extends VisualVertex,E extends VisualEdge<V>>
- Type Parameters:
V- the vertex typeE- the edge type
- All Implemented Interfaces:
edu.uci.ics.jung.graph.DirectedGraph<V,,E> edu.uci.ics.jung.graph.Graph<V,,E> edu.uci.ics.jung.graph.Hypergraph<V,,E> GDirectedGraph<V,,E> GImplicitDirectedGraph<V,,E> VisualGraph<V,,E> Serializable
- As vertices are filtered, so to will be their edges
- If additions are made to the graph while it is filtered, the new additions will not be added to the current graph, but will be kept in the background for later restoring
Implementation Note: this class engages in some odd behavior when removals and additions are need to this graph. A distinction is made between events that are generated from external clients and those that happen due to filtering and restoring. This distinction allows this class to know when to update this graph, based upon whether or not data has been filtered. Implementation of this is achieved by using a flag. Currently, this flag is thread-safe. If this graph is to be multi-threaded (such as if changes are to be made by multiple threads, then this update flag will have to be revisited to ensure thread visibility.
- See Also:
-
Field Summary
Fields inherited from class ghidra.graph.graphs.DefaultVisualGraph
focusedVertexFields inherited from class edu.uci.ics.jung.graph.DirectedSparseGraph
edges, verticesFields inherited from class edu.uci.ics.jung.graph.AbstractTypedGraph
edge_type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd an edgebooleanbooleanaddEdge(E e, edu.uci.ics.jung.graph.util.Pair<? extends V> endpoints, edu.uci.ics.jung.graph.util.EdgeType type) booleanaddEdge(E e, Collection<? extends V> edgeVertices) booleanaddEdge(E e, Collection<? extends V> edgeVertices, edu.uci.ics.jung.graph.util.EdgeType type) booleanbooleanbooleanAdd a vertexvoidvoiddispose()voidfilterEdges(Collection<E> toFilter) voidfilterVertices(Collection<V> toFilter) getAllEdges(Set<V> sourceVertices) Returns all edges connected to the given vertices.getAllReachableVertices(Set<V> sourceVertices) Returns all vertices that are reachable by the given vertices.booleanbooleanremoveEdge(E e) Removes an edgevoidremoveEdges(Iterable<E> toRemove) Removes the given edges from the graphbooleanremoveVertex(V v) Remove a vertexvoidremoveVertices(Iterable<V> verticesToRemove) Removes the given vertices from the graphvoidunfilterEdges(Collection<E> toUnfilter) Restores the given filtered edges into the graph.voidunfilterVertices(Collection<V> toUnfilter) Restores the given filtered vertices into the graph.Methods inherited from class ghidra.graph.graphs.DefaultVisualGraph
addGraphChangeListener, clearSelectedVertices, copy, fireEdgesAdded, fireEdgesRemoved, fireVerticesAdded, fireVerticesRemoved, getAllEdges, getEdges, getFocusedVertex, getSelectedVertices, initializeLocation, removeGraphChangeListener, setSelectedVertices, setVertexFocused, vertexLocationChanged, verticesAdded, verticesRemovedMethods inherited from class ghidra.graph.jung.JungDirectedGraph
containsEdge, emptyCopy, isEmptyMethods inherited from class edu.uci.ics.jung.graph.DirectedSparseGraph
containsEdge, containsVertex, findEdge, findEdgeSet, getDest, getEdgeCount, getEdges, getEndpoints, getFactory, getIncidentEdges, getIncoming_internal, getInEdges, getNeighbors, getOutEdges, getOutgoing_internal, getPredecessors, getPreds_internal, getSource, getSuccessors, getSuccs_internal, getVertexCount, getVertices, isDest, isSourceMethods inherited from class edu.uci.ics.jung.graph.AbstractTypedGraph
getDefaultEdgeType, getEdgeCount, getEdges, getEdgeType, hasEqualEdgeType, validateEdgeTypeMethods inherited from class edu.uci.ics.jung.graph.AbstractGraph
degree, getIncidentCount, getIncidentVertices, getNeighborCount, getOpposite, getPredecessorCount, getSuccessorCount, getValidatedEndpoints, inDegree, isIncident, isNeighbor, isPredecessor, isSuccessor, outDegree, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ghidra.graph.GDirectedGraph
containsEdge, containsEdge, containsVertex, emptyCopy, findEdge, getEdgeCount, getEdges, getIncidentEdges, getInEdges, getOutEdges, getPredecessors, getSuccessors, getVertexCount, getVertices, isEmptyMethods inherited from interface edu.uci.ics.jung.graph.Graph
getOpposite, getPredecessorCount, getSuccessorCount, inDegree, isPredecessor, isSuccessor, outDegreeMethods inherited from interface edu.uci.ics.jung.graph.Hypergraph
degree, getDefaultEdgeType, getEdgeCount, getEdges, getEdgeType, getIncidentCount, getIncidentVertices, getNeighborCount, isIncident, isNeighborMethods inherited from interface ghidra.graph.VisualGraph
getLayout
-
Constructor Details
-
FilteringVisualGraph
public FilteringVisualGraph()
-
-
Method Details
-
filterVertices
-
filterEdges
-
unfilterVertices
Restores the given filtered vertices into the graph. This will only happen if both endpoints are in the graph.- Parameters:
toUnfilter- the edges to restore
-
unfilterEdges
Restores the given filtered edges into the graph. This will only happen if both endpoints are in the graph.- Parameters:
toUnfilter- the edges to restore
-
getAllVertices
-
getAllEdges
-
getFilteredVertices
-
getFilteredEdges
-
getUnfilteredVertices
-
getUnfilteredEdges
-
isFiltered
public boolean isFiltered() -
clearFilter
public void clearFilter() -
getAllReachableVertices
Returns all vertices that are reachable by the given vertices.This method is needed if you wish to find relationships that have been filtered out.
- Parameters:
sourceVertices- the vertices for which to find the other reachable vertices- Returns:
- the reachable vertices
-
getAllEdges
Returns all edges connected to the given vertices.This method is needed if you wish to find relationships that have been filtered out.
- Parameters:
sourceVertices- the vertices for which to get the edges- Returns:
- the reachable edges
-
removeVertex
Description copied from interface:GDirectedGraphRemove a vertex- Specified by:
removeVertexin interfaceGDirectedGraph<V extends VisualVertex,E extends VisualEdge<V>> - Specified by:
removeVertexin interfaceedu.uci.ics.jung.graph.Hypergraph<V extends VisualVertex,E extends VisualEdge<V>> - Overrides:
removeVertexin classDefaultVisualGraph<V extends VisualVertex,E extends VisualEdge<V>> - Parameters:
v- the vertex- Returns:
- true
-
removeVertices
Description copied from interface:GDirectedGraphRemoves the given vertices from the graph- Specified by:
removeVerticesin interfaceGDirectedGraph<V extends VisualVertex,E extends VisualEdge<V>> - Overrides:
removeVerticesin classDefaultVisualGraph<V extends VisualVertex,E extends VisualEdge<V>> - Parameters:
verticesToRemove- the vertices to remove
-
removeEdge
Description copied from interface:GDirectedGraphRemoves an edge- Specified by:
removeEdgein interfaceGDirectedGraph<V extends VisualVertex,E extends VisualEdge<V>> - Specified by:
removeEdgein interfaceedu.uci.ics.jung.graph.Hypergraph<V extends VisualVertex,E extends VisualEdge<V>> - Overrides:
removeEdgein classDefaultVisualGraph<V extends VisualVertex,E extends VisualEdge<V>> - Parameters:
e- the edge- Returns:
- true if the graph contained the given edge
-
removeEdges
Description copied from interface:GDirectedGraphRemoves the given edges from the graph- Specified by:
removeEdgesin interfaceGDirectedGraph<V extends VisualVertex,E extends VisualEdge<V>> - Overrides:
removeEdgesin classJungDirectedGraph<V extends VisualVertex,E extends VisualEdge<V>> - Parameters:
toRemove- the edges to remove
-
addVertex
Description copied from interface:GDirectedGraphAdd a vertex- Specified by:
addVertexin interfaceGDirectedGraph<V extends VisualVertex,E extends VisualEdge<V>> - Specified by:
addVertexin interfaceedu.uci.ics.jung.graph.Hypergraph<V extends VisualVertex,E extends VisualEdge<V>> - Overrides:
addVertexin classDefaultVisualGraph<V extends VisualVertex,E extends VisualEdge<V>> - Parameters:
v- the vertex- Returns:
- true if the add was successful, false otherwise
-
addEdge
Description copied from interface:GDirectedGraphAdd an edge- Specified by:
addEdgein interfaceGDirectedGraph<V extends VisualVertex,E extends VisualEdge<V>> - Overrides:
addEdgein classJungDirectedGraph<V extends VisualVertex,E extends VisualEdge<V>> - Parameters:
e- the edge
-
addEdge
public boolean addEdge(E e, edu.uci.ics.jung.graph.util.Pair<? extends V> endpoints, edu.uci.ics.jung.graph.util.EdgeType type) - Overrides:
addEdgein classDefaultVisualGraph<V extends VisualVertex,E extends VisualEdge<V>>
-
addEdge
- Specified by:
addEdgein interfaceedu.uci.ics.jung.graph.Hypergraph<V extends VisualVertex,E extends VisualEdge<V>> - Overrides:
addEdgein classedu.uci.ics.jung.graph.AbstractGraph<V extends VisualVertex,E extends VisualEdge<V>>
-
addEdge
public boolean addEdge(E e, Collection<? extends V> edgeVertices, edu.uci.ics.jung.graph.util.EdgeType type) - Specified by:
addEdgein interfaceedu.uci.ics.jung.graph.Hypergraph<V extends VisualVertex,E extends VisualEdge<V>> - Overrides:
addEdgein classedu.uci.ics.jung.graph.AbstractGraph<V extends VisualVertex,E extends VisualEdge<V>>
-
addEdge
- Specified by:
addEdgein interfaceedu.uci.ics.jung.graph.Graph<V extends VisualVertex,E extends VisualEdge<V>> - Overrides:
addEdgein classedu.uci.ics.jung.graph.AbstractGraph<V extends VisualVertex,E extends VisualEdge<V>>
-
addEdge
- Specified by:
addEdgein interfaceedu.uci.ics.jung.graph.Graph<V extends VisualVertex,E extends VisualEdge<V>> - Overrides:
addEdgein classedu.uci.ics.jung.graph.AbstractGraph<V extends VisualVertex,E extends VisualEdge<V>>
-
addEdge
- Overrides:
addEdgein classedu.uci.ics.jung.graph.AbstractGraph<V extends VisualVertex,E extends VisualEdge<V>>
-
dispose
public void dispose()- Overrides:
disposein classDefaultVisualGraph<V extends VisualVertex,E extends VisualEdge<V>>
-