comparison src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Figure.java @ 21146:33ff6b03fad1

add support for control flow window and basic block view on graphs Contributed-by: Michael Haupt <michael.haupt@oracle.com> Contributed-by: Peter Hofer <peter.hofer@jku.at> Contributed-by: Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
author Michael Haupt <michael.haupt@oracle.com>
date Wed, 29 Apr 2015 08:31:28 +0200
parents 3c78119de0cd
children
comparison
equal deleted inserted replaced
21142:0b221b4ad707 21146:33ff6b03fad1
1 /* 1 /*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 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 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
21 * questions. 21 * questions.
22 * 22 *
23 */ 23 */
24 package com.sun.hotspot.igv.graph; 24 package com.sun.hotspot.igv.graph;
25 25
26 import com.sun.hotspot.igv.data.InputBlock;
26 import com.sun.hotspot.igv.data.InputGraph; 27 import com.sun.hotspot.igv.data.InputGraph;
27 import com.sun.hotspot.igv.data.InputNode; 28 import com.sun.hotspot.igv.data.InputNode;
28 import com.sun.hotspot.igv.data.Properties; 29 import com.sun.hotspot.igv.data.Properties;
29 import com.sun.hotspot.igv.data.Source; 30 import com.sun.hotspot.igv.data.Source;
31 import com.sun.hotspot.igv.layout.Cluster;
30 import com.sun.hotspot.igv.layout.Vertex; 32 import com.sun.hotspot.igv.layout.Vertex;
31 import java.awt.*; 33 import java.awt.*;
32 import java.awt.image.BufferedImage; 34 import java.awt.image.BufferedImage;
33 import java.util.List; 35 import java.util.List;
34 import java.util.*; 36 import java.util.*;
336 338
337 @Override 339 @Override
338 public String toString() { 340 public String toString() {
339 return idString; 341 return idString;
340 } 342 }
343
344 public Cluster getCluster() {
345 if (getSource().getSourceNodes().size() == 0) {
346 assert false : "Should never reach here, every figure must have at least one source node!";
347 return null;
348 } else {
349 final InputBlock inputBlock = diagram.getGraph().getBlock(getSource().getSourceNodes().get(0));
350 assert inputBlock != null;
351 Cluster result = diagram.getBlock(inputBlock);
352 assert result != null;
353 return result;
354 }
355 }
341 356
342 @Override 357 @Override
343 public boolean isRoot() { 358 public boolean isRoot() {
344 359
345 List<InputNode> sourceNodes = source.getSourceNodes(); 360 List<InputNode> sourceNodes = source.getSourceNodes();