01: /*
02: * Jacareto Copyright (c) 2002-2005
03: * Applied Computer Science Research Group, Darmstadt University of
04: * Technology, Institute of Mathematics & Computer Science,
05: * Ludwigsburg University of Education, and Computer Based
06: * Learning Research Group, Aachen University. All rights reserved.
07: *
08: * Jacareto is free software; you can redistribute it and/or
09: * modify it under the terms of the GNU General Public
10: * License as published by the Free Software Foundation; either
11: * version 2 of the License, or (at your option) any later version.
12: *
13: * Jacareto is distributed in the hope that it will be useful,
14: * but WITHOUT ANY WARRANTY; without even the implied warranty of
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16: * General Public License for more details.
17: *
18: * You should have received a copy of the GNU General Public
19: * License along with Jacareto; if not, write to the Free
20: * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21: *
22: */
23:
24: package jacareto.conceptualmodel;
25:
26: import jacareto.system.Environment;
27: import jacareto.system.EnvironmentMember;
28:
29: /**
30: * This is a structure that visualize a conceptual-model.
31: *
32: * @author <a href="mailto:markus.bois@web.de">Markus Bois</a>
33: * @version 1.02
34: */
35: public class ConceptualModel extends EnvironmentMember {
36: /** The root element of the conceptual-model. */
37: private ConceptualModelElement rootElement;
38:
39: /** The conceptual-model tree model. */
40: private ConceptualModelTreeModel conceptualModelTreeModel;
41:
42: /**
43: * Creates a new conceptual-model of the given model.
44: *
45: * @param env the environment
46: * @param rootElement the root of a conceptual-model
47: */
48: public ConceptualModel(Environment env,
49: ConceptualModelElement rootElement) {
50: super (env);
51: this .rootElement = rootElement;
52:
53: // Vielleicht ein StructerListener mal schauen
54: // create the tree model
55: conceptualModelTreeModel = new ConceptualModelTreeModel(env,
56: this );
57: }
58:
59: /**
60: * Returns the root element of the conceptual-model.
61: *
62: * @return DOCUMENT ME!
63: */
64: public ConceptualModelElement getRootElement() {
65: return rootElement;
66: }
67:
68: /**
69: * Returns a tree model of the conceptual-model.
70: *
71: * @return DOCUMENT ME!
72: */
73: public ConceptualModelTreeModel getTreeModel() {
74: return conceptualModelTreeModel;
75: }
76:
77: /**
78: * Clears the conceptual-model.
79: */
80: public void clear() {
81: conceptualModelTreeModel.clear();
82: rootElement.removeAllChildren();
83: }
84:
85: /**
86: * Rebuilds the conceptual-model.
87: *
88: * @param rootElement the root element of another conceptual-model
89: */
90: public void rebuild(ConceptualModelElement rootElement) {
91: clear();
92: this.rootElement = rootElement;
93: conceptualModelTreeModel.rebuild();
94: }
95: }
|