# HG changeset patch # User Thomas Wuerthinger # Date 1327703579 -3600 # Node ID fe0117cb71f2f20d745688e48e06d4431a1f2c84 # Parent 0c632ed89063c0a2e3a67863e43444fd3a04e1a6 Removed graph-to-text component and associated classes from igv. diff -r 0c632ed89063 -r fe0117cb71f2 src/share/tools/IdealGraphVisualizer/Graal/build.xml --- a/src/share/tools/IdealGraphVisualizer/Graal/build.xml Fri Jan 27 23:31:28 2012 +0100 +++ b/src/share/tools/IdealGraphVisualizer/Graal/build.xml Fri Jan 27 23:32:59 2012 +0100 @@ -1,8 +1,8 @@ - - - - - - Builds, tests, and runs the project com.sun.hotspot.igv.graal. - - + + + + + + Builds, tests, and runs the project com.sun.hotspot.igv.graal. + + diff -r 0c632ed89063 -r fe0117cb71f2 src/share/tools/IdealGraphVisualizer/Graal/nbproject/build-impl.xml --- a/src/share/tools/IdealGraphVisualizer/Graal/nbproject/build-impl.xml Fri Jan 27 23:31:28 2012 +0100 +++ b/src/share/tools/IdealGraphVisualizer/Graal/nbproject/build-impl.xml Fri Jan 27 23:32:59 2012 +0100 @@ -1,45 +1,45 @@ - - - - - - - - - - - - - You must set 'suite.dir' to point to your containing module suite - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + You must set 'suite.dir' to point to your containing module suite + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 0c632ed89063 -r fe0117cb71f2 src/share/tools/IdealGraphVisualizer/Graal/nbproject/genfiles.properties --- a/src/share/tools/IdealGraphVisualizer/Graal/nbproject/genfiles.properties Fri Jan 27 23:31:28 2012 +0100 +++ b/src/share/tools/IdealGraphVisualizer/Graal/nbproject/genfiles.properties Fri Jan 27 23:32:59 2012 +0100 @@ -1,8 +1,8 @@ -build.xml.data.CRC32=2bb741e3 -build.xml.script.CRC32=3534d355 -build.xml.stylesheet.CRC32=a56c6a5b@1.45.1 -# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. -# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=2bb741e3 -nbproject/build-impl.xml.script.CRC32=2867f2d5 -nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.45.1 +build.xml.data.CRC32=24f39af6 +build.xml.script.CRC32=3534d355 +build.xml.stylesheet.CRC32=a56c6a5b@2.47.1 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=24f39af6 +nbproject/build-impl.xml.script.CRC32=2867f2d5 +nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.47.1 diff -r 0c632ed89063 -r fe0117cb71f2 src/share/tools/IdealGraphVisualizer/Graal/nbproject/project.xml --- a/src/share/tools/IdealGraphVisualizer/Graal/nbproject/project.xml Fri Jan 27 23:31:28 2012 +0100 +++ b/src/share/tools/IdealGraphVisualizer/Graal/nbproject/project.xml Fri Jan 27 23:32:59 2012 +0100 @@ -1,53 +1,45 @@ - - - org.netbeans.modules.apisupport.project - - - com.sun.hotspot.igv.graal - - - - com.sun.hotspot.igv.data - - - - 1.0 - - - - com.sun.hotspot.igv.filter - - - - 1.0 - - - - com.sun.hotspot.igv.graph - - - - 1.0 - - - - com.sun.hotspot.igv.graphtotext - - - - 1.0 - - - - com.sun.hotspot.igv.structuredtext - - - - 1.0 - - - - - - - + + + org.netbeans.modules.apisupport.project + + + com.sun.hotspot.igv.graal + + + + com.sun.hotspot.igv.data + + + + 1.0 + + + + com.sun.hotspot.igv.filter + + + + 1.0 + + + + com.sun.hotspot.igv.graph + + + + 1.0 + + + + com.sun.hotspot.igv.structuredtext + + + + 1.0 + + + + + + + diff -r 0c632ed89063 -r fe0117cb71f2 src/share/tools/IdealGraphVisualizer/Graal/src/META-INF/services/com.sun.hotspot.igv.graphtotext.services.GraphToTextConverter --- a/src/share/tools/IdealGraphVisualizer/Graal/src/META-INF/services/com.sun.hotspot.igv.graphtotext.services.GraphToTextConverter Fri Jan 27 23:31:28 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -com.sun.hotspot.igv.graal.GraalGraphToTextConverter \ No newline at end of file diff -r 0c632ed89063 -r fe0117cb71f2 src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/GraalGraphToTextConverter.java --- a/src/share/tools/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/GraalGraphToTextConverter.java Fri Jan 27 23:31:28 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,209 +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.graal; - -import com.sun.hotspot.igv.data.InputBlock; -import com.sun.hotspot.igv.data.InputEdge; -import com.sun.hotspot.igv.data.InputGraph; -import com.sun.hotspot.igv.data.InputNode; -import com.sun.hotspot.igv.data.Properties; -import com.sun.hotspot.igv.data.Properties.PropertyMatcher; -import com.sun.hotspot.igv.graph.Diagram; -import com.sun.hotspot.igv.graph.Figure; -import com.sun.hotspot.igv.graphtotext.services.GraphToTextConverter; -import com.sun.hotspot.igv.structuredtext.Element; -import com.sun.hotspot.igv.structuredtext.MultiElement; -import com.sun.hotspot.igv.structuredtext.SimpleElement; -import com.sun.hotspot.igv.structuredtext.StructuredText; -import java.awt.Color; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Set; -import javax.swing.text.Style; -import javax.swing.text.StyleConstants; -import javax.swing.text.StyleContext; - -/** - * @author Peter Hofer - * @author Thomas Wuerthinger - */ -public class GraalGraphToTextConverter implements GraphToTextConverter { - - private Map> map; - private Map> incomingEdges; - private Map> outgoingEdges; - private InputGraph graph; - - private Collection sortNodes(Collection nodes) { - List result = new ArrayList(nodes); - Collections.sort(result, InputNode.getPropertyComparator("idx")); - return result; - } - - public StructuredText convert(InputGraph graph, Diagram diagram) { - - this.graph = graph; - map = diagram.calcSourceToFigureRelation(); - - incomingEdges = graph.findAllIngoingEdges(); - outgoingEdges = graph.findAllOutgoingEdges(); - - final StructuredText result = new StructuredText(graph.getName()); - - for (InputBlock b : graph.getBlocks()) { - result.addChild(new SimpleElement("Block " + b.getName() + "\n")); - for (InputNode n : sortNodes(b.getNodes())) { - result.addChild(getNodeElement(n)); - } - } - - boolean first = true; - for (InputNode n : sortNodes(graph.getNodes())) { - if (graph.getBlock(n) == null) { - if (first) { - first = false; - result.addChild(new SimpleElement("No block: \n")); - } - result.addChild(getNodeElement(n)); - } - } - - return result; - } - - private Element getNodeNameElement(InputNode n) { - - final SimpleElement name = new SimpleElement(n.getProperties().get("idx") + " " + n.getProperties().get("name"), calcStyle(n)); - name.addSource(n.getId()); - return name; - } - - private Element getNodeShortElement(InputNode n) { - final SimpleElement id = new SimpleElement(n.getProperties().get("idx"), calcStyle(n)); - id.addSource(n.getId()); - return id; - } - - private Element getNodeElement(InputNode n) { - - final MultiElement result = new MultiElement(); - - result.print("\t"); - result.addChild(getNodeNameElement(n)); - - result.print(" :::"); - - // NOTE: lists in ingoingEdges/outgoingEdges are sorted by from/to slot - // and for slots that are connected with multiple edges, by - // from/to node - - InputEdge[] outgoing = outgoingEdges.get(n).toArray(new InputEdge[0]); - int succCount = outgoing.length - Integer.parseInt(n.getProperties().get("usageCount")); - - int i = 0; - if (outgoing.length > 0 && outgoing[0].getFromIndex() < succCount) { - // Node has successors (each connected to a different slot) - result.print(" Succ = ["); - while (i < outgoing.length && outgoing[i].getFromIndex() < succCount) { - result.print(" "); - result.addChild(getNodeShortElement(graph.getNode(outgoing[i].getTo()))); - result.print(" "); - i++; - } - result.print("]"); - } - if (i < outgoing.length) { - // Node has usages (all connected to a single slot) - result.print(" Usages = ["); - while (i < outgoing.length) { - result.print(" "); - result.addChild(getNodeShortElement(graph.getNode(outgoing[i].getTo()))); - result.print(" "); - i++; - } - result.print("]"); - } - - int predCount = Integer.parseInt(n.getProperties().get("predecessorCount")); - InputEdge[] incoming = incomingEdges.get(n).toArray(new InputEdge[0]); - - int j = 0; - if (incoming.length > 0 && incoming[0].getToIndex() < predCount) { - // Node has predecessors (each connected to a different slot) - result.print(" Pred = ["); - while (j < incoming.length && incoming[j].getToIndex() < predCount) { - result.print(" "); - result.addChild(getNodeShortElement(graph.getNode(incoming[j].getFrom()))); - result.print(" "); - j++; - } - result.print("]"); - } - if (j < incoming.length) { - // Node has inputs (each connected to a different slot) - result.print(" Inputs = ["); - while (j < incoming.length) { - result.print(" "); - result.addChild(getNodeShortElement(graph.getNode(incoming[j].getFrom()))); - result.print(" "); - j++; - } - result.print("]"); - } - - result.print("\n"); - return result; - } - private static final PropertyMatcher MATCHER = new Properties.StringPropertyMatcher("origin", "Graal"); - - public boolean canConvert(InputGraph graph) { - return graph.getGroup().getProperties().selectSingle(MATCHER) != null; - } - - private Color calcColor(InputNode node) { - Set
figureSet = this.map.get(node); - if (figureSet != null && figureSet.size() == 1) { - return figureSet.iterator().next().getColor(); - } else { - return Color.WHITE; - } - } - - private Color lessColor(Color c) { - return new Color(255 - (255 - c.getRed()) / 4, 255 - (255 - c.getGreen()) / 4, 255 - (255 - c.getBlue()) / 4); - } - - private Style calcStyle(InputNode node) { - Color c = calcColor(node); - Style defaultStyle = StyleContext.getDefaultStyleContext().getStyle(StyleContext.DEFAULT_STYLE); - Style newStyle = StyleContext.getDefaultStyleContext().addStyle(null, defaultStyle); - - StyleConstants.setBackground(newStyle, lessColor(c)); - return newStyle; - } -} diff -r 0c632ed89063 -r fe0117cb71f2 src/share/tools/IdealGraphVisualizer/GraphTextEditor/build.xml --- a/src/share/tools/IdealGraphVisualizer/GraphTextEditor/build.xml Fri Jan 27 23:31:28 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ - - - - - - Builds, tests, and runs the project com.sun.hotspot.igv.graphtexteditor. - - diff -r 0c632ed89063 -r fe0117cb71f2 src/share/tools/IdealGraphVisualizer/GraphTextEditor/manifest.mf --- a/src/share/tools/IdealGraphVisualizer/GraphTextEditor/manifest.mf Fri Jan 27 23:31:28 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -Manifest-Version: 1.0 -OpenIDE-Module: com.sun.hotspot.igv.graphtexteditor -OpenIDE-Module-Layer: com/sun/hotspot/igv/graphtexteditor/layer.xml -OpenIDE-Module-Localizing-Bundle: com/sun/hotspot/igv/graphtexteditor/Bundle.properties -OpenIDE-Module-Specification-Version: 1.0 - diff -r 0c632ed89063 -r fe0117cb71f2 src/share/tools/IdealGraphVisualizer/GraphTextEditor/nbproject/build-impl.xml --- a/src/share/tools/IdealGraphVisualizer/GraphTextEditor/nbproject/build-impl.xml Fri Jan 27 23:31:28 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ - - - - - - - - - - - - - You must set 'suite.dir' to point to your containing module suite - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 0c632ed89063 -r fe0117cb71f2 src/share/tools/IdealGraphVisualizer/GraphTextEditor/nbproject/genfiles.properties --- a/src/share/tools/IdealGraphVisualizer/GraphTextEditor/nbproject/genfiles.properties Fri Jan 27 23:31:28 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. -# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=f0880ef0 -nbproject/build-impl.xml.script.CRC32=9388e04e -nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.45.1 diff -r 0c632ed89063 -r fe0117cb71f2 src/share/tools/IdealGraphVisualizer/GraphTextEditor/nbproject/project.properties --- a/src/share/tools/IdealGraphVisualizer/GraphTextEditor/nbproject/project.properties Fri Jan 27 23:31:28 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -javac.source=1.5 -javac.compilerargs=-Xlint -Xlint:-serial diff -r 0c632ed89063 -r fe0117cb71f2 src/share/tools/IdealGraphVisualizer/GraphTextEditor/nbproject/project.xml --- a/src/share/tools/IdealGraphVisualizer/GraphTextEditor/nbproject/project.xml Fri Jan 27 23:31:28 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ - - - org.netbeans.modules.apisupport.project - - - com.sun.hotspot.igv.graphtexteditor - - - - com.sun.hotspot.igv.data - - - - 1.0 - - - - com.sun.hotspot.igv.graph - - - - 1.0 - - - - com.sun.hotspot.igv.graphtotext - - - - 1.0 - - - - com.sun.hotspot.igv.selectioncoordinator - - - - 1.0 - - - - com.sun.hotspot.igv.structuredtext - - - - 1.0 - - - - com.sun.hotspot.igv.texteditor - - - - 1.0 - - - - com.sun.hotspot.igv.util - - - - 1.0 - - - - org.netbeans.modules.diff - - - - 1 - 1.32.1.42.1 - - - - org.openide.util - - - - 7.12.0.1 - - - - org.openide.util.lookup - - - - 8.6.1 - - - - org.openide.windows - - - - 6.20 - - - - - - - diff -r 0c632ed89063 -r fe0117cb71f2 src/share/tools/IdealGraphVisualizer/GraphTextEditor/nbproject/suite.properties --- a/src/share/tools/IdealGraphVisualizer/GraphTextEditor/nbproject/suite.properties Fri Jan 27 23:31:28 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -suite.dir=${basedir}/.. diff -r 0c632ed89063 -r fe0117cb71f2 src/share/tools/IdealGraphVisualizer/GraphToText/build.xml --- a/src/share/tools/IdealGraphVisualizer/GraphToText/build.xml Fri Jan 27 23:31:28 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ - - - - - - Builds, tests, and runs the project com.sun.hotspot.igv.graphtotext. - - diff -r 0c632ed89063 -r fe0117cb71f2 src/share/tools/IdealGraphVisualizer/GraphToText/manifest.mf --- a/src/share/tools/IdealGraphVisualizer/GraphToText/manifest.mf Fri Jan 27 23:31:28 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -Manifest-Version: 1.0 -OpenIDE-Module: com.sun.hotspot.igv.graphtotext -OpenIDE-Module-Localizing-Bundle: com/sun/hotspot/igv/graphtotext/Bundle.properties -OpenIDE-Module-Specification-Version: 1.0 - diff -r 0c632ed89063 -r fe0117cb71f2 src/share/tools/IdealGraphVisualizer/GraphToText/nbproject/build-impl.xml --- a/src/share/tools/IdealGraphVisualizer/GraphToText/nbproject/build-impl.xml Fri Jan 27 23:31:28 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ - - - - - - - - - - - - - You must set 'suite.dir' to point to your containing module suite - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 0c632ed89063 -r fe0117cb71f2 src/share/tools/IdealGraphVisualizer/GraphToText/nbproject/genfiles.properties --- a/src/share/tools/IdealGraphVisualizer/GraphToText/nbproject/genfiles.properties Fri Jan 27 23:31:28 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. -# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=10eff8f6 -nbproject/build-impl.xml.script.CRC32=b176ca1a -nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.45.1 diff -r 0c632ed89063 -r fe0117cb71f2 src/share/tools/IdealGraphVisualizer/GraphToText/nbproject/platform.properties --- a/src/share/tools/IdealGraphVisualizer/GraphToText/nbproject/platform.properties Fri Jan 27 23:31:28 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,175 +0,0 @@ -cluster.path=\ - ${nbplatform.active.dir}/ide:\ - ${nbplatform.active.dir}/platform -disabled.modules=\ - org.apache.xml.resolver,\ - org.mozilla.rhino.patched,\ - org.netbeans.api.debugger,\ - org.netbeans.api.java.classpath,\ - org.netbeans.api.xml,\ - org.netbeans.core.browser,\ - org.netbeans.core.execution,\ - org.netbeans.core.ide,\ - org.netbeans.core.multiview,\ - org.netbeans.lib.cvsclient,\ - org.netbeans.lib.terminalemulator,\ - org.netbeans.libs.antlr3.runtime,\ - org.netbeans.libs.bugtracking,\ - org.netbeans.libs.bugzilla,\ - org.netbeans.libs.bytelist,\ - org.netbeans.libs.commons_codec,\ - org.netbeans.libs.commons_logging,\ - org.netbeans.libs.commons_net,\ - org.netbeans.libs.freemarker,\ - org.netbeans.libs.ini4j,\ - org.netbeans.libs.jakarta_oro,\ - org.netbeans.libs.jaxb,\ - org.netbeans.libs.jsch,\ - org.netbeans.libs.jsr223,\ - org.netbeans.libs.jvyamlb,\ - org.netbeans.libs.jzlib,\ - org.netbeans.libs.lucene,\ - org.netbeans.libs.smack,\ - org.netbeans.libs.svnClientAdapter,\ - org.netbeans.libs.svnClientAdapter.javahl,\ - org.netbeans.libs.svnClientAdapter.svnkit,\ - org.netbeans.libs.swingx,\ - org.netbeans.libs.xerces,\ - org.netbeans.modules.autoupdate.services,\ - org.netbeans.modules.autoupdate.ui,\ - org.netbeans.modules.bugtracking,\ - org.netbeans.modules.bugtracking.bridge,\ - org.netbeans.modules.bugzilla,\ - org.netbeans.modules.core.kit,\ - org.netbeans.modules.csl.api,\ - org.netbeans.modules.css.editor,\ - org.netbeans.modules.css.visual,\ - org.netbeans.modules.db,\ - org.netbeans.modules.db.core,\ - org.netbeans.modules.db.dataview,\ - org.netbeans.modules.db.drivers,\ - org.netbeans.modules.db.kit,\ - org.netbeans.modules.db.metadata.model,\ - org.netbeans.modules.db.mysql,\ - org.netbeans.modules.db.sql.editor,\ - org.netbeans.modules.db.sql.visualeditor,\ - org.netbeans.modules.dbapi,\ - org.netbeans.modules.defaults,\ - org.netbeans.modules.derby,\ - org.netbeans.modules.diff,\ - org.netbeans.modules.dlight.nativeexecution,\ - org.netbeans.modules.dlight.terminal,\ - org.netbeans.modules.editor.bookmarks,\ - org.netbeans.modules.editor.bracesmatching,\ - org.netbeans.modules.editor.codetemplates,\ - org.netbeans.modules.editor.completion,\ - org.netbeans.modules.editor.errorstripe,\ - org.netbeans.modules.editor.errorstripe.api,\ - org.netbeans.modules.editor.guards,\ - org.netbeans.modules.editor.indent.project,\ - org.netbeans.modules.editor.kit,\ - org.netbeans.modules.editor.macros,\ - org.netbeans.modules.editor.plain,\ - org.netbeans.modules.editor.plain.lib,\ - org.netbeans.modules.editor.structure,\ - org.netbeans.modules.extbrowser,\ - org.netbeans.modules.extexecution,\ - org.netbeans.modules.extexecution.destroy,\ - org.netbeans.modules.favorites,\ - org.netbeans.modules.glassfish.common,\ - org.netbeans.modules.gototest,\ - org.netbeans.modules.gsf.codecoverage,\ - org.netbeans.modules.gsf.testrunner,\ - org.netbeans.modules.html,\ - org.netbeans.modules.html.editor,\ - org.netbeans.modules.html.editor.lib,\ - org.netbeans.modules.html.lexer,\ - org.netbeans.modules.html.parser,\ - org.netbeans.modules.html.validation,\ - org.netbeans.modules.httpserver,\ - org.netbeans.modules.hudson,\ - org.netbeans.modules.hudson.mercurial,\ - org.netbeans.modules.hudson.subversion,\ - org.netbeans.modules.ide.kit,\ - org.netbeans.modules.image,\ - org.netbeans.modules.javascript.editing,\ - org.netbeans.modules.javascript.hints,\ - org.netbeans.modules.javascript.kit,\ - org.netbeans.modules.javascript.refactoring,\ - org.netbeans.modules.jellytools.ide,\ - org.netbeans.modules.jumpto,\ - org.netbeans.modules.languages,\ - org.netbeans.modules.languages.diff,\ - org.netbeans.modules.languages.manifest,\ - org.netbeans.modules.languages.yaml,\ - org.netbeans.modules.lexer.nbbridge,\ - org.netbeans.modules.localhistory,\ - org.netbeans.modules.mercurial,\ - org.netbeans.modules.options.editor,\ - org.netbeans.modules.parsing.api,\ - org.netbeans.modules.parsing.lucene,\ - org.netbeans.modules.print.editor,\ - org.netbeans.modules.project.ant,\ - org.netbeans.modules.project.libraries,\ - org.netbeans.modules.projectapi,\ - org.netbeans.modules.projectui,\ - org.netbeans.modules.projectui.buildmenu,\ - org.netbeans.modules.projectuiapi,\ - org.netbeans.modules.properties,\ - org.netbeans.modules.properties.syntax,\ - org.netbeans.modules.refactoring.api,\ - org.netbeans.modules.schema2beans,\ - org.netbeans.modules.server,\ - org.netbeans.modules.servletapi,\ - org.netbeans.modules.spellchecker,\ - org.netbeans.modules.spellchecker.apimodule,\ - org.netbeans.modules.spellchecker.bindings.htmlxml,\ - org.netbeans.modules.spellchecker.bindings.properties,\ - org.netbeans.modules.spellchecker.dictionary_en,\ - org.netbeans.modules.spellchecker.kit,\ - org.netbeans.modules.subversion,\ - org.netbeans.modules.swing.validation,\ - org.netbeans.modules.target.iterator,\ - org.netbeans.modules.tasklist.kit,\ - org.netbeans.modules.tasklist.projectint,\ - org.netbeans.modules.tasklist.todo,\ - org.netbeans.modules.tasklist.ui,\ - org.netbeans.modules.terminal,\ - org.netbeans.modules.usersguide,\ - org.netbeans.modules.utilities,\ - org.netbeans.modules.utilities.project,\ - org.netbeans.modules.versioning,\ - org.netbeans.modules.versioning.indexingbridge,\ - org.netbeans.modules.versioning.system.cvss,\ - org.netbeans.modules.versioning.util,\ - org.netbeans.modules.web.client.tools.api,\ - org.netbeans.modules.web.common,\ - org.netbeans.modules.xml,\ - org.netbeans.modules.xml.axi,\ - org.netbeans.modules.xml.catalog,\ - org.netbeans.modules.xml.core,\ - org.netbeans.modules.xml.jaxb.api,\ - org.netbeans.modules.xml.lexer,\ - org.netbeans.modules.xml.multiview,\ - org.netbeans.modules.xml.retriever,\ - org.netbeans.modules.xml.schema.completion,\ - org.netbeans.modules.xml.schema.model,\ - org.netbeans.modules.xml.tax,\ - org.netbeans.modules.xml.text,\ - org.netbeans.modules.xml.tools,\ - org.netbeans.modules.xml.wsdl.model,\ - org.netbeans.modules.xml.xam,\ - org.netbeans.modules.xml.xdm,\ - org.netbeans.modules.xsl,\ - org.netbeans.spi.debugger.ui,\ - org.netbeans.spi.editor.hints,\ - org.netbeans.spi.navigator,\ - org.netbeans.spi.palette,\ - org.netbeans.spi.tasklist,\ - org.netbeans.spi.viewmodel,\ - org.netbeans.swing.dirchooser,\ - org.openide.compat,\ - org.openide.execution,\ - org.openide.options,\ - org.openide.util.enumerations -nbplatform.active=default diff -r 0c632ed89063 -r fe0117cb71f2 src/share/tools/IdealGraphVisualizer/GraphToText/nbproject/project.properties --- a/src/share/tools/IdealGraphVisualizer/GraphToText/nbproject/project.properties Fri Jan 27 23:31:28 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -javac.source=1.5 -javac.compilerargs=-Xlint -Xlint:-serial diff -r 0c632ed89063 -r fe0117cb71f2 src/share/tools/IdealGraphVisualizer/GraphToText/nbproject/project.xml --- a/src/share/tools/IdealGraphVisualizer/GraphToText/nbproject/project.xml Fri Jan 27 23:31:28 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ - - - org.netbeans.modules.apisupport.project - - - com.sun.hotspot.igv.graphtotext - - - - com.sun.hotspot.igv.data - - - - 1.0 - - - - com.sun.hotspot.igv.graph - - - - 1.0 - - - - com.sun.hotspot.igv.structuredtext - - - - 1.0 - - - - - com.sun.hotspot.igv.graphtotext - com.sun.hotspot.igv.graphtotext.services - - - - diff -r 0c632ed89063 -r fe0117cb71f2 src/share/tools/IdealGraphVisualizer/GraphToText/nbproject/suite.properties --- a/src/share/tools/IdealGraphVisualizer/GraphToText/nbproject/suite.properties Fri Jan 27 23:31:28 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -suite.dir=${basedir}/.. diff -r 0c632ed89063 -r fe0117cb71f2 src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/project.xml --- a/src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/project.xml Fri Jan 27 23:31:28 2012 +0100 +++ b/src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/project.xml Fri Jan 27 23:32:59 2012 +0100 @@ -1,45 +1,37 @@ - - - org.netbeans.modules.apisupport.project - - - com.sun.hotspot.igv.servercompiler - - - - com.sun.hotspot.igv.data - - - - 1.0 - - - - com.sun.hotspot.igv.graph - - - - 1.0 - - - - com.sun.hotspot.igv.graphtotext - - - - 1.0 - - - - com.sun.hotspot.igv.structuredtext - - - - 1.0 - - - - - - - + + + org.netbeans.modules.apisupport.project + + + com.sun.hotspot.igv.servercompiler + + + + com.sun.hotspot.igv.data + + + + 1.0 + + + + com.sun.hotspot.igv.graph + + + + 1.0 + + + + com.sun.hotspot.igv.structuredtext + + + + 1.0 + + + + + + + diff -r 0c632ed89063 -r fe0117cb71f2 src/share/tools/IdealGraphVisualizer/ServerCompiler/src/META-INF/services/com.sun.hotspot.igv.graphtotext.services.GraphToTextConverter --- a/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/META-INF/services/com.sun.hotspot.igv.graphtotext.services.GraphToTextConverter Fri Jan 27 23:31:28 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -com.sun.hotspot.igv.servercompiler.ServerCompilerGraphToTextConverter \ No newline at end of file diff -r 0c632ed89063 -r fe0117cb71f2 src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/ServerCompilerGraphToTextConverter.java --- a/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/ServerCompilerGraphToTextConverter.java Fri Jan 27 23:31:28 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,176 +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.servercompiler; - -import com.sun.hotspot.igv.data.InputBlock; -import com.sun.hotspot.igv.data.InputEdge; -import com.sun.hotspot.igv.data.InputGraph; -import com.sun.hotspot.igv.data.InputNode; -import com.sun.hotspot.igv.data.Properties; -import com.sun.hotspot.igv.data.Properties.PropertyMatcher; -import com.sun.hotspot.igv.data.Properties.PropertySelector; -import com.sun.hotspot.igv.graph.Diagram; -import com.sun.hotspot.igv.graph.Figure; -import com.sun.hotspot.igv.graphtotext.services.GraphToTextConverter; -import com.sun.hotspot.igv.structuredtext.Element; -import com.sun.hotspot.igv.structuredtext.MultiElement; -import com.sun.hotspot.igv.structuredtext.SimpleElement; -import com.sun.hotspot.igv.structuredtext.StructuredText; -import java.awt.Color; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Set; -import javax.swing.text.Style; -import javax.swing.text.StyleConstants; -import javax.swing.text.StyleContext; - -/** - * - * @author Thomas Wuerthinger - */ -public class ServerCompilerGraphToTextConverter implements GraphToTextConverter { - - - private Map> map; - private Map> ingoingEdges; - private Map> outgoingEdges; - private InputGraph graph; - - private Collection sortNodes(Collection nodes) { - List result = new ArrayList(nodes); - - Collections.sort(result, InputNode.getPropertyComparator("idx")); - - - return result; - } - - public StructuredText convert(InputGraph graph, Diagram diagram) { - - this.graph = graph; - map = diagram.calcSourceToFigureRelation(); - ingoingEdges = graph.findAllIngoingEdges(); - outgoingEdges = graph.findAllOutgoingEdges(); - - final StructuredText result = new StructuredText(graph.getName()); - - for (InputBlock b : graph.getBlocks()) { - result.addChild(new SimpleElement("Block " + b.getName() + "\n")); - for (InputNode n : sortNodes(b.getNodes())) { - result.addChild(getNodeElement(n)); - } - } - - boolean first = true; - for (InputNode n : sortNodes(graph.getNodes())) { - if (graph.getBlock(n) == null) { - if (first) { - first = false; - result.addChild(new SimpleElement("No block: \n")); - } - result.addChild(getNodeElement(n)); - } - } - - - return result; - } - - private Element getNodeNameElement(InputNode n) { - - final SimpleElement name = new SimpleElement(n.getProperties().get("idx") + " " + n.getProperties().get("name"), calcStyle(n)); - name.addSource(n.getId()); - return name; - } - - private Element getNodeSmallElement(InputNode n) { - final SimpleElement id = new SimpleElement(n.getProperties().get("idx"), calcStyle(n)); - id.addSource(n.getId()); - return id; - } - - private Element getNodeElement(InputNode n) { - - final MultiElement result = new MultiElement(); - - result.print("\t"); - result.addChild(getNodeNameElement(n)); - - result.print(" === "); - - for (InputEdge e : outgoingEdges.get(n)) { - result.print(" "); - result.addChild(getNodeSmallElement(graph.getNode(e.getTo()))); - result.print(" "); - } - - result.print(" [["); - - for (InputEdge e : ingoingEdges.get(n)) { - result.print(" "); - result.addChild(getNodeSmallElement(graph.getNode(e.getFrom()))); - result.print(" "); - } - - result.print("]] "); - - result.print(n.getProperties().get("dump_spec")); - - result.print("\n"); - - return result; - } - - private static final PropertyMatcher MATCHER = new Properties.RegexpPropertyMatcher("name", "Root"); - public boolean canConvert(InputGraph graph) { - return new PropertySelector(graph.getNodes()).selectSingle(MATCHER) != null; - } - - private Color calcColor(InputNode node) { - Set
figureSet = this.map.get(node); - if(figureSet != null && figureSet.size() == 1) { - return figureSet.iterator().next().getColor(); - } else { - return Color.WHITE; - } - } - - private Color lessColor(Color c) { - return new Color(255 - (255 - c.getRed()) / 4, 255 - (255 - c.getGreen()) / 4, 255 - (255 - c.getBlue()) / 4); - } - - private Style calcStyle(InputNode node) { - Color c = calcColor(node); - Style defaultStyle = StyleContext.getDefaultStyleContext().getStyle(StyleContext.DEFAULT_STYLE); - Style newStyle = StyleContext.getDefaultStyleContext().addStyle(null, defaultStyle); - - StyleConstants.setBackground(newStyle, lessColor(c)); - return newStyle; - } -} diff -r 0c632ed89063 -r fe0117cb71f2 src/share/tools/IdealGraphVisualizer/nbproject/project.properties --- a/src/share/tools/IdealGraphVisualizer/nbproject/project.properties Fri Jan 27 23:31:28 2012 +0100 +++ b/src/share/tools/IdealGraphVisualizer/nbproject/project.properties Fri Jan 27 23:32:59 2012 +0100 @@ -19,8 +19,6 @@ ${project.com.sun.hotspot.connection}:\ ${project.com.sun.hotspot.igv.servercompilerscheduler}:\ ${project.com.sun.hotspot.igv.filterwindow}:\ - ${project.com.sun.hotspot.igv.graphtotext}:\ - ${project.com.sun.hotspot.igv.graphtexteditor}:\ ${project.com.sun.hotspot.igv.structuredtext}:\ ${project.com.sun.hotspot.igv.texteditor}:\ ${project.com.sun.hotspot.igv.selectioncoordinator}:\ @@ -35,8 +33,6 @@ project.com.sun.hotspot.igv.filterwindow=FilterWindow project.com.sun.hotspot.igv.graal=Graal project.com.sun.hotspot.igv.graph=Graph -project.com.sun.hotspot.igv.graphtexteditor=GraphTextEditor -project.com.sun.hotspot.igv.graphtotext=GraphToText project.com.sun.hotspot.igv.hierarchicallayout=HierarchicalLayout project.com.sun.hotspot.igv.layout=Layout project.com.sun.hotspot.igv.selectioncoordinator=SelectionCoordinator