From a9f8fc7c26f78da765c1225d54216ae3fb8ae22c Mon Sep 17 00:00:00 2001 From: ghidragon <106987263+ghidragon@users.noreply.github.com> Date: Fri, 24 Jan 2025 11:31:19 -0500 Subject: [PATCH] GP-5296 added help links for function graph layout actions --- .../Function_Graph_Layouts.html | 14 ++++++++++++- .../core/functiongraph/FGActionManager.java | 8 +++---- .../graph/layout/FGLayoutProvider.java | 14 +++++++++++-- .../flowchart/FlowChartLayoutProvider.java | 6 ++++++ .../LeftAlignedFlowChartLayoutProvider.java | 5 +++++ .../jungrapht/JgtNamedLayoutProvider.java | 21 +++++++++++++++++-- .../graph/layout/TestFGLayoutProvider.java | 6 ++++++ .../DecompilerNestedLayoutProvider.java | 10 +++++++-- .../topics/GraphServices/GraphDisplay.htm | 2 +- 9 files changed, 73 insertions(+), 13 deletions(-) diff --git a/Ghidra/Features/FunctionGraph/src/main/help/help/topics/FunctionGraphPlugin/Function_Graph_Layouts.html b/Ghidra/Features/FunctionGraph/src/main/help/help/topics/FunctionGraphPlugin/Function_Graph_Layouts.html index fde3c94abd..4d68e17109 100644 --- a/Ghidra/Features/FunctionGraph/src/main/help/help/topics/FunctionGraphPlugin/Function_Graph_Layouts.html +++ b/Ghidra/Features/FunctionGraph/src/main/help/help/topics/FunctionGraphPlugin/Function_Graph_Layouts.html @@ -58,7 +58,19 @@ - +

Flow Chart Layout

+
+

This layout organizes the code blocks into a tree structure with each parent vertex in the + tree being centered over its children. Edges are routed orthongally with minimal edge + crossings.

+
+

Flow Chart Layout (Left)

+
+

This layout is the same as the Flow Chart Layout, except parent nodes are place directly + above their left most child.

+
+ +

Provided by: Function Graph Plugin


diff --git a/Ghidra/Features/FunctionGraph/src/main/java/ghidra/app/plugin/core/functiongraph/FGActionManager.java b/Ghidra/Features/FunctionGraph/src/main/java/ghidra/app/plugin/core/functiongraph/FGActionManager.java index 91cb84ee0c..a6ec812c3a 100644 --- a/Ghidra/Features/FunctionGraph/src/main/java/ghidra/app/plugin/core/functiongraph/FGActionManager.java +++ b/Ghidra/Features/FunctionGraph/src/main/java/ghidra/app/plugin/core/functiongraph/FGActionManager.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -911,13 +911,11 @@ class FGActionManager { private List> createActionStates( List layoutProviders) { List> list = new ArrayList<>(); - HelpLocation layoutHelpLocation = - new HelpLocation("FunctionGraphPlugin", "Function_Graph_Action_Layout"); for (FGLayoutProvider layout : layoutProviders) { ActionState layoutState = new ActionState<>(layout.getLayoutName(), layout.getActionIcon(), layout); - layoutState.setHelpLocation(layoutHelpLocation); + layoutState.setHelpLocation(layout.getHelpLocation()); list.add(layoutState); } diff --git a/Ghidra/Features/FunctionGraph/src/main/java/ghidra/app/plugin/core/functiongraph/graph/layout/FGLayoutProvider.java b/Ghidra/Features/FunctionGraph/src/main/java/ghidra/app/plugin/core/functiongraph/graph/layout/FGLayoutProvider.java index d239783761..2d0fb76b5d 100644 --- a/Ghidra/Features/FunctionGraph/src/main/java/ghidra/app/plugin/core/functiongraph/graph/layout/FGLayoutProvider.java +++ b/Ghidra/Features/FunctionGraph/src/main/java/ghidra/app/plugin/core/functiongraph/graph/layout/FGLayoutProvider.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -20,6 +20,7 @@ import ghidra.app.plugin.core.functiongraph.graph.FunctionGraph; import ghidra.app.plugin.core.functiongraph.graph.vertex.FGVertex; import ghidra.framework.options.Options; import ghidra.graph.viewer.layout.LayoutProvider; +import ghidra.util.HelpLocation; import ghidra.util.exception.CancelledException; import ghidra.util.task.TaskMonitor; @@ -44,4 +45,13 @@ public abstract class FGLayoutProvider implements LayoutProvider