mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-26 05:56:32 +08:00
Miscellanious bug fixes and code clean up.
This commit is contained in:
@@ -18,6 +18,7 @@ package ghidra.graph.program;
|
||||
import java.awt.Color;
|
||||
import java.util.*;
|
||||
|
||||
import docking.widgets.EventTrigger;
|
||||
import ghidra.app.plugin.core.colorizer.ColorizingService;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.program.model.address.Address;
|
||||
@@ -156,12 +157,15 @@ public class BlockGraphTask extends Task {
|
||||
display.setGraph(graph, actionName, appendGraph, monitor);
|
||||
|
||||
if (location != null) {
|
||||
display.setLocation(listener.getVertexIdForAddress(location.getAddress()));
|
||||
// initialize the graph location, but don't have the graph send an event
|
||||
String id = listener.getVertexIdForAddress(location.getAddress());
|
||||
display.setLocationFocus(id, EventTrigger.INTERNAL_ONLY);
|
||||
}
|
||||
if (selection != null && !selection.isEmpty()) {
|
||||
List<String> selectedVertices = listener.getVertices(selection);
|
||||
if (selectedVertices != null) {
|
||||
display.selectVertices(selectedVertices);
|
||||
// intialize the graph selection, but don't have the graph send an event
|
||||
display.selectVertices(selectedVertices, EventTrigger.INTERNAL_ONLY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-3
@@ -17,6 +17,7 @@ package ghidra.graph.program;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import docking.widgets.EventTrigger;
|
||||
import ghidra.service.graph.*;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
@@ -37,7 +38,7 @@ public class TestGraphDisplay implements GraphDisplay {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLocation(String vertexID) {
|
||||
public void setLocationFocus(String vertexID, EventTrigger eventTrigger) {
|
||||
currentFocusedVertex = vertexID;
|
||||
}
|
||||
|
||||
@@ -46,7 +47,7 @@ public class TestGraphDisplay implements GraphDisplay {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectVertices(List<String> vertexList) {
|
||||
public void selectVertices(List<String> vertexList, EventTrigger eventTrigger) {
|
||||
currentSelection = vertexList;
|
||||
}
|
||||
|
||||
@@ -103,7 +104,7 @@ public class TestGraphDisplay implements GraphDisplay {
|
||||
}
|
||||
|
||||
public void focusChanged(String vertexId) {
|
||||
listener.locationChanged(vertexId);
|
||||
listener.locationFocusChanged(vertexId);
|
||||
}
|
||||
|
||||
public void selectionChanged(List<String> vertexIds) {
|
||||
|
||||
Reference in New Issue
Block a user