# HG changeset patch # User Peter Hofer # Date 1308146228 -7200 # Node ID f887649da5233947bf0373c4c816e3edc7cef444 # Parent bf4f8817e3bd17dcb0276fd907a76ed45d06383a IdealGraphVisualizer: ignore selection changes that are triggered when the scene is rebuilding during an update: this fixes problems with hidden nodes or blocks when opening a different graph or a diff view diff -r bf4f8817e3bd -r f887649da523 src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/DiagramScene.java --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/DiagramScene.java Wed Jun 15 14:30:40 2011 +0200 +++ b/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/DiagramScene.java Wed Jun 15 15:57:08 2011 +0200 @@ -57,8 +57,6 @@ import java.awt.Point; import java.awt.Rectangle; import java.awt.event.ActionEvent; -import java.awt.event.MouseEvent; -import java.awt.event.MouseMotionListener; import java.awt.event.MouseWheelEvent; import java.awt.event.MouseWheelListener; import java.util.ArrayList; @@ -123,6 +121,7 @@ private DiagramViewModel model; private DiagramViewModel modelCopy; private WidgetAction zoomAction; + private boolean rebuilding; /** * The alpha level of partially visible figures. @@ -327,6 +326,11 @@ } public void selectionChanged(ObjectSceneEvent e, Set oldSet, Set newSet) { + DiagramScene scene = (DiagramScene) e.getObjectScene(); + if (scene.isRebuilding()) { + return; + } + content.set(newSet, null); Set nodeSelection = new HashSet(); @@ -507,6 +511,8 @@ private void update() { mainLayer.removeChildren(); blockLayer.removeChildren(); + + rebuilding = true; Collection objects = new ArrayList(this.getObjects()); for (Object o : objects) { @@ -515,7 +521,7 @@ Diagram d = getModel().getDiagramToView(); - if (d.getGraph().getBlocks().size() == 0) { + if (d.getGraph().getBlocks().isEmpty()) { Scheduler s = Lookup.getDefault().lookup(Scheduler.class); d.getGraph().clearBlocks(); s.schedule(d.getGraph()); @@ -557,9 +563,13 @@ blockLayer.addChild(w); } } - + + rebuilding = false; this.smallUpdate(true); - + } + + public boolean isRebuilding() { + return rebuilding; } private void smallUpdate(boolean relayout) {