Skip to content

Commit e2188d4

Browse files
committed
Merge remote-tracking branch 'origin/GP-3402-dragonmacher-graph-threading'
2 parents 78d9a6c + bde74ad commit e2188d4

File tree

12 files changed

+422
-387
lines changed

12 files changed

+422
-387
lines changed

Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/graph/AddressBasedGraphDisplayListener.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,6 @@ public AddressBasedGraphDisplayListener(PluginTool tool, Program program,
5656
program.addListener(this);
5757
}
5858

59-
@Override
60-
public void graphClosed() {
61-
dispose();
62-
}
63-
6459
@Override
6560
public void locationFocusChanged(AttributedVertex vertex) {
6661
Address address = getAddress(vertex);

Ghidra/Features/Base/src/main/java/ghidra/app/services/GraphDisplayBroker.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626

2727
/**
2828
* Ghidra service interface for managing and directing graph output. It purpose is to discover
29-
* available graphing display providers and (if more than one) allow the user to select the currently
30-
* active graph consumer. Clients that generate graphs don't have to worry about how to display them
31-
* or export graphs. They simply send their graphs to the broker and register for graph events if
32-
* they want interactive support.
29+
* available graphing display providers and (if more than one) allow the user to select the
30+
* currently active graph consumer. Clients that generate graphs don't have to worry about how to
31+
* display them or export graphs. They simply send their graphs to the broker and register for graph
32+
* events if they want interactive support.
3333
*/
3434
@ServiceInfo(defaultProvider = GraphDisplayBrokerPlugin.class, description = "Get a Graph Display")
3535
public interface GraphDisplayBroker {
@@ -56,7 +56,7 @@ public interface GraphDisplayBroker {
5656
/**
5757
* A convenience method for getting a {@link GraphDisplay} from the currently active provider.
5858
* This method is intended to be used to display a new graph.
59-
*
59+
*
6060
* @param reuseGraph if true, the provider will attempt to re-use a current graph display
6161
* @param monitor the {@link TaskMonitor} that can be used to cancel the operation
6262
* @return a {@link GraphDisplay} object to sends graphs to be displayed or exported.
@@ -87,7 +87,7 @@ public GraphDisplay getDefaultGraphDisplay(boolean reuseGraph, TaskMonitor monit
8787
/**
8888
* Returns the {@link AttributedGraphExporter} with the given name or null in no exporter with
8989
* that name is known
90-
*
90+
*
9191
* @param name the name of the exporter to retrieve
9292
* @return the {@link AttributedGraphExporter} with the given name or null if no exporter with
9393
* that name is known

Ghidra/Features/GraphServices/src/main/java/ghidra/graph/export/ExportAttributedGraphDisplay.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,22 @@
1717

1818
import java.util.*;
1919

20-
import org.jgrapht.Graph;
21-
2220
import docking.action.DockingActionIf;
2321
import docking.widgets.EventTrigger;
2422
import ghidra.app.services.GraphDisplayBroker;
2523
import ghidra.framework.plugintool.PluginTool;
2624
import ghidra.service.graph.*;
25+
import ghidra.util.Swing;
2726
import ghidra.util.exception.CancelledException;
2827
import ghidra.util.task.TaskMonitor;
2928

3029
/**
3130
* {@link GraphDisplay} implementation for exporting graphs. In this case, there is no
32-
* associated visual display, instead the graph output gets sent to a file. The
31+
* associated visual display, instead the graph output gets sent to a file. The
3332
* {@link GraphDisplay} is mostly just a placeholder for executing the export function. By
3433
* hijacking the {@link GraphDisplayProvider} and {@link GraphDisplay} interfaces for exporting,
3534
* all graph generating operations can be exported instead of being displayed without changing
36-
* the graph generation code.
35+
* the graph generation code.
3736
*/
3837
class ExportAttributedGraphDisplay implements GraphDisplay {
3938

@@ -66,7 +65,8 @@ public void setGraphDisplayListener(GraphDisplayListener listener) {
6665
*/
6766
private void doSetGraphData(AttributedGraph attributedGraph) {
6867
List<AttributedGraphExporter> exporters = findGraphExporters();
69-
GraphExporterDialog dialog = new GraphExporterDialog(attributedGraph, exporters);
68+
GraphExporterDialog dialog =
69+
Swing.runNow(() -> new GraphExporterDialog(attributedGraph, exporters));
7070
tool.showDialog(dialog);
7171
}
7272

@@ -79,8 +79,7 @@ private List<AttributedGraphExporter> findGraphExporters() {
7979
}
8080

8181
@Override
82-
public void setGraph(AttributedGraph graph, String title, boolean append,
83-
TaskMonitor monitor) {
82+
public void setGraph(AttributedGraph graph, String title, boolean append, TaskMonitor monitor) {
8483
this.title = title;
8584
this.graph = graph;
8685
doSetGraphData(graph);
@@ -92,9 +91,6 @@ public void setGraph(AttributedGraph graph, GraphDisplayOptions options, String
9291
this.setGraph(graph, title, append, monitor);
9392
}
9493

95-
/**
96-
* remove all vertices and edges from the {@link Graph}
97-
*/
9894
@Override
9995
public void clear() {
10096
// not interactive, so N/A

0 commit comments

Comments
 (0)