Exemplo n.º 1
0
  @Override
  protected void doExecute(AnalysisResult result) throws AnalyzerException {

    JavaClassRelationUtil javaClassRelationUtil = new JavaClassRelationUtil(result);

    for (JavaClassRelationInfo info : javaClassRelationUtil.getRelationInfos()) {
      this.printTable("当前JavaClass", info.current);
      this.printTable("依赖的JavaClass", info.depend);
      this.printTable("类型", info.type);
      this.printTable("是否组件间", info.isInner ? "否" : "是");
      this.printTable("强度", info.intensity);
    }

    this.print(javaClassRelationUtil.getSummaryInfo());

    this.printGraphData(this.getGraphData(javaClassRelationUtil));
  }
Exemplo n.º 2
0
  private List<GraphItemData> getGraphData(JavaClassRelationUtil javaClassRelationUtil) {

    List<GraphItemData> items = new ArrayList<GraphItemData>();

    GraphItemData item = new GraphItemData();

    item.setTitle("按类型比例");
    item.setGroup("Graph");
    item.setType(GraphItemData.PIE);
    item.setDatas(javaClassRelationUtil.getTypes());

    items.add(item);

    item = new GraphItemData();

    item.setTitle("按内外比例");
    item.setGroup("Graph");
    item.setType(GraphItemData.PIE);
    item.setDatas(javaClassRelationUtil.getInners());

    items.add(item);

    item = new GraphItemData();

    item.setTitle("组件内按类型比例");
    item.setGroup("Graph");
    item.setType(GraphItemData.PIE);
    item.setDatas(javaClassRelationUtil.getIn_types());

    items.add(item);

    item = new GraphItemData();

    item.setTitle("组件间按类型比例");
    item.setGroup("Graph");
    item.setType(GraphItemData.PIE);
    item.setDatas(javaClassRelationUtil.getExt_types());

    items.add(item);

    return items;
  }