Java Code Examples for com.sun.hotspot.igv.graph.Figure#setColor()
The following examples show how to use
com.sun.hotspot.igv.graph.Figure#setColor() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ColorFilter.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
private void applyRule(ColorRule rule, Figure f) { if (rule.getColor() != null) { f.setColor(rule.getColor()); } Color color = rule.getLineColor(); ConnectionStyle style = rule.getLineStyle(); for (OutputSlot s : f.getOutputSlots()) { for (Connection c : s.getConnections()) { if (color != null) { c.setColor(color); } if (style != null) { c.setStyle(style); } } } }
Example 2
Source File: ColorFilter.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
private void applyRule(ColorRule rule, Figure f) { if (rule.getColor() != null) { f.setColor(rule.getColor()); } Color color = rule.getLineColor(); ConnectionStyle style = rule.getLineStyle(); for (OutputSlot s : f.getOutputSlots()) { for (Connection c : s.getConnections()) { if (color != null) { c.setColor(color); } if (style != null) { c.setStyle(style); } } } }
Example 3
Source File: ColorFilter.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
private void applyRule(ColorRule rule, Figure f) { if (rule.getColor() != null) { f.setColor(rule.getColor()); } Color color = rule.getLineColor(); ConnectionStyle style = rule.getLineStyle(); for (OutputSlot s : f.getOutputSlots()) { for (Connection c : s.getConnections()) { if (color != null) { c.setColor(color); } if (style != null) { c.setStyle(style); } } } }
Example 4
Source File: ColorFilter.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
private void applyRule(ColorRule rule, Figure f) { if (rule.getColor() != null) { f.setColor(rule.getColor()); } Color color = rule.getLineColor(); ConnectionStyle style = rule.getLineStyle(); for (OutputSlot s : f.getOutputSlots()) { for (Connection c : s.getConnections()) { if (color != null) { c.setColor(color); } if (style != null) { c.setStyle(style); } } } }
Example 5
Source File: ColorFilter.java From hottub with GNU General Public License v2.0 | 6 votes |
private void applyRule(ColorRule rule, Figure f) { if (rule.getColor() != null) { f.setColor(rule.getColor()); } Color color = rule.getLineColor(); ConnectionStyle style = rule.getLineStyle(); for (OutputSlot s : f.getOutputSlots()) { for (Connection c : s.getConnections()) { if (color != null) { c.setColor(color); } if (style != null) { c.setStyle(style); } } } }
Example 6
Source File: ColorFilter.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
private void applyRule(ColorRule rule, Figure f) { if (rule.getColor() != null) { f.setColor(rule.getColor()); } Color color = rule.getLineColor(); ConnectionStyle style = rule.getLineStyle(); for (OutputSlot s : f.getOutputSlots()) { for (Connection c : s.getConnections()) { if (color != null) { c.setColor(color); } if (style != null) { c.setStyle(style); } } } }
Example 7
Source File: ColorFilter.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
private void applyRule(ColorRule rule, Figure f) { if (rule.getColor() != null) { f.setColor(rule.getColor()); } Color color = rule.getLineColor(); ConnectionStyle style = rule.getLineStyle(); for (OutputSlot s : f.getOutputSlots()) { for (Connection c : s.getConnections()) { if (color != null) { c.setColor(color); } if (style != null) { c.setStyle(style); } } } }
Example 8
Source File: GradientColorFilter.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
@Override public void apply(Diagram d) { boolean logarithmic = mode.equalsIgnoreCase(LOGARITHMIC); if (!logarithmic && !mode.equalsIgnoreCase(LINEAR)) { throw new RuntimeException("Unknown mode: " + mode); } Rectangle bounds = new Rectangle(shadeCount, 1); LinearGradientPaint lgp = new LinearGradientPaint(bounds.x, bounds.y, bounds.width, bounds.y, fractions, colors); PaintContext context = lgp.createContext(null, bounds, bounds.getBounds2D(), AffineTransform.getTranslateInstance(0, 0), new RenderingHints(null)); Raster raster = context.getRaster(bounds.x, bounds.y, bounds.width, bounds.height); int[] rgb = raster.getPixels(bounds.x, bounds.y, bounds.width, bounds.height, (int[]) null); Color[] shades = new Color[rgb.length / 3]; for (int i = 0; i < shades.length; ++i) { shades[i] = new Color(rgb[i * 3], rgb[i * 3 + 1], rgb[i * 3 + 2]); } List<Figure> figures = d.getFigures(); for (Figure f : figures) { String property = f.getProperties().get(propertyName); if (property != null) { try { float value = Float.parseFloat(property); Color nodeColor; if (value <= minValue) { nodeColor = colors[0]; } else if (value >= maxValue) { nodeColor = colors[colors.length - 1]; } else { double normalized = value - minValue; double interval = maxValue - minValue; int index; // Use Math.ceil() to make values above zero distinguishable from zero if (logarithmic) { index = (int) Math.ceil(shades.length * Math.log(1 + normalized) / Math.log(1 + interval)); } else { index = (int) Math.ceil(shades.length * normalized / interval); } nodeColor = shades[index]; } f.setColor(nodeColor); } catch (Exception e) { e.printStackTrace(); } } } }