# HG changeset patch # User Thomas Wuerthinger # Date 1328117368 -3600 # Node ID bcce7f52832d7cf4bb66dd2a18bf57277a8f1464 # Parent 71990133c897821b7b7bf6f4e20860ad405f2c42 Extracted editor into a new project to separate it from the diagram scene view. diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/Editor/manifest.mf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/tools/IdealGraphVisualizer/Editor/manifest.mf Wed Feb 01 18:29:28 2012 +0100 @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +OpenIDE-Module: com.oracle.graal.visualizer.editor +OpenIDE-Module-Layer: com/oracle/graal/visualizer/editor/layer.xml +OpenIDE-Module-Localizing-Bundle: com/oracle/graal/visualizer/editor/Bundle.properties +OpenIDE-Module-Specification-Version: 1.0 + diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/Editor/src/META-INF/services/com.sun.hotspot.igv.data.services.GraphViewer --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/tools/IdealGraphVisualizer/Editor/src/META-INF/services/com.sun.hotspot.igv.data.services.GraphViewer Wed Feb 01 18:29:28 2012 +0100 @@ -0,0 +1,1 @@ +com.oracle.graal.visualizer.editor.GraphViewerImplementation diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/Editor/src/com/oracle/graal/visualizer/editor/Bundle.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/tools/IdealGraphVisualizer/Editor/src/com/oracle/graal/visualizer/editor/Bundle.properties Wed Feb 01 18:29:28 2012 +0100 @@ -0,0 +1,3 @@ +OpenIDE-Module-Name=Editor +CTL_EditorTopComponent=Compilation +HINT_EditorTopComponent=Shows the snapshots of a single compilation. \ No newline at end of file diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/Editor/src/com/oracle/graal/visualizer/editor/CompilationViewer.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/tools/IdealGraphVisualizer/Editor/src/com/oracle/graal/visualizer/editor/CompilationViewer.java Wed Feb 01 18:29:28 2012 +0100 @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package com.oracle.graal.visualizer.editor; + +import com.sun.hotspot.igv.graph.Figure; +import java.awt.Component; +import java.awt.Graphics2D; +import java.util.Collection; +import org.openide.awt.UndoRedo; +import org.openide.util.Lookup; + +/** + * + * @author Thomas Wuerthinger + */ +public interface CompilationViewer { + + public Lookup getLookup(); + + public Component getComponent(); + + public Component getToolBarComponent(); + + public UndoRedo getUndoRedo(); + + public void setSelection(Collection
list); + + public void paint(Graphics2D svgGenerator); + + public void zoomOut(); + + public void zoomIn(); +} diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/Editor/src/com/oracle/graal/visualizer/editor/CompilationViewerFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/tools/IdealGraphVisualizer/Editor/src/com/oracle/graal/visualizer/editor/CompilationViewerFactory.java Wed Feb 01 18:29:28 2012 +0100 @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ +package com.oracle.graal.visualizer.editor; + +public interface CompilationViewerFactory { + CompilationViewer createViewer(DiagramViewModel model); + String getName(); +} diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/Editor/src/com/oracle/graal/visualizer/editor/DiagramViewModel.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/tools/IdealGraphVisualizer/Editor/src/com/oracle/graal/visualizer/editor/DiagramViewModel.java Wed Feb 01 18:29:28 2012 +0100 @@ -0,0 +1,388 @@ +/* + * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.visualizer.editor; + +import com.sun.hotspot.igv.data.*; +import com.sun.hotspot.igv.difference.Difference; +import com.sun.hotspot.igv.filter.CustomFilter; +import com.sun.hotspot.igv.filter.FilterChain; +import com.sun.hotspot.igv.graph.Diagram; +import com.sun.hotspot.igv.graph.Figure; +import com.sun.hotspot.igv.settings.Settings; +import com.sun.hotspot.igv.util.RangeSliderModel; +import java.awt.Color; +import java.util.*; + +/** + * + * @author Thomas Wuerthinger + */ +public class DiagramViewModel extends RangeSliderModel implements ChangedListener { + + // Warning: Update setData method if fields are added + private Group group; + private Set hiddenNodes; + private Set onScreenNodes; + private Set selectedNodes; + private FilterChain filterChain; + private FilterChain sequenceFilterChain; + private Diagram diagram; + private InputGraph inputGraph; + private ChangedEvent groupChangedEvent; + private ChangedEvent diagramChangedEvent; + private ChangedEvent viewChangedEvent; + private ChangedEvent hiddenNodesChangedEvent; + private ChangedEvent viewPropertiesChangedEvent; + private boolean showNodeHull; + private ChangedListener filterChainChangedListener = new ChangedListener() { + + @Override + public void changed(FilterChain source) { + diagramChanged(); + } + }; + + @Override + public DiagramViewModel copy() { + DiagramViewModel result = new DiagramViewModel(group, filterChain, sequenceFilterChain); + result.setData(this); + return result; + } + + public void setData(DiagramViewModel newModel) { + super.setData(newModel); + boolean diagramChanged = false; + boolean viewChanged = false; + boolean viewPropertiesChanged = false; + + boolean groupChanged = (group == newModel.group); + this.group = newModel.group; + diagramChanged |= (filterChain != newModel.filterChain); + this.filterChain = newModel.filterChain; + diagramChanged |= (sequenceFilterChain != newModel.sequenceFilterChain); + this.sequenceFilterChain = newModel.sequenceFilterChain; + diagramChanged |= (diagram != newModel.diagram); + this.diagram = newModel.diagram; + viewChanged |= (hiddenNodes != newModel.hiddenNodes); + this.hiddenNodes = newModel.hiddenNodes; + viewChanged |= (onScreenNodes != newModel.onScreenNodes); + this.onScreenNodes = newModel.onScreenNodes; + viewChanged |= (selectedNodes != newModel.selectedNodes); + this.selectedNodes = newModel.selectedNodes; + viewPropertiesChanged |= (showNodeHull != newModel.showNodeHull); + this.showNodeHull = newModel.showNodeHull; + + if (groupChanged) { + groupChangedEvent.fire(); + } + + if (diagramChanged) { + diagramChangedEvent.fire(); + } + if (viewPropertiesChanged) { + viewPropertiesChangedEvent.fire(); + } + if (viewChanged) { + viewChangedEvent.fire(); + } + } + + public boolean getShowNodeHull() { + return showNodeHull; + } + + public void setShowNodeHull(boolean b) { + showNodeHull = b; + viewPropertiesChangedEvent.fire(); + } + + public DiagramViewModel(Group g, FilterChain filterChain, FilterChain sequenceFilterChain) { + super(calculateStringList(g)); + + this.showNodeHull = true; + this.group = g; + assert filterChain != null; + this.filterChain = filterChain; + assert sequenceFilterChain != null; + this.sequenceFilterChain = sequenceFilterChain; + hiddenNodes = new HashSet<>(); + onScreenNodes = new HashSet<>(); + selectedNodes = new HashSet<>(); + super.getChangedEvent().addListener(this); + diagramChangedEvent = new ChangedEvent<>(this); + viewChangedEvent = new ChangedEvent<>(this); + hiddenNodesChangedEvent = new ChangedEvent<>(this); + viewPropertiesChangedEvent = new ChangedEvent<>(this); + + groupChangedEvent = new ChangedEvent<>(this); + groupChangedEvent.addListener(groupChangedListener); + groupChangedEvent.fire(); + + filterChain.getChangedEvent().addListener(filterChainChangedListener); + sequenceFilterChain.getChangedEvent().addListener(filterChainChangedListener); + } + private final ChangedListener groupChangedListener = new ChangedListener() { + + private Group oldGroup; + + @Override + public void changed(DiagramViewModel source) { + if (oldGroup != null) { + oldGroup.getChangedEvent().removeListener(groupContentChangedListener); + } + group.getChangedEvent().addListener(groupContentChangedListener); + oldGroup = group; + } + }; + private final ChangedListener groupContentChangedListener = new ChangedListener() { + + @Override + public void changed(Group source) { + assert source == group; + setPositions(calculateStringList(source)); + setSelectedNodes(selectedNodes); + } + }; + + public ChangedEvent getDiagramChangedEvent() { + return diagramChangedEvent; + } + + public ChangedEvent getViewChangedEvent() { + return viewChangedEvent; + } + + public ChangedEvent getHiddenNodesChangedEvent() { + return hiddenNodesChangedEvent; + } + + public ChangedEvent getViewPropertiesChangedEvent() { + return viewPropertiesChangedEvent; + } + + public Set getSelectedNodes() { + return selectedNodes; + } + + public Set getHiddenNodes() { + return hiddenNodes; + } + + public Set getOnScreenNodes() { + return onScreenNodes; + } + + public void setSelectedNodes(Set nodes) { + this.selectedNodes = nodes; + List colors = new ArrayList<>(); + for (String s : getPositions()) { + colors.add(Color.black); + } + if (nodes.size() >= 1) { + for (Integer id : nodes) { + if (id < 0) { + id = -id; + } + InputNode last = null; + int index = 0; + for (InputGraph g : group.getGraphs()) { + Color curColor = colors.get(index); + InputNode cur = g.getNode(id); + if (cur != null) { + if (last == null) { + curColor = Color.green; + } else { + if (last.equals(cur)) { + if (curColor == Color.black) { + curColor = Color.white; + } + } else { + if (curColor != Color.green) { + curColor = Color.orange; + } + } + } + } + last = cur; + colors.set(index, curColor); + index++; + } + } + } + setColors(colors); + viewChangedEvent.fire(); + } + + public void showNot(final Set nodes) { + System.out.println("Shownot called with " + nodes); + setHiddenNodes(nodes); + } + + public void showFigures(Collection
f) { + HashSet newHiddenNodes = new HashSet<>(getHiddenNodes()); + for (Figure fig : f) { + newHiddenNodes.removeAll(fig.getSource().getSourceNodesAsSet()); + } + setHiddenNodes(newHiddenNodes); + } + + + public Set
getSelectedFigures() { + Set
result = new HashSet<>(); + for (Figure f : diagram.getFigures()) { + for (InputNode node : f.getSource().getSourceNodes()) { + if (getSelectedNodes().contains(node.getId())) { + result.add(f); + } + } + } + return result; + } + + public void showAll(final Collection
f) { + showFigures(f); + } + + public void showOnly(final Set nodes) { + final HashSet allNodes = new HashSet<>(getGraphToView().getGroup().getAllNodes()); + allNodes.removeAll(nodes); + setHiddenNodes(allNodes); + } + + public void setHiddenNodes(Set nodes) { + this.hiddenNodes = nodes; + hiddenNodesChangedEvent.fire(); + } + + public void setOnScreenNodes(Set onScreenNodes) { + this.onScreenNodes = onScreenNodes; + viewChangedEvent.fire(); + } + + public FilterChain getSequenceFilterChain() { + return filterChain; + } + + public void setSequenceFilterChain(FilterChain chain) { + assert chain != null : "sequenceFilterChain must never be null"; + sequenceFilterChain.getChangedEvent().removeListener(filterChainChangedListener); + sequenceFilterChain = chain; + sequenceFilterChain.getChangedEvent().addListener(filterChainChangedListener); + diagramChanged(); + } + + private void diagramChanged() { + // clear diagram + diagram = null; + getDiagramChangedEvent().fire(); + + } + + public FilterChain getFilterChain() { + return filterChain; + } + + public void setFilterChain(FilterChain chain) { + assert chain != null : "filterChain must never be null"; + filterChain.getChangedEvent().removeListener(filterChainChangedListener); + filterChain = chain; + filterChain.getChangedEvent().addListener(filterChainChangedListener); + diagramChanged(); + } + + private static List calculateStringList(Group g) { + List result = new ArrayList<>(); + for (InputGraph graph : g.getGraphs()) { + result.add(graph.getName()); + } + return result; + } + + public InputGraph getFirstGraph() { + List graphs = group.getGraphs(); + if (getFirstPosition() < graphs.size()) { + return graphs.get(getFirstPosition()); + } + return graphs.get(graphs.size() - 1); + } + + public InputGraph getSecondGraph() { + List graphs = group.getGraphs(); + if (getSecondPosition() < graphs.size()) { + return graphs.get(getSecondPosition()); + } + return getFirstGraph(); + } + + public void selectGraph(InputGraph g) { + int index = group.getGraphs().indexOf(g); + assert index != -1; + setPositions(index, index); + } + + public Diagram getDiagramToView() { + + if (diagram == null) { + diagram = Diagram.createDiagram(getGraphToView(), Settings.get().get(Settings.NODE_TEXT, Settings.NODE_TEXT_DEFAULT)); + getFilterChain().apply(diagram, getSequenceFilterChain()); + if (getFirstPosition() != getSecondPosition()) { + CustomFilter f = new CustomFilter( + "difference", "colorize('state', 'same', white);" + + "colorize('state', 'changed', orange);" + + "colorize('state', 'new', green);" + + "colorize('state', 'deleted', red);"); + f.apply(diagram); + } + } + + return diagram; + } + + public InputGraph getGraphToView() { + if (inputGraph == null) { + if (getFirstGraph() != getSecondGraph()) { + inputGraph = Difference.createDiffGraph(getFirstGraph(), getSecondGraph()); + } else { + inputGraph = getFirstGraph(); + } + } + + return inputGraph; + } + + @Override + public void changed(RangeSliderModel source) { + inputGraph = null; + diagramChanged(); + } + + void setSelectedFigures(List
list) { + Set newSelectedNodes = new HashSet<>(); + for (Figure f : list) { + newSelectedNodes.addAll(f.getSource().getSourceNodesAsSet()); + } + this.setSelectedNodes(newSelectedNodes); + } +} diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/Editor/src/com/oracle/graal/visualizer/editor/EditorInputGraphProvider.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/tools/IdealGraphVisualizer/Editor/src/com/oracle/graal/visualizer/editor/EditorInputGraphProvider.java Wed Feb 01 18:29:28 2012 +0100 @@ -0,0 +1,53 @@ +/* + * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.visualizer.editor; + +import com.sun.hotspot.igv.data.InputGraph; +import com.sun.hotspot.igv.data.InputNode; +import com.sun.hotspot.igv.data.services.InputGraphProvider; +import java.util.Set; + +/** + * + * @author Thomas Wuerthinger + */ +public class EditorInputGraphProvider implements InputGraphProvider { + + private EditorTopComponent editor; + + public EditorInputGraphProvider(EditorTopComponent editor) { + this.editor = editor; + } + + @Override + public InputGraph getGraph() { + return editor.getDiagramModel().getGraphToView(); + } + + @Override + public void setSelectedNodes(Set nodes) { + editor.setSelectedNodes(nodes); + } +} diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/Editor/src/com/oracle/graal/visualizer/editor/EditorTopComponent.form --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/tools/IdealGraphVisualizer/Editor/src/com/oracle/graal/visualizer/editor/EditorTopComponent.form Wed Feb 01 18:29:28 2012 +0100 @@ -0,0 +1,33 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/Editor/src/com/oracle/graal/visualizer/editor/EditorTopComponent.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/tools/IdealGraphVisualizer/Editor/src/com/oracle/graal/visualizer/editor/EditorTopComponent.java Wed Feb 01 18:29:28 2012 +0100 @@ -0,0 +1,351 @@ +/* + * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ +package com.oracle.graal.visualizer.editor; + +import com.oracle.graal.visualizer.editor.actions.NextDiagramAction; +import com.oracle.graal.visualizer.editor.actions.PrevDiagramAction; +import com.sun.hotspot.igv.data.ChangedEvent; +import com.sun.hotspot.igv.data.ChangedListener; +import com.sun.hotspot.igv.data.InputGraph; +import com.sun.hotspot.igv.data.InputNode; +import com.sun.hotspot.igv.data.services.InputGraphProvider; +import com.sun.hotspot.igv.filter.FilterChain; +import com.sun.hotspot.igv.filter.FilterChainProvider; +import com.sun.hotspot.igv.graph.Diagram; +import com.sun.hotspot.igv.graph.Figure; +import com.sun.hotspot.igv.graph.services.DiagramProvider; +import com.sun.hotspot.igv.util.LookupHistory; +import com.sun.hotspot.igv.util.RangeSlider; +import java.awt.BorderLayout; +import java.awt.Component; +import java.util.*; +import javax.swing.*; +import javax.swing.border.Border; +import org.openide.actions.RedoAction; +import org.openide.actions.UndoAction; +import org.openide.awt.Toolbar; +import org.openide.awt.ToolbarPool; +import org.openide.awt.UndoRedo; +import org.openide.util.Lookup; +import org.openide.util.NbBundle; +import org.openide.util.Utilities; +import org.openide.util.actions.Presenter; +import org.openide.util.lookup.AbstractLookup; +import org.openide.util.lookup.InstanceContent; +import org.openide.util.lookup.ProxyLookup; +import org.openide.windows.Mode; +import org.openide.windows.TopComponent; +import org.openide.windows.WindowManager; + +/** + * + * @author Thomas Wuerthinger + */ +public final class EditorTopComponent extends TopComponent { + + private InstanceContent content; + private InstanceContent graphContent; + private RangeSlider rangeSlider; + private static final String PREFERRED_ID = "EditorTopComponent"; + private DiagramViewModel rangeSliderModel; + private CompilationViewer viewer; + + + private DiagramProvider diagramProvider = new DiagramProvider() { + + @Override + public Diagram getDiagram() { + return getModel().getDiagramToView(); + } + + @Override + public ChangedEvent getChangedEvent() { + return diagramChangedEvent; + } + }; + + private ChangedEvent diagramChangedEvent = new ChangedEvent<>(diagramProvider); + + + private void updateDisplayName() { + setDisplayName(getDiagram().getName()); + } + + public EditorTopComponent(InputGraph graph) { + + LookupHistory.init(InputGraphProvider.class); + LookupHistory.init(DiagramProvider.class); + this.setFocusable(true); + FilterChain filterChain; + FilterChain sequence; + FilterChainProvider provider = Lookup.getDefault().lookup(FilterChainProvider.class); + if (provider == null) { + filterChain = new FilterChain(); + sequence = new FilterChain(); + } else { + filterChain = provider.getFilterChain(); + sequence = provider.getSequence(); + } + + setName(NbBundle.getMessage(EditorTopComponent.class, "CTL_EditorTopComponent")); + setToolTipText(NbBundle.getMessage(EditorTopComponent.class, "HINT_EditorTopComponent")); + + initComponents(); + + ToolbarPool.getDefault().setPreferredIconSize(16); + Toolbar toolBar = new Toolbar(); + Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N + toolBar.setBorder(b); + this.add(BorderLayout.NORTH, toolBar); + + rangeSliderModel = new DiagramViewModel(graph.getGroup(), filterChain, sequence); + rangeSlider = new RangeSlider(); + rangeSlider.setModel(rangeSliderModel); + + CompilationViewerFactory factory = Lookup.getDefault().lookup(CompilationViewerFactory.class); + viewer = factory.createViewer(rangeSliderModel); + content = new InstanceContent(); + graphContent = new InstanceContent(); + this.associateLookup(new ProxyLookup(new Lookup[]{viewer.getLookup(), new AbstractLookup(graphContent), new AbstractLookup(content)})); + content.add(rangeSliderModel); + content.add(diagramProvider); + + rangeSliderModel.getDiagramChangedEvent().addListener(diagramChangedListener); + rangeSliderModel.selectGraph(graph); + + toolBar.add(PrevDiagramAction.get(PrevDiagramAction.class)); + toolBar.add(NextDiagramAction.get(NextDiagramAction.class)); + + toolBar.addSeparator(); + toolBar.add(UndoAction.get(UndoAction.class)); + toolBar.add(RedoAction.get(RedoAction.class)); + + toolBar.addSeparator(); + + Action action = Utilities.actionsForPath("QuickSearchShadow").get(0); + Component quicksearch = ((Presenter.Toolbar) action).getToolbarPresenter(); + quicksearch.setMinimumSize(quicksearch.getPreferredSize()); // necessary for GTK LAF + toolBar.add(quicksearch); + + toolBar.add(Box.createHorizontalGlue()); + toolBar.add(viewer.getToolBarComponent()); + + JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, + new JScrollPane(rangeSlider), viewer.getComponent()); + splitPane.setOneTouchExpandable(true); + splitPane.setDividerLocation(250); + this.add(splitPane, BorderLayout.CENTER); + + updateDisplayName(); + } + + public DiagramViewModel getDiagramModel() { + return rangeSliderModel; + } + + public void showPrevDiagram() { + int fp = getModel().getFirstPosition(); + int sp = getModel().getSecondPosition(); + if (fp != 0) { + fp--; + sp--; + getModel().setPositions(fp, sp); + } + } + + public DiagramViewModel getModel() { + return rangeSliderModel; + } + + public FilterChain getFilterChain() { + return getModel().getFilterChain(); + } + + public static EditorTopComponent getActive() { + Set modes = WindowManager.getDefault().getModes(); + for (Mode m : modes) { + TopComponent tc = m.getSelectedTopComponent(); + if (tc instanceof EditorTopComponent) { + return (EditorTopComponent) tc; + } + } + return null; + } + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + + jCheckBox1 = new javax.swing.JCheckBox(); + + org.openide.awt.Mnemonics.setLocalizedText(jCheckBox1, "jCheckBox1"); + jCheckBox1.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); + jCheckBox1.setMargin(new java.awt.Insets(0, 0, 0, 0)); + + setLayout(new java.awt.BorderLayout()); + }// //GEN-END:initComponents + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JCheckBox jCheckBox1; + // End of variables declaration//GEN-END:variables + + @Override + public int getPersistenceType() { + return TopComponent.PERSISTENCE_NEVER; + } + + @Override + public void componentOpened() { + } + + @Override + public void componentClosed() { + } + + @Override + protected String preferredID() { + return PREFERRED_ID; + } + + private ChangedListener diagramChangedListener = new ChangedListener() { + + @Override + public void changed(DiagramViewModel source) { + updateDisplayName(); + Collection list = new ArrayList<>(); + list.add(new EditorInputGraphProvider(EditorTopComponent.this)); + graphContent.set(list, null); + diagramProvider.getChangedEvent().fire(); + } + + }; + + public void setSelectedFigures(List
list) { + viewer.setSelection(list); + } + + public void setSelectedNodes(Set nodes) { + + List
list = new ArrayList<>(); + Set ids = new HashSet<>(); + for (InputNode n : nodes) { + ids.add(n.getId()); + } + + for (Figure f : getModel().getDiagramToView().getFigures()) { + for (InputNode n : f.getSource().getSourceNodes()) { + if (ids.contains(n.getId())) { + list.add(f); + break; + } + } + } + + setSelectedFigures(list); + } + + public void extract() { + getModel().showOnly(getModel().getSelectedNodes()); + } + + public void hideNodes() { + Set selectedNodes = this.getModel().getSelectedNodes(); + HashSet nodes = new HashSet<>(getModel().getHiddenNodes()); + nodes.addAll(selectedNodes); + this.getModel().showNot(nodes); + } + + public void expandPredecessors() { + Set
oldSelection = getModel().getSelectedFigures(); + Set
figures = new HashSet<>(); + + for (Figure f : this.getDiagramModel().getDiagramToView().getFigures()) { + boolean ok = false; + if (oldSelection.contains(f)) { + ok = true; + } else { + for (Figure pred : f.getSuccessors()) { + if (oldSelection.contains(pred)) { + ok = true; + break; + } + } + } + + if (ok) { + figures.add(f); + } + } + + getModel().showAll(figures); + } + + public void expandSuccessors() { + Set
oldSelection = getModel().getSelectedFigures(); + Set
figures = new HashSet<>(); + + for (Figure f : this.getDiagramModel().getDiagramToView().getFigures()) { + boolean ok = false; + if (oldSelection.contains(f)) { + ok = true; + } else { + for (Figure succ : f.getPredecessors()) { + if (oldSelection.contains(succ)) { + ok = true; + break; + } + } + } + + if (ok) { + figures.add(f); + } + } + + getModel().showAll(figures); + } + + public void showAll() { + getModel().showNot(new HashSet()); + } + + public Diagram getDiagram() { + return getDiagramModel().getDiagramToView(); + } + + @Override + public void requestActive() { + super.requestActive(); + viewer.getComponent().requestFocus(); + } + + @Override + public UndoRedo getUndoRedo() { + return viewer.getUndoRedo(); + } + +} diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/Editor/src/com/oracle/graal/visualizer/editor/ExportCookie.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/tools/IdealGraphVisualizer/Editor/src/com/oracle/graal/visualizer/editor/ExportCookie.java Wed Feb 01 18:29:28 2012 +0100 @@ -0,0 +1,36 @@ +/* + * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.visualizer.editor; + +import java.io.File; + +/** + * + * @author Thomas Wuerthinger + */ +public interface ExportCookie { + + void export(File f); +} diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/Editor/src/com/oracle/graal/visualizer/editor/GraphViewerImplementation.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/tools/IdealGraphVisualizer/Editor/src/com/oracle/graal/visualizer/editor/GraphViewerImplementation.java Wed Feb 01 18:29:28 2012 +0100 @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ +package com.oracle.graal.visualizer.editor; + +import com.sun.hotspot.igv.data.InputGraph; +import com.sun.hotspot.igv.data.services.GraphViewer; + +/** + * + * @author Thomas Wuerthinger + */ +public class GraphViewerImplementation implements GraphViewer { + + @Override + public void view(InputGraph graph) { + EditorTopComponent tc = new EditorTopComponent(graph); + tc.open(); + tc.requestActive(); + } +} diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/Editor/src/com/oracle/graal/visualizer/editor/NodeQuickSearch.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/tools/IdealGraphVisualizer/Editor/src/com/oracle/graal/visualizer/editor/NodeQuickSearch.java Wed Feb 01 18:29:28 2012 +0100 @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ +package com.oracle.graal.visualizer.editor; + +import com.sun.hotspot.igv.data.InputNode; +import com.sun.hotspot.igv.data.Properties; +import com.sun.hotspot.igv.data.Properties.RegexpPropertyMatcher; +import com.sun.hotspot.igv.data.services.InputGraphProvider; +import com.sun.hotspot.igv.util.LookupHistory; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.regex.Pattern; +import org.netbeans.spi.quicksearch.SearchProvider; +import org.netbeans.spi.quicksearch.SearchRequest; +import org.netbeans.spi.quicksearch.SearchResponse; +import org.openide.DialogDisplayer; +import org.openide.NotifyDescriptor; +import org.openide.NotifyDescriptor.Message; + +/** + * + * @author Thomas Wuerthinger + */ +public class NodeQuickSearch implements SearchProvider { + + private static final String DEFAULT_PROPERTY = "name"; + + /** + * Method is called by infrastructure when search operation was requested. + * Implementors should evaluate given request and fill response object with + * apropriate results + * + * @param request Search request object that contains information what to search for + * @param response Search response object that stores search results. Note that it's important to react to return value of SearchResponse.addResult(...) method and stop computation if false value is returned. + */ + @Override + public void evaluate(SearchRequest request, SearchResponse response) { + String query = request.getText(); + if (query.trim().isEmpty()) { + return; + } + + final String[] parts = query.split("=", 2); + + String name; + String value; + + if (parts.length == 1) { + name = DEFAULT_PROPERTY; + value = ".*" + Pattern.quote(parts[0]) + ".*"; + } else { + name = parts[0]; + value = parts[1]; + } + + if (value.isEmpty()) { + value = ".*"; + } + + final InputGraphProvider p = LookupHistory.getLast(InputGraphProvider.class); + if (p != null && p.getGraph() != null) { + List matches = null; + try { + RegexpPropertyMatcher matcher = new RegexpPropertyMatcher(name, value, Pattern.CASE_INSENSITIVE); + Properties.PropertySelector selector = new Properties.PropertySelector<>(p.getGraph().getNodes()); + + matches = selector.selectMultiple(matcher); + } catch (Exception e) { + final String msg = e.getMessage(); + response.addResult(new Runnable() { + @Override + public void run() { + Message desc = new NotifyDescriptor.Message("An exception occurred during the search, " + + "perhaps due to a malformed query string:\n" + msg, + NotifyDescriptor.WARNING_MESSAGE); + DialogDisplayer.getDefault().notify(desc); + } + }, + "(Error during search)" + ); + } + + if (matches != null) { + final Set set = new HashSet<>(matches); + response.addResult(new Runnable() { + @Override + public void run() { + final EditorTopComponent comp = EditorTopComponent.getActive(); + if (comp != null) { + comp.setSelectedNodes(set); + comp.requestActive(); + } + } + }, + "All " + matches.size() + " matching nodes (" + name + "=" + value + ")" + ); + + // Single matches + for (final InputNode n : matches) { + response.addResult(new Runnable() { + @Override + public void run() { + final EditorTopComponent comp = EditorTopComponent.getActive(); + if (comp != null) { + final Set tmpSet = new HashSet<>(); + tmpSet.add(n); + comp.setSelectedNodes(tmpSet); + comp.requestActive(); + } + } + }, + n.getProperties().get(name) + " (" + n.getId() + " " + n.getProperties().get("name") + ")" + ); + } + } + } else { + System.out.println("no input graph provider!"); + } + } +} diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/Editor/src/com/oracle/graal/visualizer/editor/actions/NextDiagramAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/tools/IdealGraphVisualizer/Editor/src/com/oracle/graal/visualizer/editor/actions/NextDiagramAction.java Wed Feb 01 18:29:28 2012 +0100 @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ +package com.oracle.graal.visualizer.editor.actions; + +import com.sun.hotspot.igv.data.ChangedListener; +import com.sun.hotspot.igv.util.ContextAction; +import com.oracle.graal.visualizer.editor.DiagramViewModel; +import javax.swing.Action; +import javax.swing.ImageIcon; +import org.openide.awt.ActionID; +import org.openide.awt.ActionReference; +import org.openide.awt.ActionRegistration; +import org.openide.util.*; + +/** + * + * @author Thomas Wuerthinger + */ +@ActionID(id = "com.oracle.graal.visualizer.editor.actions.NextDiagramAction", category = "View") +@ActionRegistration(displayName = "Next snapshot") +@ActionReference(path = "Menu/View", position = 150) +public final class NextDiagramAction extends ContextAction implements ChangedListener { + + private DiagramViewModel model; + + public NextDiagramAction() { + this(Utilities.actionsGlobalContext()); + } + + public NextDiagramAction(Lookup lookup) { + putValue(Action.SHORT_DESCRIPTION, "Show next graph of current group"); + putValue(Action.SMALL_ICON, new ImageIcon(ImageUtilities.loadImage("com/sun/hotspot/igv/view/images/next_diagram.png"))); + } + + @Override + public String getName() { + return "Next snapshot"; + } + + @Override + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + public Class contextClass() { + return DiagramViewModel.class; + } + + @Override + public void performAction(DiagramViewModel model) { + int fp = model.getFirstPosition(); + int sp = model.getSecondPosition(); + if (sp != model.getPositions().size() - 1) { + int nfp = fp + 1; + int nsp = sp + 1; + model.setPositions(nfp, nsp); + } + } + + @Override + public void update(DiagramViewModel model) { + super.update(model); + + if (this.model != model) { + if (this.model != null) { + this.model.getDiagramChangedEvent().removeListener(this); + } + + this.model = model; + if (this.model != null) { + this.model.getDiagramChangedEvent().addListener(this); + } + } + } + + @Override + public boolean isEnabled(DiagramViewModel model) { + return model.getSecondPosition() != model.getPositions().size() - 1; + } + + @Override + public Action createContextAwareInstance(Lookup arg0) { + return new NextDiagramAction(arg0); + } + + @Override + public void changed(DiagramViewModel source) { + update(source); + } +} diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/Editor/src/com/oracle/graal/visualizer/editor/actions/PrevDiagramAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/tools/IdealGraphVisualizer/Editor/src/com/oracle/graal/visualizer/editor/actions/PrevDiagramAction.java Wed Feb 01 18:29:28 2012 +0100 @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ +package com.oracle.graal.visualizer.editor.actions; + +import com.sun.hotspot.igv.data.ChangedListener; +import com.sun.hotspot.igv.util.ContextAction; +import com.oracle.graal.visualizer.editor.DiagramViewModel; +import javax.swing.Action; +import javax.swing.ImageIcon; +import org.openide.awt.ActionID; +import org.openide.awt.ActionReference; +import org.openide.awt.ActionRegistration; +import org.openide.util.*; + +/** + * + * @author Thomas Wuerthinger + */ +@ActionID(id = "com.oracle.graal.visualizer.editor.actions.PrevDiagramAction", category = "View") +@ActionRegistration(displayName = "Previous snapshot") +@ActionReference(path = "Menu/View", position = 100) +public final class PrevDiagramAction extends ContextAction implements ChangedListener { + + private DiagramViewModel model; + + public PrevDiagramAction() { + this(Utilities.actionsGlobalContext()); + } + + public PrevDiagramAction(Lookup lookup) { + putValue(Action.SHORT_DESCRIPTION, "Show previous graph of current group"); + putValue(Action.SMALL_ICON, new ImageIcon(ImageUtilities.loadImage("com/sun/hotspot/igv/view/images/prev_diagram.png"))); + } + + @Override + public String getName() { + return "Previous snapshot"; + } + + @Override + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + public Class contextClass() { + return DiagramViewModel.class; + } + + @Override + public void performAction(DiagramViewModel model) { + int fp = model.getFirstPosition(); + int sp = model.getSecondPosition(); + if (fp != 0) { + int nfp = fp - 1; + int nsp = sp - 1; + model.setPositions(nfp, nsp); + } + } + + @Override + public void update(DiagramViewModel model) { + super.update(model); + + if (this.model != model) { + if (this.model != null) { + this.model.getDiagramChangedEvent().removeListener(this); + } + + this.model = model; + if (this.model != null) { + this.model.getDiagramChangedEvent().addListener(this); + } + } + } + + @Override + public boolean isEnabled(DiagramViewModel model) { + return model.getFirstPosition() != 0; + } + + @Override + public Action createContextAwareInstance(Lookup arg0) { + return new PrevDiagramAction(arg0); + } + + @Override + public void changed(DiagramViewModel source) { + update(source); + } +} diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/Editor/src/com/oracle/graal/visualizer/editor/layer.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/tools/IdealGraphVisualizer/Editor/src/com/oracle/graal/visualizer/editor/layer.xml Wed Feb 01 18:29:28 2012 +0100 @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/nbproject/project.xml --- a/src/share/tools/IdealGraphVisualizer/View/nbproject/project.xml Wed Feb 01 17:48:37 2012 +0100 +++ b/src/share/tools/IdealGraphVisualizer/View/nbproject/project.xml Wed Feb 01 18:29:28 2012 +0100 @@ -1,175 +1,183 @@ - - - org.netbeans.modules.apisupport.project - - - com.sun.hotspot.igv.view - - - - com.sun.hotspot.igv.data - - - - 1.0 - - - - com.sun.hotspot.igv.difference - - - - 1.0 - - - - com.sun.hotspot.igv.filter - - - - 1.0 - - - - com.sun.hotspot.igv.graph - - - - 1.0 - - - - com.sun.hotspot.igv.hierarchicallayout - - - - 1.0 - - - - com.sun.hotspot.igv.layout - - - - 1.0 - - - - com.sun.hotspot.igv.selectioncoordinator - - - - 1.0 - - - - com.sun.hotspot.igv.settings - - - - 1.0 - - - - com.sun.hotspot.igv.svg - - - - 1.0 - - - - com.sun.hotspot.igv.util - - - - 1.0 - - - - org.netbeans.api.visual - - - - 2.27.1 - - - - org.netbeans.spi.quicksearch - - - - 1.0 - - - - org.openide.actions - - - - 6.21.1 - - - - org.openide.awt - - - - 7.30.1 - - - - org.openide.dialogs - - - - 7.18.1 - - - - org.openide.loaders - - - - 7.20.1 - - - - org.openide.nodes - - - - 7.20.1 - - - - org.openide.util - - - - 8.14.1 - - - - org.openide.util.lookup - - - - 8.6.1 - - - - org.openide.windows - - - - 6.39.1 - - - - - com.sun.hotspot.igv.view - - - - + + + org.netbeans.modules.apisupport.project + + + com.sun.hotspot.igv.view + + + + com.oracle.graal.visualizer.editor + + + + 1.0 + + + + com.sun.hotspot.igv.data + + + + 1.0 + + + + com.sun.hotspot.igv.difference + + + + 1.0 + + + + com.sun.hotspot.igv.filter + + + + 1.0 + + + + com.sun.hotspot.igv.graph + + + + 1.0 + + + + com.sun.hotspot.igv.hierarchicallayout + + + + 1.0 + + + + com.sun.hotspot.igv.layout + + + + 1.0 + + + + com.sun.hotspot.igv.selectioncoordinator + + + + 1.0 + + + + com.sun.hotspot.igv.settings + + + + 1.0 + + + + com.sun.hotspot.igv.svg + + + + 1.0 + + + + com.sun.hotspot.igv.util + + + + 1.0 + + + + org.netbeans.api.visual + + + + 2.27.1 + + + + org.netbeans.spi.quicksearch + + + + 1.0 + + + + org.openide.actions + + + + 6.21.1 + + + + org.openide.awt + + + + 7.30.1 + + + + org.openide.dialogs + + + + 7.18.1 + + + + org.openide.loaders + + + + 7.20.1 + + + + org.openide.nodes + + + + 7.20.1 + + + + org.openide.util + + + + 8.14.1 + + + + org.openide.util.lookup + + + + 8.6.1 + + + + org.openide.windows + + + + 6.39.1 + + + + + com.sun.hotspot.igv.view + + + + diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/META-INF/services/com.oracle.graal.visualizer.editor.CompilationViewerFactory --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/tools/IdealGraphVisualizer/View/src/META-INF/services/com.oracle.graal.visualizer.editor.CompilationViewerFactory Wed Feb 01 18:29:28 2012 +0100 @@ -0,0 +1,1 @@ +com.sun.hotspot.igv.view.scene.GraphCompilationViewerFactory diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/META-INF/services/com.sun.hotspot.igv.data.services.GraphViewer --- a/src/share/tools/IdealGraphVisualizer/View/src/META-INF/services/com.sun.hotspot.igv.data.services.GraphViewer Wed Feb 01 17:48:37 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -com.sun.hotspot.igv.view.GraphViewerImplementation diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/META-INF/services/com.sun.hotspot.igv.view.CompilationViewerFactory --- a/src/share/tools/IdealGraphVisualizer/View/src/META-INF/services/com.sun.hotspot.igv.view.CompilationViewerFactory Wed Feb 01 17:48:37 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -com.sun.hotspot.igv.view.scene.GraphCompilationViewerFactory diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/BoundedZoomAction.java --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/BoundedZoomAction.java Wed Feb 01 17:48:37 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,175 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ -package com.sun.hotspot.igv.view; - -import java.awt.Container; -import java.awt.Dimension; -import java.awt.Point; -import java.awt.Rectangle; -import javax.swing.JComponent; -import javax.swing.JScrollPane; -import org.netbeans.api.visual.action.WidgetAction; -import org.netbeans.api.visual.action.WidgetAction.State; -import org.netbeans.api.visual.action.WidgetAction.WidgetMouseWheelEvent; -import org.netbeans.api.visual.animator.SceneAnimator; -import org.netbeans.api.visual.widget.Scene; -import org.netbeans.api.visual.widget.Widget; - -/** - * - * @author Thomas Wuerthinger - */ -public class BoundedZoomAction extends WidgetAction.Adapter { - - private double minFactor = 0.0; - private double maxFactor = Double.MAX_VALUE; - private double zoomMultiplier; - private boolean useAnimator; - - public BoundedZoomAction(double zoomMultiplier, boolean useAnimator) { - assert zoomMultiplier > 1.0; - this.zoomMultiplier = zoomMultiplier; - this.useAnimator = useAnimator; - } - - public double getMinFactor() { - return minFactor; - } - - public void setMinFactor(double d) { - minFactor = d; - } - - public double getMaxFactor() { - return maxFactor; - } - - public void setMaxFactor(double d) { - maxFactor = d; - } - - private JScrollPane findScrollPane(JComponent component) { - for (;;) { - if (component == null) { - return null; - } - if (component instanceof JScrollPane) { - return ((JScrollPane) component); - } - Container parent = component.getParent(); - if (!(parent instanceof JComponent)) { - return null; - } - component = (JComponent) parent; - } - } - - @Override - public State mouseWheelMoved(Widget widget, WidgetMouseWheelEvent event) { - final Scene scene = widget.getScene(); - int amount = event.getWheelRotation(); - JScrollPane scrollPane = findScrollPane(scene.getView()); - Point viewPosition = null; - Point mouseLocation = scene.convertSceneToView(event.getPoint()); - int xOffset = 0; - int yOffset = 0; - Rectangle bounds = new Rectangle(scene.getBounds()); - Dimension componentSize = new Dimension(scene.getView().getPreferredSize()); - if (scrollPane != null) { - viewPosition = new Point(scrollPane.getViewport().getViewPosition()); - xOffset = (mouseLocation.x - viewPosition.x); - yOffset = (mouseLocation.y - viewPosition.y); - viewPosition.x += xOffset; - viewPosition.y += yOffset; - } - - if (useAnimator) { - SceneAnimator sceneAnimator = scene.getSceneAnimator(); - synchronized (sceneAnimator) { - double zoom = sceneAnimator.isAnimatingZoomFactor() ? sceneAnimator.getTargetZoomFactor() : scene.getZoomFactor(); - while (amount > 0 && zoom / zoomMultiplier >= minFactor) { - zoom /= zoomMultiplier; - if (viewPosition != null) { - viewPosition.x /= zoomMultiplier; - viewPosition.y /= zoomMultiplier; - bounds.width /= zoomMultiplier; - bounds.height /= zoomMultiplier; - componentSize.width /= zoomMultiplier; - componentSize.height /= zoomMultiplier; - } - amount--; - } - while (amount < 0 && zoom * zoomMultiplier <= maxFactor) { - zoom *= zoomMultiplier; - if (viewPosition != null) { - viewPosition.x *= zoomMultiplier; - viewPosition.y *= zoomMultiplier; - bounds.width *= zoomMultiplier; - bounds.height *= zoomMultiplier; - componentSize.width *= zoomMultiplier; - componentSize.height *= zoomMultiplier; - } - amount++; - } - sceneAnimator.animateZoomFactor(zoom); - } - } else { - double zoom = scene.getZoomFactor(); - while (amount > 0 && zoom / zoomMultiplier >= minFactor) { - zoom /= zoomMultiplier; - if (viewPosition != null) { - viewPosition.x /= zoomMultiplier; - viewPosition.y /= zoomMultiplier; - bounds.width /= zoomMultiplier; - bounds.height /= zoomMultiplier; - componentSize.width /= zoomMultiplier; - componentSize.height /= zoomMultiplier; - } - amount--; - } - while (amount < 0 && zoom * zoomMultiplier <= maxFactor) { - zoom *= zoomMultiplier; - if (viewPosition != null) { - viewPosition.x *= zoomMultiplier; - viewPosition.y *= zoomMultiplier; - bounds.width *= zoomMultiplier; - bounds.height *= zoomMultiplier; - componentSize.width *= zoomMultiplier; - componentSize.height *= zoomMultiplier; - } - amount++; - } - scene.setZoomFactor(zoom); - } - - if (scrollPane != null) { - viewPosition.x -= xOffset; - viewPosition.y -= yOffset; - scrollPane.getViewport().setViewPosition(viewPosition); - } - - - return WidgetAction.State.CONSUMED; - } -} diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/Bundle.properties --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/Bundle.properties Wed Feb 01 17:48:37 2012 +0100 +++ b/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/Bundle.properties Wed Feb 01 18:29:28 2012 +0100 @@ -1,3 +1,1 @@ -HINT_EditorTopComponent=Visualizes a graph. -OpenIDE-Module-Name=View -CTL_EditorTopComponent=Graph \ No newline at end of file +OpenIDE-Module-Name=View \ No newline at end of file diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/CompilationViewer.java --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/CompilationViewer.java Wed Feb 01 17:48:37 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -package com.sun.hotspot.igv.view; - -import com.sun.hotspot.igv.graph.Figure; -import java.awt.Component; -import java.awt.Graphics2D; -import java.util.Collection; -import org.openide.awt.UndoRedo; -import org.openide.util.Lookup; - -/** - * - * @author Thomas Wuerthinger - */ -public interface CompilationViewer { - - public Lookup getLookup(); - - public Component getComponent(); - - public Component getToolBarComponent(); - - public UndoRedo getUndoRedo(); - - public void setSelection(Collection
list); - - public void paint(Graphics2D svgGenerator); - - public void zoomOut(); - - public void zoomIn(); -} diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/CompilationViewerFactory.java --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/CompilationViewerFactory.java Wed Feb 01 17:48:37 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ -package com.sun.hotspot.igv.view; - -public interface CompilationViewerFactory { - CompilationViewer createViewer(DiagramViewModel model); - String getName(); -} diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/DiagramViewModel.java --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/DiagramViewModel.java Wed Feb 01 17:48:37 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,388 +0,0 @@ -/* - * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.hotspot.igv.view; - -import com.sun.hotspot.igv.data.*; -import com.sun.hotspot.igv.difference.Difference; -import com.sun.hotspot.igv.filter.CustomFilter; -import com.sun.hotspot.igv.filter.FilterChain; -import com.sun.hotspot.igv.graph.Diagram; -import com.sun.hotspot.igv.graph.Figure; -import com.sun.hotspot.igv.settings.Settings; -import com.sun.hotspot.igv.util.RangeSliderModel; -import java.awt.Color; -import java.util.*; - -/** - * - * @author Thomas Wuerthinger - */ -public class DiagramViewModel extends RangeSliderModel implements ChangedListener { - - // Warning: Update setData method if fields are added - private Group group; - private Set hiddenNodes; - private Set onScreenNodes; - private Set selectedNodes; - private FilterChain filterChain; - private FilterChain sequenceFilterChain; - private Diagram diagram; - private InputGraph inputGraph; - private ChangedEvent groupChangedEvent; - private ChangedEvent diagramChangedEvent; - private ChangedEvent viewChangedEvent; - private ChangedEvent hiddenNodesChangedEvent; - private ChangedEvent viewPropertiesChangedEvent; - private boolean showNodeHull; - private ChangedListener filterChainChangedListener = new ChangedListener() { - - @Override - public void changed(FilterChain source) { - diagramChanged(); - } - }; - - @Override - public DiagramViewModel copy() { - DiagramViewModel result = new DiagramViewModel(group, filterChain, sequenceFilterChain); - result.setData(this); - return result; - } - - public void setData(DiagramViewModel newModel) { - super.setData(newModel); - boolean diagramChanged = false; - boolean viewChanged = false; - boolean viewPropertiesChanged = false; - - boolean groupChanged = (group == newModel.group); - this.group = newModel.group; - diagramChanged |= (filterChain != newModel.filterChain); - this.filterChain = newModel.filterChain; - diagramChanged |= (sequenceFilterChain != newModel.sequenceFilterChain); - this.sequenceFilterChain = newModel.sequenceFilterChain; - diagramChanged |= (diagram != newModel.diagram); - this.diagram = newModel.diagram; - viewChanged |= (hiddenNodes != newModel.hiddenNodes); - this.hiddenNodes = newModel.hiddenNodes; - viewChanged |= (onScreenNodes != newModel.onScreenNodes); - this.onScreenNodes = newModel.onScreenNodes; - viewChanged |= (selectedNodes != newModel.selectedNodes); - this.selectedNodes = newModel.selectedNodes; - viewPropertiesChanged |= (showNodeHull != newModel.showNodeHull); - this.showNodeHull = newModel.showNodeHull; - - if (groupChanged) { - groupChangedEvent.fire(); - } - - if (diagramChanged) { - diagramChangedEvent.fire(); - } - if (viewPropertiesChanged) { - viewPropertiesChangedEvent.fire(); - } - if (viewChanged) { - viewChangedEvent.fire(); - } - } - - public boolean getShowNodeHull() { - return showNodeHull; - } - - public void setShowNodeHull(boolean b) { - showNodeHull = b; - viewPropertiesChangedEvent.fire(); - } - - public DiagramViewModel(Group g, FilterChain filterChain, FilterChain sequenceFilterChain) { - super(calculateStringList(g)); - - this.showNodeHull = true; - this.group = g; - assert filterChain != null; - this.filterChain = filterChain; - assert sequenceFilterChain != null; - this.sequenceFilterChain = sequenceFilterChain; - hiddenNodes = new HashSet<>(); - onScreenNodes = new HashSet<>(); - selectedNodes = new HashSet<>(); - super.getChangedEvent().addListener(this); - diagramChangedEvent = new ChangedEvent<>(this); - viewChangedEvent = new ChangedEvent<>(this); - hiddenNodesChangedEvent = new ChangedEvent<>(this); - viewPropertiesChangedEvent = new ChangedEvent<>(this); - - groupChangedEvent = new ChangedEvent<>(this); - groupChangedEvent.addListener(groupChangedListener); - groupChangedEvent.fire(); - - filterChain.getChangedEvent().addListener(filterChainChangedListener); - sequenceFilterChain.getChangedEvent().addListener(filterChainChangedListener); - } - private final ChangedListener groupChangedListener = new ChangedListener() { - - private Group oldGroup; - - @Override - public void changed(DiagramViewModel source) { - if (oldGroup != null) { - oldGroup.getChangedEvent().removeListener(groupContentChangedListener); - } - group.getChangedEvent().addListener(groupContentChangedListener); - oldGroup = group; - } - }; - private final ChangedListener groupContentChangedListener = new ChangedListener() { - - @Override - public void changed(Group source) { - assert source == group; - setPositions(calculateStringList(source)); - setSelectedNodes(selectedNodes); - } - }; - - public ChangedEvent getDiagramChangedEvent() { - return diagramChangedEvent; - } - - public ChangedEvent getViewChangedEvent() { - return viewChangedEvent; - } - - public ChangedEvent getHiddenNodesChangedEvent() { - return hiddenNodesChangedEvent; - } - - public ChangedEvent getViewPropertiesChangedEvent() { - return viewPropertiesChangedEvent; - } - - public Set getSelectedNodes() { - return selectedNodes; - } - - public Set getHiddenNodes() { - return hiddenNodes; - } - - public Set getOnScreenNodes() { - return onScreenNodes; - } - - public void setSelectedNodes(Set nodes) { - this.selectedNodes = nodes; - List colors = new ArrayList<>(); - for (String s : getPositions()) { - colors.add(Color.black); - } - if (nodes.size() >= 1) { - for (Integer id : nodes) { - if (id < 0) { - id = -id; - } - InputNode last = null; - int index = 0; - for (InputGraph g : group.getGraphs()) { - Color curColor = colors.get(index); - InputNode cur = g.getNode(id); - if (cur != null) { - if (last == null) { - curColor = Color.green; - } else { - if (last.equals(cur)) { - if (curColor == Color.black) { - curColor = Color.white; - } - } else { - if (curColor != Color.green) { - curColor = Color.orange; - } - } - } - } - last = cur; - colors.set(index, curColor); - index++; - } - } - } - setColors(colors); - viewChangedEvent.fire(); - } - - public void showNot(final Set nodes) { - System.out.println("Shownot called with " + nodes); - setHiddenNodes(nodes); - } - - public void showFigures(Collection
f) { - HashSet newHiddenNodes = new HashSet<>(getHiddenNodes()); - for (Figure fig : f) { - newHiddenNodes.removeAll(fig.getSource().getSourceNodesAsSet()); - } - setHiddenNodes(newHiddenNodes); - } - - - public Set
getSelectedFigures() { - Set
result = new HashSet<>(); - for (Figure f : diagram.getFigures()) { - for (InputNode node : f.getSource().getSourceNodes()) { - if (getSelectedNodes().contains(node.getId())) { - result.add(f); - } - } - } - return result; - } - - public void showAll(final Collection
f) { - showFigures(f); - } - - public void showOnly(final Set nodes) { - final HashSet allNodes = new HashSet<>(getGraphToView().getGroup().getAllNodes()); - allNodes.removeAll(nodes); - setHiddenNodes(allNodes); - } - - public void setHiddenNodes(Set nodes) { - this.hiddenNodes = nodes; - hiddenNodesChangedEvent.fire(); - } - - public void setOnScreenNodes(Set onScreenNodes) { - this.onScreenNodes = onScreenNodes; - viewChangedEvent.fire(); - } - - public FilterChain getSequenceFilterChain() { - return filterChain; - } - - public void setSequenceFilterChain(FilterChain chain) { - assert chain != null : "sequenceFilterChain must never be null"; - sequenceFilterChain.getChangedEvent().removeListener(filterChainChangedListener); - sequenceFilterChain = chain; - sequenceFilterChain.getChangedEvent().addListener(filterChainChangedListener); - diagramChanged(); - } - - private void diagramChanged() { - // clear diagram - diagram = null; - getDiagramChangedEvent().fire(); - - } - - public FilterChain getFilterChain() { - return filterChain; - } - - public void setFilterChain(FilterChain chain) { - assert chain != null : "filterChain must never be null"; - filterChain.getChangedEvent().removeListener(filterChainChangedListener); - filterChain = chain; - filterChain.getChangedEvent().addListener(filterChainChangedListener); - diagramChanged(); - } - - private static List calculateStringList(Group g) { - List result = new ArrayList<>(); - for (InputGraph graph : g.getGraphs()) { - result.add(graph.getName()); - } - return result; - } - - public InputGraph getFirstGraph() { - List graphs = group.getGraphs(); - if (getFirstPosition() < graphs.size()) { - return graphs.get(getFirstPosition()); - } - return graphs.get(graphs.size() - 1); - } - - public InputGraph getSecondGraph() { - List graphs = group.getGraphs(); - if (getSecondPosition() < graphs.size()) { - return graphs.get(getSecondPosition()); - } - return getFirstGraph(); - } - - public void selectGraph(InputGraph g) { - int index = group.getGraphs().indexOf(g); - assert index != -1; - setPositions(index, index); - } - - public Diagram getDiagramToView() { - - if (diagram == null) { - diagram = Diagram.createDiagram(getGraphToView(), Settings.get().get(Settings.NODE_TEXT, Settings.NODE_TEXT_DEFAULT)); - getFilterChain().apply(diagram, getSequenceFilterChain()); - if (getFirstPosition() != getSecondPosition()) { - CustomFilter f = new CustomFilter( - "difference", "colorize('state', 'same', white);" - + "colorize('state', 'changed', orange);" - + "colorize('state', 'new', green);" - + "colorize('state', 'deleted', red);"); - f.apply(diagram); - } - } - - return diagram; - } - - public InputGraph getGraphToView() { - if (inputGraph == null) { - if (getFirstGraph() != getSecondGraph()) { - inputGraph = Difference.createDiffGraph(getFirstGraph(), getSecondGraph()); - } else { - inputGraph = getFirstGraph(); - } - } - - return inputGraph; - } - - @Override - public void changed(RangeSliderModel source) { - inputGraph = null; - diagramChanged(); - } - - void setSelectedFigures(List
list) { - Set newSelectedNodes = new HashSet<>(); - for (Figure f : list) { - newSelectedNodes.addAll(f.getSource().getSourceNodesAsSet()); - } - this.setSelectedNodes(newSelectedNodes); - } -} diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/EditorInputGraphProvider.java --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/EditorInputGraphProvider.java Wed Feb 01 17:48:37 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* - * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.hotspot.igv.view; - -import com.sun.hotspot.igv.data.InputGraph; -import com.sun.hotspot.igv.data.InputNode; -import com.sun.hotspot.igv.data.services.InputGraphProvider; -import java.util.Set; - -/** - * - * @author Thomas Wuerthinger - */ -public class EditorInputGraphProvider implements InputGraphProvider { - - private EditorTopComponent editor; - - public EditorInputGraphProvider(EditorTopComponent editor) { - this.editor = editor; - } - - @Override - public InputGraph getGraph() { - return editor.getDiagramModel().getGraphToView(); - } - - @Override - public void setSelectedNodes(Set nodes) { - editor.setSelectedNodes(nodes); - } -} diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/EditorTopComponent.form --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/EditorTopComponent.form Wed Feb 01 17:48:37 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/EditorTopComponent.java --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/EditorTopComponent.java Wed Feb 01 17:48:37 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,360 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ -package com.sun.hotspot.igv.view; - -import com.sun.hotspot.igv.data.*; -import com.sun.hotspot.igv.view.scene.DiagramScene; -import com.sun.hotspot.igv.data.Properties; -import com.sun.hotspot.igv.data.Properties.PropertyMatcher; -import com.sun.hotspot.igv.data.services.InputGraphProvider; -import com.sun.hotspot.igv.filter.FilterChain; -import com.sun.hotspot.igv.filter.FilterChainProvider; -import com.sun.hotspot.igv.graph.Diagram; -import com.sun.hotspot.igv.graph.Figure; -import com.sun.hotspot.igv.graph.services.DiagramProvider; -import com.sun.hotspot.igv.svg.BatikSVG; -import com.sun.hotspot.igv.util.LookupHistory; -import com.sun.hotspot.igv.util.RangeSlider; -import com.sun.hotspot.igv.view.actions.*; -import java.awt.*; -import java.awt.event.HierarchyBoundsListener; -import java.awt.event.HierarchyEvent; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.io.*; -import java.util.List; -import java.util.*; -import javax.swing.*; -import javax.swing.border.Border; -import org.openide.DialogDisplayer; -import org.openide.NotifyDescriptor; -import org.openide.actions.RedoAction; -import org.openide.actions.UndoAction; -import org.openide.awt.Toolbar; -import org.openide.awt.ToolbarPool; -import org.openide.awt.UndoRedo; -import org.openide.util.Lookup; -import org.openide.util.NbBundle; -import org.openide.util.Utilities; -import org.openide.util.actions.Presenter; -import org.openide.util.lookup.AbstractLookup; -import org.openide.util.lookup.InstanceContent; -import org.openide.util.lookup.ProxyLookup; -import org.openide.windows.Mode; -import org.openide.windows.TopComponent; -import org.openide.windows.WindowManager; - -/** - * - * @author Thomas Wuerthinger - */ -public final class EditorTopComponent extends TopComponent { - - private InstanceContent content; - private InstanceContent graphContent; - private RangeSlider rangeSlider; - private static final String PREFERRED_ID = "EditorTopComponent"; - private DiagramViewModel rangeSliderModel; - private CompilationViewer viewer; - - - private DiagramProvider diagramProvider = new DiagramProvider() { - - @Override - public Diagram getDiagram() { - return getModel().getDiagramToView(); - } - - @Override - public ChangedEvent getChangedEvent() { - return diagramChangedEvent; - } - }; - - private ChangedEvent diagramChangedEvent = new ChangedEvent<>(diagramProvider); - - - private void updateDisplayName() { - setDisplayName(getDiagram().getName()); - } - - public EditorTopComponent(InputGraph graph) { - - LookupHistory.init(InputGraphProvider.class); - LookupHistory.init(DiagramProvider.class); - this.setFocusable(true); - FilterChain filterChain; - FilterChain sequence; - FilterChainProvider provider = Lookup.getDefault().lookup(FilterChainProvider.class); - if (provider == null) { - filterChain = new FilterChain(); - sequence = new FilterChain(); - } else { - filterChain = provider.getFilterChain(); - sequence = provider.getSequence(); - } - - setName(NbBundle.getMessage(EditorTopComponent.class, "CTL_EditorTopComponent")); - setToolTipText(NbBundle.getMessage(EditorTopComponent.class, "HINT_EditorTopComponent")); - - initComponents(); - - ToolbarPool.getDefault().setPreferredIconSize(16); - Toolbar toolBar = new Toolbar(); - Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N - toolBar.setBorder(b); - this.add(BorderLayout.NORTH, toolBar); - - rangeSliderModel = new DiagramViewModel(graph.getGroup(), filterChain, sequence); - rangeSlider = new RangeSlider(); - rangeSlider.setModel(rangeSliderModel); - - CompilationViewerFactory factory = Lookup.getDefault().lookup(CompilationViewerFactory.class); - viewer = factory.createViewer(rangeSliderModel); - content = new InstanceContent(); - graphContent = new InstanceContent(); - this.associateLookup(new ProxyLookup(new Lookup[]{viewer.getLookup(), new AbstractLookup(graphContent), new AbstractLookup(content)})); - content.add(rangeSliderModel); - content.add(diagramProvider); - - rangeSliderModel.getDiagramChangedEvent().addListener(diagramChangedListener); - rangeSliderModel.selectGraph(graph); - - toolBar.add(PrevDiagramAction.get(PrevDiagramAction.class)); - toolBar.add(NextDiagramAction.get(NextDiagramAction.class)); - - toolBar.addSeparator(); - toolBar.add(UndoAction.get(UndoAction.class)); - toolBar.add(RedoAction.get(RedoAction.class)); - - toolBar.addSeparator(); - - Action action = Utilities.actionsForPath("QuickSearchShadow").get(0); - Component quicksearch = ((Presenter.Toolbar) action).getToolbarPresenter(); - quicksearch.setMinimumSize(quicksearch.getPreferredSize()); // necessary for GTK LAF - toolBar.add(quicksearch); - - toolBar.add(Box.createHorizontalGlue()); - toolBar.add(viewer.getToolBarComponent()); - - JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, - new JScrollPane(rangeSlider), viewer.getComponent()); - splitPane.setOneTouchExpandable(true); - splitPane.setDividerLocation(250); - this.add(splitPane, BorderLayout.CENTER); - - updateDisplayName(); - } - - public DiagramViewModel getDiagramModel() { - return rangeSliderModel; - } - - public void showPrevDiagram() { - int fp = getModel().getFirstPosition(); - int sp = getModel().getSecondPosition(); - if (fp != 0) { - fp--; - sp--; - getModel().setPositions(fp, sp); - } - } - - public DiagramViewModel getModel() { - return rangeSliderModel; - } - - public FilterChain getFilterChain() { - return getModel().getFilterChain(); - } - - public static EditorTopComponent getActive() { - Set modes = WindowManager.getDefault().getModes(); - for (Mode m : modes) { - TopComponent tc = m.getSelectedTopComponent(); - if (tc instanceof EditorTopComponent) { - return (EditorTopComponent) tc; - } - } - return null; - } - - /** This method is called from within the constructor to - * initialize the form. - * WARNING: Do NOT modify this code. The content of this method is - * always regenerated by the Form Editor. - */ - // //GEN-BEGIN:initComponents - private void initComponents() { - jCheckBox1 = new javax.swing.JCheckBox(); - - org.openide.awt.Mnemonics.setLocalizedText(jCheckBox1, "jCheckBox1"); - jCheckBox1.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); - jCheckBox1.setMargin(new java.awt.Insets(0, 0, 0, 0)); - - setLayout(new java.awt.BorderLayout()); - - }// //GEN-END:initComponents - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JCheckBox jCheckBox1; - // End of variables declaration//GEN-END:variables - - @Override - public int getPersistenceType() { - return TopComponent.PERSISTENCE_NEVER; - } - - @Override - public void componentOpened() { - } - - @Override - public void componentClosed() { - } - - @Override - protected String preferredID() { - return PREFERRED_ID; - } - - private ChangedListener diagramChangedListener = new ChangedListener() { - - @Override - public void changed(DiagramViewModel source) { - updateDisplayName(); - Collection list = new ArrayList<>(); - list.add(new EditorInputGraphProvider(EditorTopComponent.this)); - graphContent.set(list, null); - diagramProvider.getChangedEvent().fire(); - } - - }; - - public void setSelectedFigures(List
list) { - viewer.setSelection(list); - } - - public void setSelectedNodes(Set nodes) { - - List
list = new ArrayList<>(); - Set ids = new HashSet<>(); - for (InputNode n : nodes) { - ids.add(n.getId()); - } - - for (Figure f : getModel().getDiagramToView().getFigures()) { - for (InputNode n : f.getSource().getSourceNodes()) { - if (ids.contains(n.getId())) { - list.add(f); - break; - } - } - } - - setSelectedFigures(list); - } - - public void extract() { - getModel().showOnly(getModel().getSelectedNodes()); - } - - public void hideNodes() { - Set selectedNodes = this.getModel().getSelectedNodes(); - HashSet nodes = new HashSet<>(getModel().getHiddenNodes()); - nodes.addAll(selectedNodes); - this.getModel().showNot(nodes); - } - - public void expandPredecessors() { - Set
oldSelection = getModel().getSelectedFigures(); - Set
figures = new HashSet<>(); - - for (Figure f : this.getDiagramModel().getDiagramToView().getFigures()) { - boolean ok = false; - if (oldSelection.contains(f)) { - ok = true; - } else { - for (Figure pred : f.getSuccessors()) { - if (oldSelection.contains(pred)) { - ok = true; - break; - } - } - } - - if (ok) { - figures.add(f); - } - } - - getModel().showAll(figures); - } - - public void expandSuccessors() { - Set
oldSelection = getModel().getSelectedFigures(); - Set
figures = new HashSet<>(); - - for (Figure f : this.getDiagramModel().getDiagramToView().getFigures()) { - boolean ok = false; - if (oldSelection.contains(f)) { - ok = true; - } else { - for (Figure succ : f.getPredecessors()) { - if (oldSelection.contains(succ)) { - ok = true; - break; - } - } - } - - if (ok) { - figures.add(f); - } - } - - getModel().showAll(figures); - } - - public void showAll() { - getModel().showNot(new HashSet()); - } - - public Diagram getDiagram() { - return getDiagramModel().getDiagramToView(); - } - - @Override - public void requestActive() { - super.requestActive(); - viewer.getComponent().requestFocus(); - } - - @Override - public UndoRedo getUndoRedo() { - return viewer.getUndoRedo(); - } - -} diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/ExportCookie.java --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/ExportCookie.java Wed Feb 01 17:48:37 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* - * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.sun.hotspot.igv.view; - -import java.io.File; - -/** - * - * @author Thomas Wuerthinger - */ -public interface ExportCookie { - - void export(File f); -} diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/ExtendedSatelliteComponent.java --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/ExtendedSatelliteComponent.java Wed Feb 01 17:48:37 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,218 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ -package com.sun.hotspot.igv.view; - -import com.sun.hotspot.igv.view.scene.DiagramScene; -import java.awt.*; -import java.awt.event.*; -import javax.swing.JComponent; -import org.netbeans.api.visual.widget.Scene; - -/** - * @author David Kaspar - * @author Thomas Wuerthinger - */ -public class ExtendedSatelliteComponent extends JComponent implements MouseListener, MouseMotionListener, Scene.SceneListener, ComponentListener { - - private DiagramScene scene; - private Image image; - private int imageWidth; - private int imageHeight; - - public ExtendedSatelliteComponent(DiagramScene scene) { - this.scene = scene; - setDoubleBuffered(true); - setPreferredSize(new Dimension(128, 128)); - addMouseListener(this); - addMouseMotionListener(this); - } - - @Override - public void addNotify() { - super.addNotify(); - scene.addSceneListener(this); - JComponent viewComponent = scene.getView(); - if (viewComponent == null) { - viewComponent = scene.createView(); - } - viewComponent.addComponentListener(this); - repaint(); - } - - @Override - public void removeNotify() { - scene.getView().removeComponentListener(this); - scene.removeSceneListener(this); - super.removeNotify(); - } - - public void update() { - this.image = null; - if (this.isVisible()) { - repaint(); - revalidate(); - validate(); - } - } - - @Override - public void paint(Graphics g) { - Graphics2D gr = (Graphics2D) g; - super.paint(g); - Rectangle bounds = scene.getBounds(); - Dimension size = getSize(); - - double sx = bounds.width > 0 ? (double) size.width / bounds.width : 0.0; - double sy = bounds.width > 0 ? (double) size.height / bounds.height : 0.0; - double scale = Math.min(sx, sy); - - int vw = (int) (scale * bounds.width); - int vh = (int) (scale * bounds.height); - int vx = (size.width - vw) / 2; - int vy = (size.height - vh) / 2; - - - if (image == null || vw != imageWidth || vh != imageHeight) { - - imageWidth = vw; - imageHeight = vh; - image = this.createImage(imageWidth, imageHeight); - Graphics2D ig = (Graphics2D) image.getGraphics(); - ig.scale(scale, scale); - double oldFactor = scene.getZoomFactor(); - scene.setZoomFactor(scale); - scene.paint(ig); - scene.setZoomFactor(oldFactor); - } - - gr.drawImage(image, vx, vy, this); - - JComponent component = scene.getView(); - double zoomFactor = scene.getZoomFactor(); - Rectangle viewRectangle = component != null ? component.getVisibleRect() : null; - if (viewRectangle != null) { - Rectangle window = new Rectangle( - (int) ((double) viewRectangle.x * scale / zoomFactor), - (int) ((double) viewRectangle.y * scale / zoomFactor), - (int) ((double) viewRectangle.width * scale / zoomFactor), - (int) ((double) viewRectangle.height * scale / zoomFactor)); - window.translate(vx, vy); - gr.setColor(new Color(200, 200, 200, 128)); - gr.fill(window); - gr.setColor(Color.BLACK); - gr.drawRect(window.x, window.y, window.width - 1, window.height - 1); - } - } - - @Override - public void mouseClicked(MouseEvent e) { - } - - @Override - public void mousePressed(MouseEvent e) { - moveVisibleRect(e.getPoint()); - } - - @Override - public void mouseReleased(MouseEvent e) { - moveVisibleRect(e.getPoint()); - } - - @Override - public void mouseEntered(MouseEvent e) { - } - - @Override - public void mouseExited(MouseEvent e) { - } - - @Override - public void mouseDragged(MouseEvent e) { - moveVisibleRect(e.getPoint()); - } - - @Override - public void mouseMoved(MouseEvent e) { - } - - private void moveVisibleRect(Point center) { - JComponent component = scene.getView(); - if (component == null) { - return; - } - double zoomFactor = scene.getZoomFactor(); - Rectangle bounds = scene.getBounds(); - Dimension size = getSize(); - - double sx = bounds.width > 0 ? (double) size.width / bounds.width : 0.0; - double sy = bounds.width > 0 ? (double) size.height / bounds.height : 0.0; - double scale = Math.min(sx, sy); - - int vw = (int) (scale * bounds.width); - int vh = (int) (scale * bounds.height); - int vx = (size.width - vw) / 2; - int vy = (size.height - vh) / 2; - - int cx = (int) ((double) (center.x - vx) / scale * zoomFactor); - int cy = (int) ((double) (center.y - vy) / scale * zoomFactor); - - Rectangle visibleRect = component.getVisibleRect(); - visibleRect.x = cx - visibleRect.width / 2; - visibleRect.y = cy - visibleRect.height / 2; - component.scrollRectToVisible(visibleRect); - - this.repaint(); - } - - @Override - public void sceneRepaint() { - //repaint (); - } - - @Override - public void sceneValidating() { - } - - @Override - public void sceneValidated() { - } - - @Override - public void componentResized(ComponentEvent e) { - repaint(); - } - - @Override - public void componentMoved(ComponentEvent e) { - repaint(); - } - - @Override - public void componentShown(ComponentEvent e) { - } - - @Override - public void componentHidden(ComponentEvent e) { - } -} diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/GraphViewerImplementation.java --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/GraphViewerImplementation.java Wed Feb 01 17:48:37 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ -package com.sun.hotspot.igv.view; - -import com.sun.hotspot.igv.data.InputGraph; -import com.sun.hotspot.igv.data.services.GraphViewer; - -/** - * - * @author Thomas Wuerthinger - */ -public class GraphViewerImplementation implements GraphViewer { - - @Override - public void view(InputGraph graph) { - EditorTopComponent tc = new EditorTopComponent(graph); - tc.open(); - tc.requestActive(); - } -} diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/NodeQuickSearch.java --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/NodeQuickSearch.java Wed Feb 01 17:48:37 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,142 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ -package com.sun.hotspot.igv.view; - -import com.sun.hotspot.igv.data.InputNode; -import com.sun.hotspot.igv.data.Properties; -import com.sun.hotspot.igv.data.Properties.RegexpPropertyMatcher; -import com.sun.hotspot.igv.data.services.InputGraphProvider; -import com.sun.hotspot.igv.util.LookupHistory; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.regex.Pattern; -import org.netbeans.spi.quicksearch.SearchProvider; -import org.netbeans.spi.quicksearch.SearchRequest; -import org.netbeans.spi.quicksearch.SearchResponse; -import org.openide.DialogDisplayer; -import org.openide.NotifyDescriptor; -import org.openide.NotifyDescriptor.Message; - -/** - * - * @author Thomas Wuerthinger - */ -public class NodeQuickSearch implements SearchProvider { - - private static final String DEFAULT_PROPERTY = "name"; - - /** - * Method is called by infrastructure when search operation was requested. - * Implementors should evaluate given request and fill response object with - * apropriate results - * - * @param request Search request object that contains information what to search for - * @param response Search response object that stores search results. Note that it's important to react to return value of SearchResponse.addResult(...) method and stop computation if false value is returned. - */ - @Override - public void evaluate(SearchRequest request, SearchResponse response) { - String query = request.getText(); - if (query.trim().isEmpty()) { - return; - } - - final String[] parts = query.split("=", 2); - - String name; - String value; - - if (parts.length == 1) { - name = DEFAULT_PROPERTY; - value = ".*" + Pattern.quote(parts[0]) + ".*"; - } else { - name = parts[0]; - value = parts[1]; - } - - if (value.isEmpty()) { - value = ".*"; - } - - final InputGraphProvider p = LookupHistory.getLast(InputGraphProvider.class); - if (p != null && p.getGraph() != null) { - List matches = null; - try { - RegexpPropertyMatcher matcher = new RegexpPropertyMatcher(name, value, Pattern.CASE_INSENSITIVE); - Properties.PropertySelector selector = new Properties.PropertySelector<>(p.getGraph().getNodes()); - - matches = selector.selectMultiple(matcher); - } catch (Exception e) { - final String msg = e.getMessage(); - response.addResult(new Runnable() { - @Override - public void run() { - Message desc = new NotifyDescriptor.Message("An exception occurred during the search, " - + "perhaps due to a malformed query string:\n" + msg, - NotifyDescriptor.WARNING_MESSAGE); - DialogDisplayer.getDefault().notify(desc); - } - }, - "(Error during search)" - ); - } - - if (matches != null) { - final Set set = new HashSet<>(matches); - response.addResult(new Runnable() { - @Override - public void run() { - final EditorTopComponent comp = EditorTopComponent.getActive(); - if (comp != null) { - comp.setSelectedNodes(set); - comp.requestActive(); - } - } - }, - "All " + matches.size() + " matching nodes (" + name + "=" + value + ")" - ); - - // Single matches - for (final InputNode n : matches) { - response.addResult(new Runnable() { - @Override - public void run() { - final EditorTopComponent comp = EditorTopComponent.getActive(); - if (comp != null) { - final Set tmpSet = new HashSet<>(); - tmpSet.add(n); - comp.setSelectedNodes(tmpSet); - comp.requestActive(); - } - } - }, - n.getProperties().get(name) + " (" + n.getId() + " " + n.getProperties().get("name") + ")" - ); - } - } - } else { - System.out.println("no input graph provider!"); - } - } -} diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/Bundle.properties --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/Bundle.properties Wed Feb 01 17:48:37 2012 +0100 +++ b/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/Bundle.properties Wed Feb 01 18:29:28 2012 +0100 @@ -1,6 +1,4 @@ CTL_EditorAction=Open Editor Window -CTL_NextDiagramAction=Show next graph CTL_EnableBlockLayoutAction=Enable block layout CTL_NodeFindAction=Find -CTL_PrevDiagramAction=Show previous graph CTL_ExportAction=Export current graph... diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExpandPredecessorsAction.java --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExpandPredecessorsAction.java Wed Feb 01 17:48:37 2012 +0100 +++ b/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExpandPredecessorsAction.java Wed Feb 01 18:29:28 2012 +0100 @@ -23,7 +23,7 @@ */ package com.sun.hotspot.igv.view.actions; -import com.sun.hotspot.igv.view.EditorTopComponent; +import com.oracle.graal.visualizer.editor.EditorTopComponent; import org.openide.util.HelpCtx; import org.openide.util.actions.CallableSystemAction; diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExpandSuccessorsAction.java --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExpandSuccessorsAction.java Wed Feb 01 17:48:37 2012 +0100 +++ b/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExpandSuccessorsAction.java Wed Feb 01 18:29:28 2012 +0100 @@ -23,7 +23,7 @@ */ package com.sun.hotspot.igv.view.actions; -import com.sun.hotspot.igv.view.EditorTopComponent; +import com.oracle.graal.visualizer.editor.EditorTopComponent; import org.openide.util.HelpCtx; import org.openide.util.actions.CallableSystemAction; diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExportAction.java --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExportAction.java Wed Feb 01 17:48:37 2012 +0100 +++ b/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExportAction.java Wed Feb 01 18:29:28 2012 +0100 @@ -24,7 +24,7 @@ package com.sun.hotspot.igv.view.actions; import com.sun.hotspot.igv.settings.Settings; -import com.sun.hotspot.igv.view.ExportCookie; +import com.oracle.graal.visualizer.editor.ExportCookie; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import java.io.File; diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExtractAction.java --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExtractAction.java Wed Feb 01 17:48:37 2012 +0100 +++ b/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExtractAction.java Wed Feb 01 18:29:28 2012 +0100 @@ -23,11 +23,14 @@ */ package com.sun.hotspot.igv.view.actions; -import com.sun.hotspot.igv.view.EditorTopComponent; +import com.oracle.graal.visualizer.editor.EditorTopComponent; import java.awt.Event; import java.awt.event.KeyEvent; import javax.swing.Action; import javax.swing.KeyStroke; +import org.openide.awt.ActionID; +import org.openide.awt.ActionReference; +import org.openide.awt.ActionRegistration; import org.openide.util.HelpCtx; import org.openide.util.actions.CallableSystemAction; @@ -35,6 +38,9 @@ * * @author Thomas Wuerthinger */ +@ActionID(id = "com.sun.hotspot.igv.view.actions.ExtractAction", category = "View") +@ActionRegistration(displayName = "Extract nodes") +@ActionReference(path = "Menu/View", position = 300) public final class ExtractAction extends CallableSystemAction { @Override diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/HideAction.java --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/HideAction.java Wed Feb 01 17:48:37 2012 +0100 +++ b/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/HideAction.java Wed Feb 01 18:29:28 2012 +0100 @@ -23,11 +23,14 @@ */ package com.sun.hotspot.igv.view.actions; -import com.sun.hotspot.igv.view.EditorTopComponent; +import com.oracle.graal.visualizer.editor.EditorTopComponent; import java.awt.Event; import java.awt.event.KeyEvent; import javax.swing.Action; import javax.swing.KeyStroke; +import org.openide.awt.ActionID; +import org.openide.awt.ActionReference; +import org.openide.awt.ActionRegistration; import org.openide.util.HelpCtx; import org.openide.util.actions.CallableSystemAction; @@ -35,6 +38,9 @@ * * @author Thomas Wuerthinger */ +@ActionID(id = "com.sun.hotspot.igv.view.actions.HideAction", category = "View") +@ActionRegistration(displayName = "Hide nodes") +@ActionReference(path = "Menu/View", position = 400) public final class HideAction extends CallableSystemAction { @Override diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/NextDiagramAction.java --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/NextDiagramAction.java Wed Feb 01 17:48:37 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ -package com.sun.hotspot.igv.view.actions; - -import com.sun.hotspot.igv.data.ChangedListener; -import com.sun.hotspot.igv.util.ContextAction; -import com.sun.hotspot.igv.view.DiagramViewModel; -import javax.swing.Action; -import javax.swing.ImageIcon; -import org.openide.util.*; - -/** - * - * @author Thomas Wuerthinger - */ -public final class NextDiagramAction extends ContextAction implements ChangedListener { - - private DiagramViewModel model; - - public NextDiagramAction() { - this(Utilities.actionsGlobalContext()); - } - - public NextDiagramAction(Lookup lookup) { - putValue(Action.SHORT_DESCRIPTION, "Show next graph of current group"); - putValue(Action.SMALL_ICON, new ImageIcon(ImageUtilities.loadImage("com/sun/hotspot/igv/view/images/next_diagram.png"))); - } - - @Override - public String getName() { - return NbBundle.getMessage(NextDiagramAction.class, "CTL_NextDiagramAction"); - } - - @Override - public HelpCtx getHelpCtx() { - return HelpCtx.DEFAULT_HELP; - } - - @Override - public Class contextClass() { - return DiagramViewModel.class; - } - - @Override - public void performAction(DiagramViewModel model) { - int fp = model.getFirstPosition(); - int sp = model.getSecondPosition(); - if (sp != model.getPositions().size() - 1) { - int nfp = fp + 1; - int nsp = sp + 1; - model.setPositions(nfp, nsp); - } - } - - @Override - public void update(DiagramViewModel model) { - super.update(model); - - if (this.model != model) { - if (this.model != null) { - this.model.getDiagramChangedEvent().removeListener(this); - } - - this.model = model; - if (this.model != null) { - this.model.getDiagramChangedEvent().addListener(this); - } - } - } - - @Override - public boolean isEnabled(DiagramViewModel model) { - return model.getSecondPosition() != model.getPositions().size() - 1; - } - - @Override - public Action createContextAwareInstance(Lookup arg0) { - return new NextDiagramAction(arg0); - } - - @Override - public void changed(DiagramViewModel source) { - update(source); - } -} diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/PrevDiagramAction.java --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/PrevDiagramAction.java Wed Feb 01 17:48:37 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ -package com.sun.hotspot.igv.view.actions; - -import com.sun.hotspot.igv.data.ChangedListener; -import com.sun.hotspot.igv.util.ContextAction; -import com.sun.hotspot.igv.view.DiagramViewModel; -import javax.swing.Action; -import javax.swing.ImageIcon; -import org.openide.util.*; - -/** - * - * @author Thomas Wuerthinger - */ -public final class PrevDiagramAction extends ContextAction implements ChangedListener { - - private DiagramViewModel model; - - public PrevDiagramAction() { - this(Utilities.actionsGlobalContext()); - } - - public PrevDiagramAction(Lookup lookup) { - putValue(Action.SHORT_DESCRIPTION, "Show previous graph of current group"); - putValue(Action.SMALL_ICON, new ImageIcon(ImageUtilities.loadImage("com/sun/hotspot/igv/view/images/prev_diagram.png"))); - } - - @Override - public String getName() { - return NbBundle.getMessage(PrevDiagramAction.class, "CTL_PrevDiagramAction"); - } - - @Override - public HelpCtx getHelpCtx() { - return HelpCtx.DEFAULT_HELP; - } - - @Override - public Class contextClass() { - return DiagramViewModel.class; - } - - @Override - public void performAction(DiagramViewModel model) { - int fp = model.getFirstPosition(); - int sp = model.getSecondPosition(); - if (fp != 0) { - int nfp = fp - 1; - int nsp = sp - 1; - model.setPositions(nfp, nsp); - } - } - - @Override - public void update(DiagramViewModel model) { - super.update(model); - - if (this.model != model) { - if (this.model != null) { - this.model.getDiagramChangedEvent().removeListener(this); - } - - this.model = model; - if (this.model != null) { - this.model.getDiagramChangedEvent().addListener(this); - } - } - } - - @Override - public boolean isEnabled(DiagramViewModel model) { - return model.getFirstPosition() != 0; - } - - @Override - public Action createContextAwareInstance(Lookup arg0) { - return new PrevDiagramAction(arg0); - } - - @Override - public void changed(DiagramViewModel source) { - update(source); - } -} diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ShowAllAction.java --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ShowAllAction.java Wed Feb 01 17:48:37 2012 +0100 +++ b/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ShowAllAction.java Wed Feb 01 18:29:28 2012 +0100 @@ -23,11 +23,14 @@ */ package com.sun.hotspot.igv.view.actions; -import com.sun.hotspot.igv.view.EditorTopComponent; +import com.oracle.graal.visualizer.editor.EditorTopComponent; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import javax.swing.Action; import javax.swing.KeyStroke; +import org.openide.awt.ActionID; +import org.openide.awt.ActionReference; +import org.openide.awt.ActionRegistration; import org.openide.util.HelpCtx; import org.openide.util.actions.CallableSystemAction; @@ -35,6 +38,9 @@ * * @author Thomas Wuerthinger */ +@ActionID(id = "com.sun.hotspot.igv.view.actions.ShowAllAction", category = "View") +@ActionRegistration(displayName = "Show all nodes") +@ActionReference(path = "Menu/View", position = 200) public final class ShowAllAction extends CallableSystemAction { @Override diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ZoomInAction.java --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ZoomInAction.java Wed Feb 01 17:48:37 2012 +0100 +++ b/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ZoomInAction.java Wed Feb 01 18:29:28 2012 +0100 @@ -23,12 +23,15 @@ */ package com.sun.hotspot.igv.view.actions; -import com.sun.hotspot.igv.view.EditorTopComponent; +import com.oracle.graal.visualizer.editor.EditorTopComponent; import com.sun.hotspot.igv.view.scene.GraphCompilationViewer; import java.awt.Event; import java.awt.event.KeyEvent; import javax.swing.Action; import javax.swing.KeyStroke; +import org.openide.awt.ActionID; +import org.openide.awt.ActionReference; +import org.openide.awt.ActionRegistration; import org.openide.util.HelpCtx; import org.openide.util.actions.CallableSystemAction; diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ZoomOutAction.java --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ZoomOutAction.java Wed Feb 01 17:48:37 2012 +0100 +++ b/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ZoomOutAction.java Wed Feb 01 18:29:28 2012 +0100 @@ -23,12 +23,15 @@ */ package com.sun.hotspot.igv.view.actions; -import com.sun.hotspot.igv.view.EditorTopComponent; +import com.oracle.graal.visualizer.editor.EditorTopComponent; import com.sun.hotspot.igv.view.scene.GraphCompilationViewer; import java.awt.Event; import java.awt.event.KeyEvent; import javax.swing.Action; import javax.swing.KeyStroke; +import org.openide.awt.ActionID; +import org.openide.awt.ActionReference; +import org.openide.awt.ActionRegistration; import org.openide.util.HelpCtx; import org.openide.util.actions.CallableSystemAction; diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/layer.xml --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/layer.xml Wed Feb 01 17:48:37 2012 +0100 +++ b/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/layer.xml Wed Feb 01 18:29:28 2012 +0100 @@ -1,80 +1,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/scene/DiagramScene.java --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/scene/DiagramScene.java Wed Feb 01 17:48:37 2012 +0100 +++ b/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/scene/DiagramScene.java Wed Feb 01 18:29:28 2012 +0100 @@ -34,8 +34,8 @@ import com.sun.hotspot.igv.util.ColorIcon; import com.sun.hotspot.igv.util.DoubleClickAction; import com.sun.hotspot.igv.util.PropertiesSheet; -import com.sun.hotspot.igv.view.CompilationViewer; -import com.sun.hotspot.igv.view.DiagramViewModel; +import com.oracle.graal.visualizer.editor.CompilationViewer; +import com.oracle.graal.visualizer.editor.DiagramViewModel; import com.sun.hotspot.igv.view.actions.CustomizablePanAction; import com.sun.hotspot.igv.view.widgets.*; import java.awt.*; diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/scene/GraphCompilationViewer.java --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/scene/GraphCompilationViewer.java Wed Feb 01 17:48:37 2012 +0100 +++ b/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/scene/GraphCompilationViewer.java Wed Feb 01 18:29:28 2012 +0100 @@ -26,9 +26,9 @@ import com.sun.hotspot.igv.graph.Figure; import com.sun.hotspot.igv.svg.BatikSVG; -import com.sun.hotspot.igv.view.CompilationViewer; -import com.sun.hotspot.igv.view.DiagramViewModel; -import com.sun.hotspot.igv.view.ExportCookie; +import com.oracle.graal.visualizer.editor.CompilationViewer; +import com.oracle.graal.visualizer.editor.DiagramViewModel; +import com.oracle.graal.visualizer.editor.ExportCookie; import com.sun.hotspot.igv.view.actions.*; import java.awt.Component; import java.awt.Graphics2D; diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/scene/GraphCompilationViewerFactory.java --- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/scene/GraphCompilationViewerFactory.java Wed Feb 01 17:48:37 2012 +0100 +++ b/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/scene/GraphCompilationViewerFactory.java Wed Feb 01 18:29:28 2012 +0100 @@ -24,9 +24,9 @@ package com.sun.hotspot.igv.view.scene; -import com.sun.hotspot.igv.view.CompilationViewer; -import com.sun.hotspot.igv.view.CompilationViewerFactory; -import com.sun.hotspot.igv.view.DiagramViewModel; +import com.oracle.graal.visualizer.editor.CompilationViewer; +import com.oracle.graal.visualizer.editor.CompilationViewerFactory; +import com.oracle.graal.visualizer.editor.DiagramViewModel; public class GraphCompilationViewerFactory implements CompilationViewerFactory{ diff -r 71990133c897 -r bcce7f52832d src/share/tools/IdealGraphVisualizer/nbproject/project.properties --- a/src/share/tools/IdealGraphVisualizer/nbproject/project.properties Wed Feb 01 17:48:37 2012 +0100 +++ b/src/share/tools/IdealGraphVisualizer/nbproject/project.properties Wed Feb 01 18:29:28 2012 +0100 @@ -21,8 +21,10 @@ ${project.com.sun.hotspot.igv.selectioncoordinator}:\ ${project.com.sun.hotspot.igv.graal}:\ ${project.at.ssw.visualizer.cfg}:\ - ${project.org.eclipse.draw2d} + ${project.org.eclipse.draw2d}:\ + ${project.com.oracle.graal.visualizer.editor} project.at.ssw.visualizer.cfg=ControlFlowEditor +project.com.oracle.graal.visualizer.editor=Editor project.com.sun.hotspot.connection=NetworkConnection project.com.sun.hotspot.igv.bytecodes=Bytecodes project.com.sun.hotspot.igv.coordinator=Coordinator