View Javadoc
1 /*** 2 * StatReportInfo.java 3 * 4 * Project: Dependency Tool 5 * 6 * WHEN WHO WHAT 7 * 06.06.2003 pko initial public release 8 * 30.10.2002 pko creation 9 * 10 * Copyright 2003 ELCA Informatique SA 11 * Av. de la Harpe 22-24, 1000 Lausanne 13, Switzerland 12 * www.elca.ch 13 * 14 * This library is free software; you can redistribute it and/or 15 * modify it under the terms of the GNU Lesser General Public License 16 * as published by the Free Software Foundation; either version 2.1 of 17 * the License, or (at your option) any later version. 18 * 19 * This library is distributed in the hope that it will be useful, but 20 * WITHOUT ANY WARRANTY; without even the implied warranty of 21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 22 * Lesser General Public License for more details. 23 * 24 * You should have received a copy of the GNU Lesser General Public 25 * License along with this library; if not, write to the Free Software 26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 27 * USA 28 */ 29 30 package ch.elca.dependency.report; 31 32 import javax.swing.tree.DefaultMutableTreeNode; 33 34 import ch.elca.dependency.core.Statistic; 35 36 /*** 37 * <code>StatReportInfo</code> Used to create statistical information 38 * about the analyzed project. 39 * 40 * @author Pawel Kowalski 41 * @version 1.0-beta 42 */ 43 class StatReportInfo extends ReportInfo { 44 45 /*** 46 * Code identifying this ReportInfo 47 */ 48 private static final String CODE_REPORT_INFO_NAME = "stat-filtered"; 49 50 /*** 51 * Text identifying this ReportInfo 52 */ 53 private static final String TEXT_REPORT_INFO_NAME = "filtered statistics"; 54 55 /*** 56 * Code identifying number of classes in project 57 */ 58 private static final String CODE_CLASSES_IN_PROJECT = "classes-in-project"; 59 60 /*** 61 * Text identifying number of classes in project 62 */ 63 private static final String TEXT_CLASSES_IN_PROJECT = "Number of classes in project"; 64 65 /*** 66 * Code identifying number of packages in project 67 */ 68 private static final String CODE_PACKAGES_IN_PROJECT = "packages-in-project"; 69 70 /*** 71 * Text identifying number of packages in project 72 */ 73 private static final String TEXT_PACKAGES_IN_PROJECT = "Number of packages in project"; 74 75 /*** 76 * Code identifying the biggest package 77 */ 78 private static final String CODE_BIGGEST_PACKAGE = "biggest-package"; 79 80 /*** 81 * Text identifying the biggest package 82 */ 83 private static final String TEXT_BIGGEST_PACKAGE = "biggest package"; 84 85 /*** 86 * Code identifying the average number of classes per package 87 */ 88 private static final String CODE_AVG_CLASSES_PER_PACKAGE = "avg-classes-per-package"; 89 90 /*** 91 * Text identifying the average number of classes per package 92 */ 93 private static final String TEXT_AVG_CLASSES_PER_PACKAGE 94 = "average number of classes per package"; 95 96 //****************************************************************************************/ 97 // report method 98 //****************************************************************************************/ 99 100 /*** 101 * Create Information tree containing statistical informations 102 * about the analyzed project. 103 */ 104 void report() { 105 106 Statistic stat = m_dependencyModel.getFilteredStatistic(); 107 ReportObject reportObject = null; 108 DefaultMutableTreeNode treeNode = null; 109 110 // ReportInfo name 111 // 112 reportObject = new ReportObject(CODE_REPORT_INFO_NAME, TEXT_REPORT_INFO_NAME); 113 reportObject.put(Report.INDENT, new Integer(1)); 114 reportObject.put(Report.IS_HEADER, Report.IS_HEADER); 115 m_rootNode.setUserObject(reportObject); 116 117 // number of classes in project 118 // 119 reportObject = new ReportObject(CODE_CLASSES_IN_PROJECT, 120 TEXT_CLASSES_IN_PROJECT, 121 String.valueOf(stat.getAnalyzedClasses())); 122 reportObject.put(Report.INDENT, new Integer(2)); 123 treeNode = new DefaultMutableTreeNode(reportObject); 124 m_rootNode.add(treeNode); 125 126 // number of packages in project 127 // 128 reportObject = new ReportObject(CODE_PACKAGES_IN_PROJECT, 129 TEXT_PACKAGES_IN_PROJECT, 130 String.valueOf(stat.getAnalyzedPackages())); 131 reportObject.put(Report.INDENT, new Integer(2)); 132 treeNode = new DefaultMutableTreeNode(reportObject); 133 m_rootNode.add(treeNode); 134 135 // biggest analyzed package 136 // 137 reportObject = new ReportObject(CODE_BIGGEST_PACKAGE, 138 TEXT_BIGGEST_PACKAGE, 139 String.valueOf(stat.getBiggestAnalyzedPackage())); 140 reportObject.put(Report.INDENT, new Integer(2)); 141 treeNode = new DefaultMutableTreeNode(reportObject); 142 m_rootNode.add(treeNode); 143 144 // average number of classes per package 145 // 146 reportObject = new ReportObject(CODE_AVG_CLASSES_PER_PACKAGE, 147 TEXT_AVG_CLASSES_PER_PACKAGE, 148 String.valueOf(stat.getAverageAnalyzedClassesPerPackage())); 149 reportObject.put(Report.INDENT, new Integer(2)); 150 treeNode = new DefaultMutableTreeNode(reportObject); 151 m_rootNode.add(treeNode); 152 153 } 154 }

This page was automatically generated by Maven