Package ghidra.graph.viewer.edge
Class VisualGraphPathHighlighter<V extends VisualVertex,E extends VisualEdge<V>>
java.lang.Object
ghidra.graph.viewer.edge.VisualGraphPathHighlighter<V,E>
- Type Parameters:
V
- the vertex typeE
- the edge type
public class VisualGraphPathHighlighter<V extends VisualVertex,E extends VisualEdge<V>>
extends Object
A class that calculates flow between vertices and then triggers that flow to be painted
in the UI.
Threading Policy: Some operations use algorithms that slow down, depending upon the graph size. Further, some of these algorithms may not even complete. To keep the graph responsive, this class will perform its work in the future. The work we wish to do is further complicated by these requirements:
- Some data should be calculated only as needed, to avoid excessive work
- Many tasks depend on data to be calculated before they can perform their algorithm
- Results must be cached for speed, but may cleared as the graph is mutated
- Algorithms must not block the UI thread
- Related actions (i.e., hover vs. selection) should cancel any pending action, but not unrelated actions (e.g., a new hover request should cancel a pending hover update)
CompletableFuture
- to lazy-load and cache required algorithm dataRunManager
s - to queue requests so that new requests cancel old ones. A different Run Manager is used for each type of request.
Naming Conventions: There are many methods in this class, called from different threads. For simplicity, we use the following conventions:
fooAsync
- methods ending in Async indicate that they are to be called from a background thread.fooSwing
- methods ending in Swing indicate that they are to be called from the Swing thread.- *All public methods are assumed to be called on the Swing thread
-
Constructor Summary
ConstructorDescriptionVisualGraphPathHighlighter
(VisualGraph<V, E> graph, PathHighlightListener listener) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
dispose()
protected GDirectedGraph
<V, E> getDominanceGraph
(VisualGraph<V, E> visualGraph, boolean forward) boolean
isBusy()
void
setFocusedVertex
(V focusedVertex) void
setHoveredVertex
(V hoveredVertex) void
void
void
Sets the callback that signals when this path highlighter should not be performing any workvoid
stop()
Signals to this path highlighter that it should stop all background jobs
-
Constructor Details
-
VisualGraphPathHighlighter
-
-
Method Details
-
setWorkPauser
Sets the callback that signals when this path highlighter should not be performing any work- Parameters:
pauser
- the callback that returns a boolean of true when this class should pause its work.
-
getDominanceGraph
-
stop
public void stop()Signals to this path highlighter that it should stop all background jobs -
dispose
public void dispose() -
isBusy
public boolean isBusy() -
getVertexHoverPathHighlightMode
-
getVertexFocusPathHighlightMode
-
setVertexFocusMode
-
setVertexHoverMode
-
setHoveredVertex
-
setFocusedVertex
-
clearEdgeCache
public void clearEdgeCache()
-