diff --git a/src/utils/IdealGraphVisualizer/HierarchicalLayout/src/main/java/com/sun/hotspot/igv/hierarchicallayout/HierarchicalCFGLayoutManager.java b/src/utils/IdealGraphVisualizer/HierarchicalLayout/src/main/java/com/sun/hotspot/igv/hierarchicallayout/HierarchicalCFGLayoutManager.java
index c712c2f935e..3d4e8f87b27 100644
--- a/src/utils/IdealGraphVisualizer/HierarchicalLayout/src/main/java/com/sun/hotspot/igv/hierarchicallayout/HierarchicalCFGLayoutManager.java
+++ b/src/utils/IdealGraphVisualizer/HierarchicalLayout/src/main/java/com/sun/hotspot/igv/hierarchicallayout/HierarchicalCFGLayoutManager.java
@@ -45,6 +45,12 @@ public class HierarchicalCFGLayoutManager implements LayoutManager {
fontMetrics = canvas.getFontMetrics(font);
}
+ @Override
+ public void setCutEdges(boolean enable) {
+ subManager.setCutEdges(enable);
+ manager.setCutEdges(enable);
+ }
+
public void setSubManager(LayoutManager manager) {
this.subManager = manager;
}
diff --git a/src/utils/IdealGraphVisualizer/HierarchicalLayout/src/main/java/com/sun/hotspot/igv/hierarchicallayout/HierarchicalClusterLayoutManager.java b/src/utils/IdealGraphVisualizer/HierarchicalLayout/src/main/java/com/sun/hotspot/igv/hierarchicallayout/HierarchicalClusterLayoutManager.java
index badfb0e036a..1d103585e58 100644
--- a/src/utils/IdealGraphVisualizer/HierarchicalLayout/src/main/java/com/sun/hotspot/igv/hierarchicallayout/HierarchicalClusterLayoutManager.java
+++ b/src/utils/IdealGraphVisualizer/HierarchicalLayout/src/main/java/com/sun/hotspot/igv/hierarchicallayout/HierarchicalClusterLayoutManager.java
@@ -43,6 +43,12 @@ public class HierarchicalClusterLayoutManager implements LayoutManager {
this.combine = combine;
}
+ @Override
+ public void setCutEdges(boolean enable) {
+ subManager.setCutEdges(enable);
+ manager.setCutEdges(enable);
+ }
+
public void doLayout(LayoutGraph graph, Set extends Link> importantLinks) {
doLayout(graph);
}
diff --git a/src/utils/IdealGraphVisualizer/HierarchicalLayout/src/main/java/com/sun/hotspot/igv/hierarchicallayout/HierarchicalLayoutManager.java b/src/utils/IdealGraphVisualizer/HierarchicalLayout/src/main/java/com/sun/hotspot/igv/hierarchicallayout/HierarchicalLayoutManager.java
index 0c9e5ccd480..996fd895577 100644
--- a/src/utils/IdealGraphVisualizer/HierarchicalLayout/src/main/java/com/sun/hotspot/igv/hierarchicallayout/HierarchicalLayoutManager.java
+++ b/src/utils/IdealGraphVisualizer/HierarchicalLayout/src/main/java/com/sun/hotspot/igv/hierarchicallayout/HierarchicalLayoutManager.java
@@ -136,8 +136,9 @@ public class HierarchicalLayoutManager implements LayoutManager {
this.layerOffset = layerOffset;
}
- public void setMaxLayerLength(int v) {
- maxLayerLength = v;
+ @Override
+ public void setCutEdges(boolean enable) {
+ maxLayerLength = enable ? 10 : -1;
}
public void setMinLayerDifference(int v) {
diff --git a/src/utils/IdealGraphVisualizer/HierarchicalLayout/src/main/java/com/sun/hotspot/igv/hierarchicallayout/HierarchicalStableLayoutManager.java b/src/utils/IdealGraphVisualizer/HierarchicalLayout/src/main/java/com/sun/hotspot/igv/hierarchicallayout/HierarchicalStableLayoutManager.java
index 875ccb19022..2d76d15394c 100644
--- a/src/utils/IdealGraphVisualizer/HierarchicalLayout/src/main/java/com/sun/hotspot/igv/hierarchicallayout/HierarchicalStableLayoutManager.java
+++ b/src/utils/IdealGraphVisualizer/HierarchicalLayout/src/main/java/com/sun/hotspot/igv/hierarchicallayout/HierarchicalStableLayoutManager.java
@@ -38,8 +38,8 @@ public class HierarchicalStableLayoutManager {
public static final int X_OFFSET = 8;
public static final int LAYER_OFFSET = 8;
// Algorithm global data structures
- private HashSet extends Vertex> currentVertices;
- private HashSet extends Link> currentLinks;
+ private Set extends Vertex> currentVertices;
+ private Set extends Link> currentLinks;
private Set reversedLinks;
private List nodes;
private final HashMap vertexToLayoutNode;
@@ -51,10 +51,19 @@ public class HierarchicalStableLayoutManager {
private HashMap vertexToAction;
private List vertexActions;
private List linkActions;
- private HashSet extends Vertex> oldVertices;
- private HashSet extends Link> oldLinks;
+ private Set extends Vertex> oldVertices;
+ private Set extends Link> oldLinks;
private boolean shouldRedrawLayout = true;
private boolean shouldRemoveEmptyLayers = true;
+ private boolean cutEdges = false;
+
+ public void doLayout(LayoutGraph layoutGraph) {
+ boolean oldShouldRedrawLayout = shouldRedrawLayout;
+ setShouldRedrawLayout(true);
+ updateLayout(layoutGraph.getVertices(), layoutGraph.getLinks());
+ setShouldRedrawLayout(oldShouldRedrawLayout);
+ }
+
enum Action {
ADD,
@@ -90,6 +99,15 @@ public class HierarchicalStableLayoutManager {
nodes = new ArrayList<>();
}
+ public void setCutEdges(boolean enable) {
+ cutEdges = enable;
+ manager.setCutEdges(enable);
+ }
+
+ public boolean getCutEdges() {
+ return cutEdges;
+ }
+
private int calculateOptimalBoth(LayoutNode n) {
if (n.preds.isEmpty() && n.succs.isEmpty()) {
return n.x;
@@ -396,7 +414,7 @@ public class HierarchicalStableLayoutManager {
this.shouldRedrawLayout = shouldRedrawLayout;
}
- public void updateLayout(HashSet extends Vertex> vertices, HashSet extends Link> links) {
+ public void updateLayout(Set extends Vertex> vertices, Set extends Link> links) {
currentVertices = vertices;
currentLinks = links;
reversedLinks = new HashSet<>();
diff --git a/src/utils/IdealGraphVisualizer/HierarchicalLayout/src/main/java/com/sun/hotspot/igv/hierarchicallayout/LinearLayoutManager.java b/src/utils/IdealGraphVisualizer/HierarchicalLayout/src/main/java/com/sun/hotspot/igv/hierarchicallayout/LinearLayoutManager.java
index 32f56e69bf9..69d53ebc9fa 100644
--- a/src/utils/IdealGraphVisualizer/HierarchicalLayout/src/main/java/com/sun/hotspot/igv/hierarchicallayout/LinearLayoutManager.java
+++ b/src/utils/IdealGraphVisualizer/HierarchicalLayout/src/main/java/com/sun/hotspot/igv/hierarchicallayout/LinearLayoutManager.java
@@ -39,6 +39,9 @@ public class LinearLayoutManager implements LayoutManager {
this.vertexRank = vertexRank;
}
+ @Override
+ public void setCutEdges(boolean enable) {}
+
@Override
public void doLayout(LayoutGraph graph) {
doLayout(graph, new HashSet<>());
diff --git a/src/utils/IdealGraphVisualizer/Layout/src/main/java/com/sun/hotspot/igv/layout/LayoutManager.java b/src/utils/IdealGraphVisualizer/Layout/src/main/java/com/sun/hotspot/igv/layout/LayoutManager.java
index 86a0d02e16b..a74ef280ebe 100644
--- a/src/utils/IdealGraphVisualizer/Layout/src/main/java/com/sun/hotspot/igv/layout/LayoutManager.java
+++ b/src/utils/IdealGraphVisualizer/Layout/src/main/java/com/sun/hotspot/igv/layout/LayoutManager.java
@@ -31,6 +31,8 @@ import java.util.Set;
*/
public interface LayoutManager {
+ void setCutEdges(boolean enable);
+
void doLayout(LayoutGraph graph);
void doLayout(LayoutGraph graph, Set extends Link> importantLinks);
diff --git a/src/utils/IdealGraphVisualizer/View/src/main/java/com/sun/hotspot/igv/view/DiagramScene.java b/src/utils/IdealGraphVisualizer/View/src/main/java/com/sun/hotspot/igv/view/DiagramScene.java
index f9c2e991d46..3f7fec74505 100644
--- a/src/utils/IdealGraphVisualizer/View/src/main/java/com/sun/hotspot/igv/view/DiagramScene.java
+++ b/src/utils/IdealGraphVisualizer/View/src/main/java/com/sun/hotspot/igv/view/DiagramScene.java
@@ -700,12 +700,19 @@ public class DiagramScene extends ObjectScene implements DiagramViewer, DoubleCl
}
private void doStableSeaLayout(HashSet