1 /***
2 * ReportInfo.java
3 *
4 * Project: Dependency Tool
5 *
6 * WHEN WHO WHAT
7 * 06.06.2003 pko initial public release
8 * 29.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.DependencyModel;
35
36 /***
37 * <code>ReportInfo</code> is the smallest unit of report information
38 * that can be extracted from a <code>RawModel</code> and/or a
39 * <code>DependencyModel</code>. This is an abstract class. Subclasses
40 * of this class have to override the report method, that defines,
41 * which information will be extracted from the models. The
42 * information retrieve has to be appended to the
43 * <code>m_rootNode</code> instance of
44 * <code>DefaultMutableTreeNode</code> in order to make it available
45 * to the CompositeReportInfo.
46 *
47 * @see ch.elca.dependency.report.Report
48 * @see ch.elca.dependency.rawmodel.RawModel
49 * @see ch.elca.dependency.core.DependencyModel
50 *
51 * @author Pawel Kowalski
52 * @version 1.0-beta
53 */
54 abstract class ReportInfo {
55
56 /***
57 * The DependencyModel of the analyzed Project
58 */
59 DependencyModel m_dependencyModel = null;
60
61 /***
62 * The root information node of this ReportInfo
63 */
64 DefaultMutableTreeNode m_rootNode = null;
65
66 //*********************************************************************************/
67 // constructor
68 //*********************************************************************************/
69
70 /***
71 * Creates a new <code>ReportInfo</code> instance.
72 */
73 ReportInfo() {
74 m_rootNode = new DefaultMutableTreeNode();
75 }
76
77 //*********************************************************************************/
78 // initReportInfo method
79 //*********************************************************************************/
80
81 /***
82 * Initialize this ReportInfo with the specified
83 * <code>DependencyModel</code> and a <code>RawModel</code>.
84 *
85 * @param filteredModel a <code>DependencyModel</code> value
86 * @param rawModel a <code>RawModel</code> value
87 */
88 void initReportInfo(DependencyModel dependencyModel) {
89 m_dependencyModel = dependencyModel;
90 }
91
92 /***
93 * Reinitialize this ReportInfo.
94 */
95 protected void reinitReportInfo() {
96 m_rootNode = new DefaultMutableTreeNode();
97 initReportInfo(m_dependencyModel);
98 }
99
100 //*********************************************************************************/
101 // report method
102 //*********************************************************************************/
103
104 /***
105 * Create Report Information tree containing infos specific to
106 * this ReportInfo. This method must be implemented by concrete
107 * subclasses of this ReportInfo class.
108 */
109 abstract void report();
110
111 //*********************************************************************************/
112 // getReportInfoTree method
113 //*********************************************************************************/
114
115 /***
116 * Get the Report Information tree containing infos specific to
117 * this ReportInfo.
118 *
119 * @return a <code>DefaultMutableTreeNode</code> value
120 */
121 DefaultMutableTreeNode getReportInfoTree() {
122 return m_rootNode;
123 }
124 }
This page was automatically generated by Maven