Skip to content

Ghidra is a software reverse engineering (SRE) framework

GP-737 new graph layout branch - added hack to get help working right for algs with subitems.

ghidra007bdcf82e3e130
diff --git a/Ghidra/Features/GraphServices/src/main/help/help/topics/GraphServices/GraphDisplay.htm b/Ghidra/Features/GraphServices/src/main/help/help/topics/GraphServices/GraphDisplay.htm
index 30810d250d..d42661be77 100644
--- a/Ghidra/Features/GraphServices/src/main/help/help/topics/GraphServices/GraphDisplay.htm
+++ b/Ghidra/Features/GraphServices/src/main/help/help/topics/GraphServices/GraphDisplay.htm
@@ -122,11 +122,13 @@
<B>Compact Radial</B> is the <B>TidierTree Layout Algorithm</B> with the root(s) at the
center and child vertices radiating outwards.</LI>
- <LI><B>Hierarchical MinCross</B> is the <B>Sugiyama Layout Algorithm with optimizations</B>. It attempts to
+ <LI><A name="Hierarchical MinCross"/>
+ <B>Hierarchical MinCross</B> is the <B>Sugiyama Layout Algorithm with optimizations</B>. It attempts to
route edges around vertices in order to reduce crossing. There are four layering
algorithms (below)</LI>
- <LI><B>Vertical Hierarchical MinCross</B> is the <B>Sugiyama Layout Algorithm with optimizations</B>. It attempts to
+ <LI><A name="Vertical Hierarchical MinCross"/>
+ <B>Vertical Hierarchical MinCross</B> is the <B>Sugiyama Layout Algorithm with optimizations</B>. It attempts to
route edges around vertices in order to reduce crossing. If there is a favored EdgeType, an attempt is made to
line up those favored edges so they are vertical in the presentation. There are four layering
algorithms:</LI>
diff --git a/Ghidra/Features/GraphServices/src/main/java/ghidra/graph/visualization/DefaultGraphDisplay.java b/Ghidra/Features/GraphServices/src/main/java/ghidra/graph/visualization/DefaultGraphDisplay.java
index de890a5582..e062bd8dac 100644
--- a/Ghidra/Features/GraphServices/src/main/java/ghidra/graph/visualization/DefaultGraphDisplay.java
+++ b/Ghidra/Features/GraphServices/src/main/java/ghidra/graph/visualization/DefaultGraphDisplay.java
@@ -51,7 +51,6 @@ import org.jungrapht.visualization.renderers.Renderer;
import org.jungrapht.visualization.renderers.Renderer.VertexLabel;
import org.jungrapht.visualization.renderers.Renderer.VertexLabel.Position;
import org.jungrapht.visualization.selection.MutableSelectedState;
-import org.jungrapht.visualization.selection.VertexEndpointsSelectedEdgeSelectedState;
import org.jungrapht.visualization.transform.*;
import org.jungrapht.visualization.transform.shape.MagnifyImageLensSupport;
import org.jungrapht.visualization.transform.shape.MagnifyShapeTransformer;
@@ -755,6 +754,14 @@ public class DefaultGraphDisplay implements GraphDisplay {
for (String layoutName : names) {
ActionState<String> state = new ActionState<>(layoutName,
DefaultDisplayGraphIcons.LAYOUT_ALGORITHM_ICON, layoutName);
+
+ if (layoutName.contains("Vertical Hierarchical MinCross")) {
+ layoutName = "Vertical Hierarchical MinCross";
+ }
+ else if (layoutName.contains("Hierarchical MinCross")) {
+ layoutName = "Hierarchical MinCross";
+ }
+
state.setHelpLocation(new HelpLocation(ACTION_OWNER, layoutName));
actionStates.add(state);
}