View Javadoc
1 /***
2 * PackagesReportInfo.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 java.util.ArrayList;
33 import java.util.Iterator;
34 import javax.swing.tree.DefaultMutableTreeNode;
35
36 /***
37 * <code>PackagesReportInfo</code> used to create information about
38 * packages withing the analyzed project.
39 *
40 * @tbd lists all packages (the referenced ones and project
41 * packages). this is not of interest. change to project packages only!
42 *
43 * @author Pawel Kowalski
44 * @version 1.0-beta
45 */
46 class PackagesReportInfo extends ReportInfo {
47
48 /***
49 * Code identifying this ReportInfo
50 */
51 private static final String CODE_REPORT_INFO_NAME = "internal-external-packages";
52
53 /***
54 * Text identifying this ReportInfo
55 */
56 private static final String TEXT_REPORT_INFO_NAME = "internal & external packages";
57
58 /***
59 * Code identifying a package
60 */
61 private static final String CODE_PACKAGE = "package";
62
63 /***
64 * Text identifying a package
65 */
66 private static final String TEXT_PACKAGE = "package";
67
68 //****************************************************************************************/
69 // constructor
70 //****************************************************************************************/
71
72 /***
73 * Creates a new <code>PackagesReportInfo</code> instance.
74 */
75 PackagesReportInfo() {
76 super();
77 }
78
79 //****************************************************************************************/
80 // report method
81 //****************************************************************************************/
82
83 /***
84 * Create Information tree containing all packages within the
85 * analyzed project
86 */
87 void report() {
88
89 ReportObject reportObject = null;
90 DefaultMutableTreeNode treeNode = null;
91 String packageName = null;
92 ArrayList packages = m_dependencyModel.getNodeList();
93
94 // ReportInfo name
95 //
96 reportObject = new ReportObject(CODE_REPORT_INFO_NAME, TEXT_REPORT_INFO_NAME);
97 reportObject.put(Report.INDENT, new Integer(1));
98 reportObject.put(Report.IS_HEADER, Report.IS_HEADER);
99 m_rootNode.setUserObject(reportObject);
100
101 // iterate through all packages
102 //
103 for (Iterator iter = packages.iterator(); iter.hasNext(); ) {
104 packageName = (String)iter.next();
105 reportObject = new ReportObject(CODE_PACKAGE, TEXT_PACKAGE,
106 packageName, false);
107 reportObject.put(Report.INDENT, new Integer(2));
108 treeNode = new DefaultMutableTreeNode(reportObject);
109 m_rootNode.add(treeNode);
110 }
111 }
112 }
This page was automatically generated by Maven