Ghidra is a software reverse engineering (SRE) framework
Fixed spelling mistake
dragonmacherf07c144db968
diff --git a/Ghidra/Features/GraphServices/src/main/java/ghidra/graph/visualization/LayoutFunction.java b/Ghidra/Features/GraphServices/src/main/java/ghidra/graph/visualization/LayoutFunction.javaindex 136b569035..d8103afe3f 100644--- a/Ghidra/Features/GraphServices/src/main/java/ghidra/graph/visualization/LayoutFunction.java+++ b/Ghidra/Features/GraphServices/src/main/java/ghidra/graph/visualization/LayoutFunction.java@@ -124,7 +124,7 @@ class LayoutFunctioncase HIERACHICAL:return EdgeAwareTreeLayoutAlgorithm.<AttributedVertex, AttributedEdge>edgeAwareBuilder();- case COMPACT_HIERACHICAL:+ case COMPACT_HIERARCHICAL:default:return TidierTreeLayoutAlgorithm.<AttributedVertex, AttributedEdge> edgeAwareBuilder()diff --git a/Ghidra/Features/GraphServices/src/main/java/ghidra/graph/visualization/LayoutTransitionManager.java b/Ghidra/Features/GraphServices/src/main/java/ghidra/graph/visualization/LayoutTransitionManager.javaindex 720903e728..163b5abab1 100644--- a/Ghidra/Features/GraphServices/src/main/java/ghidra/graph/visualization/LayoutTransitionManager.java+++ b/Ghidra/Features/GraphServices/src/main/java/ghidra/graph/visualization/LayoutTransitionManager.java@@ -62,18 +62,17 @@ class LayoutTransitionManager {* Create an instance with passed parameters* @param visualizationServer displays the graph* @param rootPredicate selects root vertices- * @param edgeTypePriorityList a {@code List} of EdgeType names in priority order- * @param favoredEdgePredicate q {@code Predicate} that will cause certain EdgeTypes to be favored during layout+ * @param renderer the graph renderer*/public LayoutTransitionManager(VisualizationServer<AttributedVertex, AttributedEdge> visualizationServer,- Predicate<AttributedVertex> rootPredicate,- GraphRenderer renderer) {+ Predicate<AttributedVertex> rootPredicate, GraphRenderer renderer) {this.visualizationServer = visualizationServer;this.rootPredicate = rootPredicate;this.renderContext = visualizationServer.getRenderContext();- this.vertexBoundsFunction = visualizationServer.getRenderContext().getVertexBoundsFunction();+ this.vertexBoundsFunction =+ visualizationServer.getRenderContext().getVertexBoundsFunction();this.layoutFunction = new LayoutFunction(renderer);}@@ -81,22 +80,22 @@ class LayoutTransitionManager {* set the layout in order to configure the requested {@link LayoutAlgorithm}* @param layoutName the name of the layout algorithm to use*/+ @SuppressWarnings("unchecked")public void setLayout(String layoutName) {LayoutAlgorithm.Builder<AttributedVertex, ?, ?> builder = layoutFunction.apply(layoutName);LayoutAlgorithm<AttributedVertex> layoutAlgorithm = builder.build();// layout algorithm considers the size of verticesif (layoutAlgorithm instanceof VertexBoundsFunctionConsumer) {((VertexBoundsFunctionConsumer<AttributedVertex>) layoutAlgorithm)- .setVertexBoundsFunction(vertexBoundsFunction);+ .setVertexBoundsFunction(vertexBoundsFunction);}// mincross layouts are 'layered'. put some bounds on the number of// iterations of the level cross function based on the size of the graph// very large graphs do not improve enough to out-weigh the cost of// repeated iterationsif (layoutAlgorithm instanceof Layered) {- ((Layered<AttributedVertex, AttributedEdge>) layoutAlgorithm)- .setMaxLevelCrossFunction(g ->- Math.max(1, Math.min(10, 500 / g.vertexSet().size())));+ ((Layered<AttributedVertex, AttributedEdge>) layoutAlgorithm).setMaxLevelCrossFunction(+ g -> Math.max(1, Math.min(10, 500 / g.vertexSet().size())));}// tree layouts need a way to determine which vertices are roots// especially when the graph is not a DAG@@ -108,22 +107,18 @@ class LayoutTransitionManager {removePaintable(radialLayoutRings);removePaintable(balloonLayoutRings);if (layoutAlgorithm instanceof BalloonLayoutAlgorithm) {- balloonLayoutRings =- new LayoutPaintable.BalloonRings<>(- visualizationServer,- (BalloonLayoutAlgorithm<AttributedVertex>) layoutAlgorithm);+ balloonLayoutRings = new LayoutPaintable.BalloonRings<>(visualizationServer,+ (BalloonLayoutAlgorithm<AttributedVertex>) layoutAlgorithm);visualizationServer.addPreRenderPaintable(balloonLayoutRings);}if (layoutAlgorithm instanceof RadialTreeLayout) {- radialLayoutRings =- new LayoutPaintable.RadialRings<>(- visualizationServer, (RadialTreeLayout<AttributedVertex>) layoutAlgorithm);+ radialLayoutRings = new LayoutPaintable.RadialRings<>(visualizationServer,+ (RadialTreeLayout<AttributedVertex>) layoutAlgorithm);visualizationServer.addPreRenderPaintable(radialLayoutRings);}// apply the layout algorithm- LayoutAlgorithmTransition.apply(visualizationServer,- layoutAlgorithm);+ LayoutAlgorithmTransition.apply(visualizationServer, layoutAlgorithm);}private void removePaintable(VisualizationServer.Paintable paintable) {@@ -134,15 +129,15 @@ class LayoutTransitionManager {/*** Supplies the {@code LayoutAlgorithm} to be used for the initial @{code Graph} visualization- * @return+ * @return the algorithm*/+ @SuppressWarnings("unchecked")public LayoutAlgorithm<AttributedVertex> getInitialLayoutAlgorithm() {LayoutAlgorithm<AttributedVertex> initialLayoutAlgorithm =- layoutFunction.apply(LayoutAlgorithmNames.COMPACT_HIERACHICAL).build();+ layoutFunction.apply(LayoutAlgorithmNames.COMPACT_HIERARCHICAL).build();if (initialLayoutAlgorithm instanceof TreeLayout) {- ((TreeLayout<AttributedVertex>) initialLayoutAlgorithm)- .setRootPredicate(rootPredicate);+ ((TreeLayout<AttributedVertex>) initialLayoutAlgorithm).setRootPredicate(rootPredicate);}if (initialLayoutAlgorithm instanceof VertexBoundsFunctionConsumer) {((VertexBoundsFunctionConsumer<AttributedVertex>) initialLayoutAlgorithm)diff --git a/Ghidra/Framework/Graph/src/main/java/ghidra/service/graph/LayoutAlgorithmNames.java b/Ghidra/Framework/Graph/src/main/java/ghidra/service/graph/LayoutAlgorithmNames.javaindex 8153243f7b..63284f2997 100644--- a/Ghidra/Framework/Graph/src/main/java/ghidra/service/graph/LayoutAlgorithmNames.java+++ b/Ghidra/Framework/Graph/src/main/java/ghidra/service/graph/LayoutAlgorithmNames.java@@ -26,7 +26,7 @@ public class LayoutAlgorithmNames {public static final String FORCED_BALANCED = "Force Balanced";public static final String FORCE_DIRECTED = "Force Directed";public static final String CIRCLE = "Circle";- public static final String COMPACT_HIERACHICAL = "Compact Hierarchical";+ public static final String COMPACT_HIERARCHICAL = "Compact Hierarchical";public static final String COMPACT_RADIAL = "Compact Radial";public static final String MIN_CROSS_TOP_DOWN = "Hierarchical MinCross Top Down";public static final String MIN_CROSS_LONGEST_PATH = "Hierarchical MinCross Longest Path";@@ -44,7 +44,7 @@ public class LayoutAlgorithmNames {//@formatter:onpublic static List<String> getLayoutAlgorithmNames() {- return Arrays.asList(COMPACT_HIERACHICAL, HIERACHICAL,+ return Arrays.asList(COMPACT_HIERARCHICAL, HIERACHICAL,COMPACT_RADIAL, MIN_CROSS_TOP_DOWN, MIN_CROSS_LONGEST_PATH,MIN_CROSS_NETWORK_SIMPLEX, MIN_CROSS_COFFMAN_GRAHAM, CIRCLE,VERT_MIN_CROSS_TOP_DOWN,