Exemplo n.º 1
0
 public ClusteringGraphApplet() throws HeadlessException {
   super();
   parameters = ApplicationParameters.getSingleton();
   int iColor = parameters.getIntParameter(CONNECTED_EDGE_COLOR_KEY, BLACK_RGB);
   CONNECTED_EDGE_COLOR = new Color(iColor);
   iColor = parameters.getIntParameter(DELETED_EDGE_COLOR_KEY, GREY_RGB);
   DELETED_EDGE_COLOR = new Color(iColor);
   iColor = parameters.getIntParameter(PICKED_COLOR_KEY, CYAN_RGB);
   PICKED_COLOR = new Color(iColor);
   iColor = parameters.getIntParameter(UNPICKED_COLOR_KEY, BLACK_RGB);
   UNPICKED_COLOR = new Color(iColor);
 }
Exemplo n.º 2
0
  protected String groupsToString(StringBuffer buf, Collection<CallGraphNode> clusters) {
    int groupNumber = 1;
    String clusterFormat =
        parameters.getParameter(
            ParameterConstants.CLUSTER_TEXT_FORMAT_KEY, ClusterTextFormatEnum.NEWICK.toString());
    ClusterTextFormatEnum textFormatEnum = ClusterTextFormatEnum.valueOf(clusterFormat);

    for (CallGraphNode node : clusters) {
      buf.append("Group ").append(groupNumber).append(": ");
      buf.append(node.getSimpleName()).append(":\n");
      if (node instanceof CallGraphCluster) {
        CallGraphCluster cluster = (CallGraphCluster) node;

        if (ClusterTextFormatEnum.FLAT.equals(textFormatEnum)) {
          clusterToFlatGroupString(buf, cluster);
        } else {
          cluster.toNestedString(1, buf);
        }
      } else { // Regular CallGraphNode
        buf.append("  ").append(node.getSimpleName()).append("\n");
      }
      groupNumber++;
    }
    String clustersString = buf.toString();
    return clustersString;
  }