comparison visualizer/Filter/src/com/sun/hotspot/igv/filter/helper.js @ 4512:015fb895586b

Moved visualizer to new directory.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Tue, 07 Feb 2012 22:41:09 +0100
parents
children
comparison
equal deleted inserted replaced
4511:6cb549627941 4512:015fb895586b
1 /*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 /**
26 *
27 * @author Thomas Wuerthinger
28 */
29
30 function colorize(property, regexp, color) {
31 var f = new ColorFilter("");
32 f.addRule(new ColorFilter.ColorRule(new MatcherSelector(new Properties.RegexpPropertyMatcher(property, regexp)), color));
33 f.apply(graph);
34 }
35
36 function remove(property, regexp) {
37 var f = new RemoveFilter("");
38 f.addRule(new RemoveFilter.RemoveRule(new MatcherSelector(new Properties.RegexpPropertyMatcher(property, regexp))));
39 f.apply(graph);
40 }
41
42 function removeIncludingOrphans(property, regexp) {
43 var f = new RemoveFilter("");
44 f.addRule(new RemoveFilter.RemoveRule(new MatcherSelector(new Properties.RegexpPropertyMatcher(property, regexp)), true));
45 f.apply(graph);
46 }
47
48 function split(property, regexp, propertyName) {
49 if (propertyName == undefined) {
50 propertyName = graph.getNodeText();
51 }
52 var f = new SplitFilter("", new MatcherSelector(new Properties.RegexpPropertyMatcher(property, regexp)), propertyName);
53 f.apply(graph);
54 }
55
56 function removeInputs(property, regexp, from, to) {
57 var f = new RemoveInputsFilter("");
58 if(from == undefined && to == undefined) {
59 f.addRule(new RemoveInputsFilter.RemoveInputsRule(new MatcherSelector(new Properties.RegexpPropertyMatcher(property, regexp))));
60 } else if(to == undefined) {
61 f.addRule(new RemoveInputsFilter.RemoveInputsRule(new MatcherSelector(new Properties.RegexpPropertyMatcher(property, regexp)), from));
62 } else {
63 f.addRule(new RemoveInputsFilter.RemoveInputsRule(new MatcherSelector(new Properties.RegexpPropertyMatcher(property, regexp)), from, to));
64 }
65 f.apply(graph);
66 }
67
68 function removeUnconnectedSlots(inputs, outputs) {
69 var f = new UnconnectedSlotFilter(inputs, outputs);
70 f.apply(graph);
71 }
72
73 function colorizeGradient(property, min, max) {
74 var f = new GradientColorFilter();
75 f.setPropertyName(property);
76 f.setMinValue(min);
77 f.setMaxValue(max);
78 f.apply(graph);
79 }
80
81 function colorizeGradientWithMode(property, min, max, mode) {
82 var f = new GradientColorFilter();
83 f.setPropertyName(property);
84 f.setMinValue(min);
85 f.setMaxValue(max);
86 f.setMode(mode);
87 f.apply(graph);
88 }
89
90 function colorizeGradientCustom(property, min, max, mode, colors, fractions, nshades) {
91 var f = new GradientColorFilter();
92 f.setPropertyName(property);
93 f.setMinValue(min);
94 f.setMaxValue(max);
95 f.setMode(mode);
96 f.setColors(colors);
97 f.setFractions(fractions);
98 f.setShadeCount(nshades);
99 f.apply(graph);
100 }
101
102 var black = Color.black;
103 var blue = Color.blue;
104 var cyan = Color.cyan;
105 var darkGray = Color.darkGray;
106 var gray = Color.gray;
107 var green = Color.green;
108 var lightGray = Color.lightGray;
109 var magenta = Color.magenta;
110 var orange = Color.orange;
111 var pink = Color.pink
112 var red = Color.red;
113 var yellow = Color.yellow;
114 var white = Color.white;