mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 02:09:44 +02:00
GP-9181 - Theming - Base Module
This commit is contained in:
parent
2dade60b3e
commit
4eb3d8fd86
113 changed files with 1092 additions and 1099 deletions
|
@ -19,12 +19,12 @@
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import generic.theme.GThemeDefaults.Colors.Palette;
|
||||
import ghidra.app.script.GhidraScript;
|
||||
import ghidra.app.services.GraphDisplayBroker;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.program.model.data.*;
|
||||
import ghidra.service.graph.*;
|
||||
import ghidra.util.WebColors;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
|
@ -36,7 +36,7 @@ public class GraphClassesScript extends GhidraScript {
|
|||
private static final String VIRTUAL_INHERITANCE = "Virtual Inheritance";
|
||||
private static final String NON_VIRTUAL_INHERITANCE = "Non-virtual Inheritance";
|
||||
|
||||
List<Structure> classStructures = new ArrayList<Structure>();
|
||||
List<Structure> classStructures = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
|
@ -107,9 +107,8 @@ public class GraphClassesScript extends GhidraScript {
|
|||
}
|
||||
|
||||
/**
|
||||
* Method to create a graph using preconfigured information found in class structure descriptions.
|
||||
* The structure descriptions are created using
|
||||
* {@link RecoveredClassUtils#createParentStringBuffer(RecoveredClass)}
|
||||
* Method to create a graph using pre-configured information found in class structure
|
||||
* descriptions.
|
||||
* @return the newly created graph
|
||||
*/
|
||||
private AttributedGraph createGraph() throws Exception {
|
||||
|
@ -290,7 +289,7 @@ public class GraphClassesScript extends GhidraScript {
|
|||
private Structure getParentStructureFromClassStructures(String parentName)
|
||||
throws CancelledException {
|
||||
|
||||
List<Structure> parentStructures = new ArrayList<Structure>();
|
||||
List<Structure> parentStructures = new ArrayList<>();
|
||||
for (Structure classStructure : classStructures) {
|
||||
monitor.checkCanceled();
|
||||
|
||||
|
@ -315,13 +314,13 @@ public class GraphClassesScript extends GhidraScript {
|
|||
display = service.getGraphDisplay(false, TaskMonitor.DUMMY);
|
||||
|
||||
GraphDisplayOptions graphOptions = new GraphDisplayOptionsBuilder(graph.getGraphType())
|
||||
.vertex(NO_INHERITANCE, VertexShape.RECTANGLE, WebColors.BLUE)
|
||||
.vertex(SINGLE_INHERITANCE, VertexShape.RECTANGLE, WebColors.GREEN)
|
||||
.vertex(MULTIPLE_INHERITANCE, VertexShape.RECTANGLE, WebColors.RED)
|
||||
.edge(NON_VIRTUAL_INHERITANCE, WebColors.LIME_GREEN)
|
||||
.edge(VIRTUAL_INHERITANCE, WebColors.ORANGE)
|
||||
.defaultVertexColor(WebColors.PURPLE)
|
||||
.defaultEdgeColor(WebColors.PURPLE)
|
||||
.vertex(NO_INHERITANCE, VertexShape.RECTANGLE, Palette.BLUE)
|
||||
.vertex(SINGLE_INHERITANCE, VertexShape.RECTANGLE, Palette.GREEN)
|
||||
.vertex(MULTIPLE_INHERITANCE, VertexShape.RECTANGLE, Palette.RED)
|
||||
.edge(NON_VIRTUAL_INHERITANCE, Palette.LIME)
|
||||
.edge(VIRTUAL_INHERITANCE, Palette.ORANGE)
|
||||
.defaultVertexColor(Palette.PURPLE)
|
||||
.defaultEdgeColor(Palette.PURPLE)
|
||||
.defaultLayoutAlgorithm("Compact Hierarchical")
|
||||
.maxNodeCount(1000)
|
||||
.build();
|
||||
|
@ -330,7 +329,6 @@ public class GraphClassesScript extends GhidraScript {
|
|||
"Recovered Classes Graph", false, TaskMonitor.DUMMY);
|
||||
}
|
||||
|
||||
|
||||
private String getClassName(String description) {
|
||||
|
||||
int indexOfColon = getIndexOfFirstSingleColon(description);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue