/[eiffelstudio]/branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/case_tool/eiffel_view/eiffel_factory.e
ViewVC logotype

Contents of /branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/case_tool/eiffel_view/eiffel_factory.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 62078 - (show annotations)
Sun Jul 30 06:26:42 2006 UTC (13 years, 4 months ago) by manus
File size: 7070 byte(s)
EiffelStudio docking branch. It only contains modified classes needed to get the docking version of EiffelStudio.
1 indexing
2 description: "Objects that ..."
3 legal: "See notice at end of class."
4 status: "See notice at end of class."
5 author: ""
6 date: "$Date$"
7 revision: "$Revision$"
8
9 deferred class
10 EIFFEL_FACTORY
11
12 inherit
13 EG_FIGURE_FACTORY
14 rename
15 new_node_figure as new_class_figure
16 redefine
17 world
18 end
19
20 SHARED_WORKBENCH
21 export
22 {NONE} all
23 undefine
24 default_create
25 end
26
27 SHARED_XML_ROUTINES
28 export
29 {NONE} all
30 undefine
31 default_create
32 end
33
34 EB_SHARED_ID_SOLUTION
35 export
36 {NONE} all
37 undefine
38 default_create
39 end
40
41 feature -- Access
42
43 world: EIFFEL_WORLD
44
45 name_string: STRING is "NAME"
46 cluster_name_string: STRING is "CLUSTER_NAME"
47 source_string: STRING is "SOURCE"
48 target_string: STRING is "TARGET"
49 source_cluster_string: STRING is "SOURCE_CLUSTER"
50 target_cluster_string: STRING is "TARGET_CLUSTER"
51 class_id_string: STRING is "CLASS_FIGURE_ID"
52 group_id_string: STRING is "GROUP_ID"
53 cluster_id_string: STRING is "CLUSTER_ID"
54 -- Xml string constants
55
56 model_from_xml (node: XM_ELEMENT): EG_ITEM is
57 -- Create an EG_ITEM from `node' if possible.
58 local
59 node_name, class_name, source_name, target_name: STRING
60 cluster_id, class_id, group_id: STRING
61 cluster_found: CONF_GROUP
62 class_found: CLASS_I
63 source, target: ES_CLASS
64 l_world: like world
65 l_universe: like universe
66 l_classes: LINKED_SET [CONF_CLASS]
67 do
68 l_world := world
69 l_universe := universe
70 node_name := node.name
71 if node_name.is_equal (xml_class_figure_node_name) then
72 class_name := node.attribute_by_name (name_string).value
73 class_id := node.attribute_by_name (class_id_string).value
74 if class_name /= Void and class_id /= Void then
75 group_id := node.attribute_by_name (group_id_string).value
76 if group_id /= Void then
77 cluster_found := group_of_id (group_id)
78 if cluster_found /= Void then
79 l_classes := cluster_found.class_by_name (class_name, False)
80 if not l_classes.is_empty then
81 class_found ?= l_classes.first
82 end
83 if class_found /= Void then
84 create {ES_CLASS} Result.make_with_id (class_found, class_id)
85 else
86 put_class_not_exist_warning (class_name, group_id)
87 end
88 else
89 put_cluster_not_exist_warning (group_id)
90 end
91 else
92 xml_routines.display_error_message ("class " + class_name + " " + group_id_string + " attribute expected")
93 end
94 else
95 xml_routines.display_error_message ("class? " + name_string + ", " + class_id_string + " attributes expected")
96 end
97 elseif node_name.is_equal (xml_cluster_figure_node_name) then
98 group_id := node.attribute_by_name (group_id_string).value
99 cluster_id := node.attribute_by_name (cluster_id_string).value
100 if group_id /= Void and then cluster_id /= Void then
101 cluster_found := group_of_id (group_id)
102 if cluster_found /= Void then
103 create {ES_CLUSTER} Result.make_with_id (cluster_found, cluster_id)
104 else
105 put_cluster_not_exist_warning (group_id)
106 end
107 else
108 xml_routines.display_error_message ("cluster? " + group_id_string + ", " + cluster_id_string + " attribute expected")
109 end
110 elseif node_name.is_equal (xml_client_supplier_figure_node_name) or else node_name.is_equal (xml_inheritance_figure_node_name) then
111 source_name := node.attribute_by_name (source_string).value
112 if source_name /= Void then
113 target_name := node.attribute_by_name (target_string).value
114 if target_name /= Void then
115 source := l_world.model.class_of_id (source_name)
116 target := l_world.model.class_of_id (target_name)
117 if source /= Void and target /= Void then
118 if node_name.is_equal (xml_client_supplier_figure_node_name) then
119 if source.has_supplier (target) then
120 create {ES_CLIENT_SUPPLIER_LINK} Result.make (source, target)
121 end
122 else
123 create {ES_INHERITANCE_LINK} Result.make_with_classes (source, target)
124 end
125 end
126 else
127 xml_routines.display_error_message ("TARGET name attribute expected")
128 end
129 else
130 xml_routines.display_error_message ("SOURCE name attribute expected")
131 end
132 end
133 end
134
135 feature {NONE} -- Implementation
136
137 xml_class_figure_node_name: STRING is
138 -- Name of xml nodes describing class figures.
139 deferred
140 end
141
142 xml_cluster_figure_node_name: STRING is
143 -- Name of xml nodes describing cluster figures.
144 deferred
145 end
146
147 xml_client_supplier_figure_node_name: STRING is
148 -- Name of xml nodes describing client supplier links.
149 deferred
150 end
151
152 xml_inheritance_figure_node_name: STRING is
153 -- Name of xml nodes describing inheritance links.
154 deferred
155 end
156
157 put_class_not_exist_warning (class_name: STRING; group_id: STRING) is
158 -- Put a waring on the screen that class with `class_name' does not exist in the system.
159 local
160 l_output_manager: EB_OUTPUT_MANAGER
161 do
162 l_output_manager := world.context_editor.development_window.output_manager
163 l_output_manager.add_indexing_string ("Loading diagram:")
164 l_output_manager.add_new_line
165 l_output_manager.add_indent
166 l_output_manager.add_string ("Class " + class_name + " is not in " + group_id + " anymore.")
167 l_output_manager.add_new_line
168 end
169
170 put_cluster_not_exist_warning (cluster_name: STRING) is
171 -- Put a warning on the screen saying that class with `cluster_name'
172 local
173 l_output_manager: EB_OUTPUT_MANAGER
174 do
175 l_output_manager := world.context_editor.development_window.output_manager
176 l_output_manager.add_indexing_string ("Loading diagram:")
177 l_output_manager.add_new_line
178 l_output_manager.add_indent
179 l_output_manager.add_string ("Cluster " + cluster_name + " is not in the system anymore.")
180 l_output_manager.add_new_line
181 end
182
183 indexing
184 copyright: "Copyright (c) 1984-2006, Eiffel Software"
185 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
186 licensing_options: "http://www.eiffel.com/licensing"
187 copying: "[
188 This file is part of Eiffel Software's Eiffel Development Environment.
189
190 Eiffel Software's Eiffel Development Environment is free
191 software; you can redistribute it and/or modify it under
192 the terms of the GNU General Public License as published
193 by the Free Software Foundation, version 2 of the License
194 (available at the URL listed under "license" above).
195
196 Eiffel Software's Eiffel Development Environment is
197 distributed in the hope that it will be useful, but
198 WITHOUT ANY WARRANTY; without even the implied warranty
199 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
200 See the GNU General Public License for more details.
201
202 You should have received a copy of the GNU General Public
203 License along with Eiffel Software's Eiffel Development
204 Environment; if not, write to the Free Software Foundation,
205 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
206 ]"
207 source: "[
208 Eiffel Software
209 356 Storke Road, Goleta, CA 93117 USA
210 Telephone 805-685-1006, Fax 805-685-6869
211 Website http://www.eiffel.com
212 Customer support http://support.eiffel.com
213 ]"
214
215 end -- class EIFFEL_FACTORY

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23