/[eiffelstudio]/branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/case_tool/eiffel_studio/eiffel_graph.e
ViewVC logotype

Contents of /branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/case_tool/eiffel_studio/eiffel_graph.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 62171 - (show annotations)
Tue Aug 1 01:27:17 2006 UTC (13 years, 4 months ago) by larryl
File size: 25236 byte(s)
First commit docking tabbed Eiffel Studio.
1 indexing
2 description: "Base class graphs showing a representation of eiffel code."
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 ES_GRAPH
11
12 inherit
13 EG_GRAPH
14 redefine
15 add_node,
16 remove_node,
17 add_link,
18 remove_link,
19 default_create,
20 node_type
21 end
22
23 SHARED_ERROR_HANDLER
24 undefine
25 default_create
26 end
27
28 EV_STOCK_PIXMAPS
29 undefine
30 default_create
31 end
32
33 SHARED_WORKBENCH
34 undefine
35 default_create
36 end
37
38 feature {NONE} -- Initialization
39
40 default_create is
41 -- Create an EIFFEL_GRAPH.
42 local
43 l_comparer: AGENT_BASED_EQUALITY_TESTER [like link_type]
44 do
45 Precursor {EG_GRAPH}
46 create class_name_to_node_lookup.make (50)
47 create l_comparer.make (agent link_comparer)
48 create inheritance_links_lookup.make_with_equality_testers (50, Void, l_comparer)
49 create client_supplier_links_lookup.make_with_equality_testers (100, Void, l_comparer)
50 feature_name_number := 0
51 end
52
53 feature -- Access
54
55 context_editor: EB_DIAGRAM_TOOL
56 -- Container of `Current'.
57 -- Used to access surface on which `Current' is displayed.
58
59 class_of_id (a_id: STRING): ES_CLASS is
60 -- Class of `a_id'
61 require
62 a_id_not_void: a_id /= Void
63 local
64 l_nodes: like nodes
65 l_class: ES_CLASS
66 do
67 from
68 l_nodes := nodes
69 l_nodes.start
70 until
71 l_nodes.after or Result /= Void
72 loop
73 l_class ?= l_nodes.item
74 if l_class /= Void and then l_class.es_class_id.is_equal (a_id) then
75 Result := l_class
76 end
77 l_nodes.forth
78 end
79 end
80
81 class_from_interface (class_i: CLASS_I): ARRAYED_LIST [ES_CLASS] is
82 -- Representation of `class_i', Void if none exists.
83 require
84 class_i_not_void: class_i /= Void
85 local
86 l_nodes: like nodes
87 l_class: ES_CLASS
88 do
89 create Result.make (5)
90 l_nodes := nodes
91 from
92 l_nodes.start
93 until
94 l_nodes.after
95 loop
96 l_class ?= l_nodes.item
97 if l_class /= Void then
98 if l_class.class_i = class_i then
99 Result.extend (l_class)
100 end
101 end
102 l_nodes.forth
103 end
104 ensure
105 result_not_void: Result /= Void
106 end
107
108 top_level_clusters : ARRAYED_LIST [ES_CLUSTER] is
109 -- Top level clusters.
110 local
111 l_clusters : like clusters
112 es_cluster: ES_CLUSTER
113 do
114 create Result.make (5)
115 from
116 l_clusters := clusters
117 l_clusters.start
118 until
119 l_clusters.after
120 loop
121 es_cluster ?= l_clusters.item
122 if es_cluster /= Void then
123 if es_cluster.cluster = Void then
124 Result.extend (es_cluster)
125 end
126 end
127 l_clusters.forth
128 end
129 ensure
130 top_level_clusters_not_void: Result /= Void
131 end
132
133 top_level_classes : ARRAYED_LIST [ES_CLASS] is
134 -- Top level classes.
135 local
136 l_classes: like nodes
137 l_class: ES_CLASS
138 do
139 create Result.make (50)
140 from
141 l_classes := nodes
142 l_classes.start
143 until
144 l_classes.after
145 loop
146 l_class ?= l_classes.item
147 if l_class /= Void then
148 if l_class.cluster = Void then
149 Result.extend (l_class)
150 end
151 end
152 l_classes.forth
153 end
154 ensure
155 top_level_classes_not_void: Result /= Void
156 end
157
158 possible_linkable_node (a_class: ES_CLASS): ARRAYED_LIST [ES_CLASS] is
159 -- Possible linkable node within `a_cluster'
160 -- Top level nodes of `a_cluster' and top level nodes of its libraries.
161 require
162 a_class_not_void: a_class /= Void
163 local
164 l_clusters: ARRAYED_LIST [ES_CLUSTER]
165 l_cluster, l_a_class_cluster : ES_CLUSTER
166 sub_clusters: ARRAYED_LIST [ES_CLUSTER]
167 l_target: CONF_TARGET
168 l_nodes: like nodes
169 l_group: CONF_GROUP
170 top_most_cluster: ES_CLUSTER
171 l_lib: CONF_LIBRARY
172 do
173 l_a_class_cluster := a_class.cluster
174 l_group := a_class.class_i.group
175 create Result.make (100)
176 if l_a_class_cluster = Void then
177 l_target := a_class.class_i.group.target
178 from
179 l_nodes := nodes
180 l_nodes.start
181 until
182 l_nodes.after
183 loop
184 if not l_group.class_by_name (l_nodes.item.class_i.name_in_upper, True).is_empty then
185 Result.extend (l_nodes.item)
186 end
187 l_nodes.forth
188 end
189 else
190 if l_a_class_cluster.group.target = universe.target then
191 l_clusters := top_level_clusters
192 l_target := universe.target
193 else
194 top_most_cluster := top_most_scope (l_a_class_cluster)
195 if top_most_cluster.group.is_library then
196 l_lib ?= top_most_cluster.group
197 l_target := l_lib.library_target
198 l_clusters := top_most_cluster.sub_clusters
199 else
200 l_target := top_most_cluster.group.target
201 create l_clusters.make (1)
202 l_clusters.extend (top_most_cluster)
203 end
204 end
205 from
206 l_clusters.start
207 until
208 l_clusters.after
209 loop
210 l_cluster := l_clusters.item
211 if l_cluster.group.is_cluster then
212 if l_cluster.group.target = l_target then
213 Result.append (l_cluster.sub_nodes_recursive)
214 end
215 elseif l_cluster.group.is_library then
216 if l_cluster.group.target = l_target then
217 sub_clusters := l_cluster.sub_clusters
218 from
219 sub_clusters.start
220 until
221 sub_clusters.after
222 loop
223 if sub_clusters.item.group.is_cluster then
224 Result.append (sub_clusters.item.sub_nodes_recursive)
225 end
226 sub_clusters.forth
227 end
228 end
229 end
230 l_clusters.forth
231 end
232 end
233 ensure
234 Result_not_void: Result /= Void
235 end
236
237 cluster_from_interface (a_group: CONF_GROUP): ARRAYED_LIST [ES_CLUSTER] is
238 -- Representation of `a_group', Void if none exists.
239 require
240 a_group_not_void: a_group /= Void
241 local
242 l_clusters: like clusters
243 es_cluster: ES_CLUSTER
244 do
245 create Result.make (5)
246 from
247 l_clusters := clusters
248 l_clusters.start
249 until
250 l_clusters.after
251 loop
252 es_cluster ?= l_clusters.item
253 if es_cluster /= Void then
254 if es_cluster.group = a_group then
255 Result.extend (es_cluster)
256 end
257 end
258 l_clusters.forth
259 end
260 ensure
261 cluster_from_interface_not_void: Result /= Void
262 end
263
264 inheritance_link_connecting (a_descendant, an_ancestor: EG_LINKABLE): ES_INHERITANCE_LINK is
265 -- Inheritance link connection `a_descendant' with `an_ancestor' if any.
266 require
267 a_descendant_not_void: a_descendant /= Void
268 an_ancestor_not_void: an_ancestor /= Void
269 local
270 l_tuple: like link_type
271 do
272 l_tuple := [a_descendant, an_ancestor]
273 inheritance_links_lookup.search (l_tuple)
274 if inheritance_links_lookup.found then
275 Result := inheritance_links_lookup.found_item
276 end
277 end
278
279 client_supplier_link_connecting (a_client, a_supplier: EG_LINKABLE): ES_CLIENT_SUPPLIER_LINK is
280 -- Client supplier link connecting `a_client' with `a_supplier' if any.
281 require
282 a_client_not_void: a_client /= Void
283 a_supplier_not_void: a_supplier /= Void
284 local
285 l_tuple: like link_type
286 do
287 l_tuple := [a_client, a_supplier]
288 client_supplier_links_lookup.search (l_tuple)
289 if client_supplier_links_lookup.found then
290 Result := client_supplier_links_lookup.found_item
291 end
292 end
293
294 feature -- Element change
295
296 add_node (a_node: ES_CLASS) is
297 -- Add `a_node' to the model.
298 local
299 class_i: CLASS_I
300 do
301 Precursor {EG_GRAPH} (a_node)
302 class_i := a_node.class_i
303 class_name_to_node_lookup.put (a_node, lookup_name_of_class (class_i))
304 end
305
306 add_node_relations (a_node: ES_CLASS) is
307 -- Add relations of `a_node'
308 require
309 a_node_not_void: a_node /= Void
310 do
311 if a_node.class_i.compiled then
312 add_ancestor_relations (a_node)
313 add_descendant_relations (a_node)
314 add_client_relations (a_node)
315 add_supplier_relations (a_node)
316 end
317 end
318
319 remove_node (a_node: ES_CLASS) is
320 -- Remove `a_node' from the model.
321 do
322 Precursor {EG_GRAPH} (a_node)
323 class_name_to_node_lookup.remove (lookup_name_of_class (a_node.class_i))
324 end
325
326 add_link (a_link: EG_LINK) is
327 -- Add `a_link' to the model.
328 local
329 eil: ES_INHERITANCE_LINK
330 ecsl: ES_CLIENT_SUPPLIER_LINK
331 do
332 Precursor {EG_GRAPH} (a_link)
333 eil ?= a_link
334 if eil /= Void then
335 inheritance_links_lookup.force (eil, [eil.descendant, eil.ancestor])
336 end
337 ecsl ?= a_link
338 if ecsl /= Void then
339 client_supplier_links_lookup.force (ecsl, [ecsl.client, ecsl.supplier])
340 end
341 end
342
343 remove_link (a_link: EG_LINK) is
344 -- Remove `a_link' from the model.
345 local
346 eil: ES_INHERITANCE_LINK
347 ecsl: ES_CLIENT_SUPPLIER_LINK
348 do
349 Precursor {EG_GRAPH} (a_link)
350 eil ?= a_link
351 if eil /= Void then
352 inheritance_links_lookup.remove ([eil.descendant, eil.ancestor])
353 end
354 ecsl ?= a_link
355 if ecsl /= Void then
356 client_supplier_links_lookup.remove ([ecsl.client, ecsl.supplier])
357 end
358 end
359
360 feature {EB_DIAGRAM_TOOL} -- Synchronization
361
362 synchronize is
363 -- Contexts need to be updated because of recompilation
364 -- or similar action that needs resynchronization.
365 local
366 l_progress_bar: EB_PERCENT_PROGRESS_BAR
367 l_status_bar: EB_DEVELOPMENT_WINDOW_STATUS_BAR
368 nr_of_items: INTEGER
369 is_cancelled: BOOLEAN
370 do
371 context_editor.develop_window.window.set_pointer_style (wait_cursor)
372 if not is_cancelled then
373 l_status_bar := context_editor.develop_window.status_bar
374
375 nr_of_items := 1 + nodes.count + clusters.count + links.count + 1 + 1
376 l_status_bar.reset_progress_bar_with_range (0 |..| nr_of_items)
377 l_status_bar.display_progress_value (0)
378 l_status_bar.display_message ("Synchronizing diagram tool: Removing unneeded items")
379 remove_unneeded_items
380
381 l_status_bar.display_progress_value (1)
382 l_status_bar.display_message ("Synchronizing diagram tool: Synchronizing clusters")
383 synchronize_clusters (l_progress_bar)
384
385 l_status_bar.display_message ("Synchronizing diagram tool: Synchronizing classes")
386 synchronize_classes (l_progress_bar)
387
388 l_status_bar.display_message ("Synchronizing diagram tool: Synchronizing links")
389 synchronize_links (l_progress_bar)
390
391 l_status_bar.display_progress_value (nr_of_items - 1)
392 l_status_bar.display_message ("Synchronizing diagram tool: Synchronizing class relations")
393 add_classes_relations
394
395 l_status_bar.display_progress_value (nr_of_items)
396 l_status_bar.display_message ("Synchronizing diagram tool: Synchronizing cluster relations")
397 add_clusters_relations
398
399 l_status_bar.reset
400 end
401 context_editor.develop_window.window.set_pointer_style (standard_cursor)
402 rescue
403 context_editor.clear_area
404 is_cancelled := True
405 error_handler.error_list.wipe_out
406 l_status_bar.reset
407 retry
408 end
409
410 feature {EIFFEL_WORLD, EB_CONTEXT_DIAGRAM_COMMAND} -- Insert
411
412 add_classes_relations is
413 -- Add relation between classes in `Current'.
414 local
415 l_classes: like nodes
416 es_class: ES_CLASS
417 i, nb: INTEGER
418 do
419 from
420 l_classes := nodes
421 i := 1
422 nb := l_classes.count
423 until
424 i > nb
425 loop
426 es_class ?= l_classes.i_th (i)
427 if es_class /= Void and then es_class.class_i.is_compiled then
428 add_ancestor_relations (es_class)
429 if es_class.is_queries_changed then
430 add_supplier_relations (es_class)
431 end
432 end
433 i := i + 1
434 end
435 end
436
437 add_clusters_relations is
438 -- Add relation between clusters in `Current'.
439 local
440 l_clusters: like clusters
441 es_cluster: ES_CLUSTER
442 i, nb: INTEGER
443 do
444 from
445 l_clusters := clusters
446 i := 1
447 nb := l_clusters.count
448 until
449 i > nb
450 loop
451 es_cluster ?= l_clusters.i_th (i)
452 if es_cluster /= Void then
453 add_children_relations (es_cluster, es_cluster.cluster)
454 add_parent_relations (es_cluster, es_cluster.cluster)
455 end
456 i := i + 1
457 end
458 end
459
460 add_children_relations (a_cluster: ES_CLUSTER; a_parent: ES_CLUSTER) is
461 -- Add all `a_cluster''s childrens appear in top level of `a_parent'.
462 require
463 a_cluster_not_void: a_cluster /= Void
464 local
465 l_clusters: like flat_clusters
466 l_top_possibles: ARRAYED_LIST [ES_CLUSTER]
467 l_child: ES_CLUSTER
468 l_lib: CONF_LIBRARY
469 l_lib_a: CONF_LIBRARY
470 l_cluster: CONF_CLUSTER
471 l_chuster_a: CONF_CLUSTER
472 do
473 l_top_possibles := top_level_clusters
474 if a_parent /= Void then
475 l_clusters := l_top_possibles
476 l_clusters.append (a_parent.sub_clusters)
477 else
478 l_clusters := l_top_possibles
479 end
480 if a_cluster.group.is_cluster then
481 l_cluster ?= a_cluster.group
482 from
483 l_clusters.start
484 until
485 l_clusters.after
486 loop
487 l_child ?= l_clusters.item
488 if l_child /= Void and then l_child.cluster = Void and then l_child.is_needed_on_diagram and then l_child.group.is_cluster then
489 l_chuster_a ?= l_child.group
490 if l_cluster.children /= Void and then l_cluster.children.has (l_chuster_a) then
491 a_cluster.extend (l_child)
492 end
493 end
494 l_clusters.forth
495 end
496 elseif a_cluster.group.is_library then
497 l_lib ?= a_cluster.group
498 from
499 l_clusters.start
500 until
501 l_clusters.after
502 loop
503 l_child ?= l_clusters.item
504 if l_child /= Void and then l_child.cluster = Void and then l_child.is_needed_on_diagram then
505 if l_child.group.is_cluster then
506 if l_lib.library_target.clusters.has (l_child.group.name) then
507 a_cluster.extend (l_child)
508 end
509 elseif l_child.group.is_library then
510 l_lib_a ?= l_child.group
511 if l_lib.library_target.libraries.has_item (l_lib_a) then
512 a_cluster.extend (l_child)
513 end
514 end
515 end
516 l_clusters.forth
517 end
518 end
519 end
520
521 add_parent_relations (a_cluster: ES_CLUSTER; a_parent: ES_CLUSTER) is
522 -- Add `a_cluster' to possible `a_parent'.
523 require
524 a_cluster_not_void: a_cluster /= Void
525 local
526 parent_cluster: ES_CLUSTER
527 l_group: CONF_GROUP
528 l_cluster: CONF_CLUSTER
529 l_lib: CONF_LIBRARY
530 l_libs: ARRAYED_LIST [CONF_LIBRARY]
531 l_libs_tar: HASH_TABLE [CONF_LIBRARY, STRING]
532 l_parent_found: BOOLEAN
533 do
534 if a_parent /= Void then
535 l_group := a_cluster.group
536 if l_group.is_cluster then
537 l_cluster ?= l_group
538 if l_cluster.parent = a_parent.group then
539 a_parent.extend (a_cluster)
540 l_parent_found := True
541 end
542 if not l_parent_found then
543 if l_cluster.target.used_in_libraries /= Void then
544 l_libs := l_cluster.target.used_in_libraries.twin
545 end
546 if l_libs /= Void then
547 from
548 l_libs.start
549 until
550 l_libs.after or l_parent_found
551 loop
552 parent_cluster := a_parent
553 if a_parent.group = l_libs.item then
554 a_parent.extend (a_cluster)
555 l_parent_found := True
556 end
557 l_libs.forth
558 end
559 end
560 end
561 elseif l_group.is_library then
562 if a_parent.group.is_library then
563 l_lib ?= a_parent.group
564 l_libs_tar := l_lib.library_target.libraries
565 if l_libs_tar.has (l_group.name) then
566 if l_libs_tar.found_item = l_group then
567 a_parent.extend (a_cluster)
568 end
569 end
570 end
571 end
572 end
573 end
574
575 add_ancestor_relations (a_class: ES_CLASS) is
576 -- Add links to ancestors classes of `a_class' in the graph.
577 require
578 a_class_not_void: a_class /= Void
579 a_class_compiled: a_class.class_i.compiled
580 local
581 l: FIXED_LIST [CL_TYPE_A]
582 cl: CLASS_I
583 es_class: ES_CLASS
584 es_classes: ARRAYED_LIST [ES_CLASS]
585 l_link: ES_INHERITANCE_LINK
586 do
587 l := a_class.class_i.compiled_class.parents
588 if l /= Void then
589 from l.start until l.after loop
590 cl := l.item.associated_class.lace_class
591 if cl /= Void then
592 es_classes := possible_linkable_node (a_class)
593 from
594 es_classes.start
595 until
596 es_classes.after
597 loop
598 es_class := es_classes.item
599 if es_class.class_i = cl and then es_class.is_needed_on_diagram then
600 l_link := inheritance_link_connecting (a_class, es_class)
601 if l_link = Void then
602 create {ES_INHERITANCE_LINK} l_link.make_with_classes (a_class, es_class)
603 add_link (l_link)
604 elseif not l_link.is_needed_on_diagram then
605 l_link.enable_needed_on_diagram
606 end
607 end
608 es_classes.forth
609 end
610 end
611 l.forth
612 end
613 end
614 end
615
616 add_descendant_relations (a_class: ES_CLASS) is
617 -- Add links to descendants of `a_class' in the graph.
618 require
619 a_class_not_void: a_class /= Void
620 a_class_compiled: a_class.class_i.compiled
621 local
622 l: LINEAR [CLASS_C]
623 cl: CLASS_I
624 es_class: ES_CLASS
625 es_classes: ARRAYED_LIST [ES_CLASS]
626 l_link: ES_INHERITANCE_LINK
627 do
628 l := a_class.class_i.compiled_class.descendants
629 if l /= Void then
630 from l.start until l.after loop
631 cl := l.item.lace_class
632 if cl /= Void then
633 es_classes := possible_linkable_node (a_class)
634 from
635 es_classes.start
636 until
637 es_classes.after
638 loop
639 es_class := es_classes.item
640 if es_class.class_i = cl and then es_class.is_needed_on_diagram then
641 l_link := inheritance_link_connecting (es_class, a_class)
642 if l_link = Void then
643 create {ES_INHERITANCE_LINK} l_link.make_with_classes (es_class, a_class)
644 add_link (l_link)
645 elseif not l_link.is_needed_on_diagram then
646 l_link.enable_needed_on_diagram
647 end
648 end
649 es_classes.forth
650 end
651 end
652 l.forth
653 end
654 end
655 end
656
657 add_client_relations (a_class: ES_CLASS) is
658 -- Add links to classes in the graph that are clients of `a_class'
659 require
660 a_class_not_void: a_class /= Void
661 a_class_compiled: a_class.class_i.compiled
662 local
663 cf: ES_CLASS
664 l_nodes: like nodes
665 cs_link: ES_CLIENT_SUPPLIER_LINK
666 do
667 from
668 l_nodes := possible_linkable_node (a_class)
669 l_nodes.start
670 until
671 l_nodes.after
672 loop
673 cf ?= l_nodes.item
674 if cf.is_needed_on_diagram and then cf.has_supplier (a_class) then
675 cs_link ?= client_supplier_link_connecting (cf, a_class)
676 if cs_link = Void then
677 create cs_link.make (cf, a_class)
678 add_link (cs_link)
679 elseif not cs_link.is_needed_on_diagram then
680 cs_link.enable_needed_on_diagram
681 end
682 end
683 l_nodes.forth
684 end
685 end
686
687 add_supplier_relations (a_class: ES_CLASS) is
688 -- Add links to classes in the graph that are suppliers of `a_class'.
689 local
690 cf: ES_CLASS
691 l_nodes: like nodes
692 cs_link: ES_CLIENT_SUPPLIER_LINK
693 do
694 from
695 l_nodes := possible_linkable_node (a_class)
696 l_nodes.start
697 until
698 l_nodes.after
699 loop
700 cf ?= l_nodes.item
701 if cf.is_needed_on_diagram and then a_class.has_supplier (cf) then
702 cs_link ?= client_supplier_link_connecting (a_class, cf)
703 if cs_link = Void then
704 create cs_link.make (a_class, cf)
705 add_link (cs_link)
706 elseif not cs_link.is_needed_on_diagram then
707 cs_link.enable_needed_on_diagram
708 end
709 end
710 l_nodes.forth
711 end
712 end
713
714 feature {CLASS_TEXT_MODIFIER} -- Status report
715
716 next_feature_name_number: INTEGER is
717 -- Number to append to next created feature.
718 do
719 Result := feature_name_number
720 feature_name_number := feature_name_number + 1
721 ensure
722 feature_name_number_incremented:
723 feature_name_number = old feature_name_number + 1
724 end
725
726 feature {NONE} -- Implementation
727
728 lookup_name_of_class (a_class: CLASS_I): STRING is
729 -- Unique lookup name of `a_class'
730 require
731 a_class_not_void: a_class /= Void
732 do
733 Result := a_class.group.target.name + "." + a_class.name
734 ensure
735 Result_not_void: Result /= Void
736 end
737
738 remove_unneeded_items is
739 -- Remove all EIFFEL_ITEMS in `Current' with is_needed_on_diagram False.
740 local
741 l_nodes: like nodes
742 l_links: like links
743 l_clusters: like clusters
744 l_item: ES_ITEM
745 i: INTEGER
746 l_linkables: LIST [EG_LINKABLE]
747 l_cluster: EG_CLUSTER
748 es_class: ES_CLASS
749 do
750 from
751 l_links := links
752 i := 1
753 until
754 i > l_links.count
755 loop
756 l_item ?= l_links.i_th (i)
757 if l_item /= Void and then not l_item.is_needed_on_diagram then
758 remove_link (l_links.i_th (i))
759 else
760 i := i + 1
761 end
762 end
763 from
764 l_nodes := nodes
765 i := 1
766 until
767 i > l_nodes.count
768 loop
769 l_item ?= l_nodes.i_th (i)
770 if l_item /= Void and then not l_item.is_needed_on_diagram then
771 check
772 no_link_was_needed_on_diagram: l_nodes.i_th (i).links.is_empty
773 end
774 es_class ?= l_nodes.i_th (i)
775 remove_node (es_class)
776 else
777 i := i + 1
778 end
779 end
780 from
781 l_clusters := clusters
782 i := 1
783 until
784 i > l_clusters.count
785 loop
786 l_cluster := l_clusters.i_th (i)
787 l_item ?= l_cluster
788 if l_item /= Void and then not l_item.is_needed_on_diagram then
789 from
790 l_linkables := l_cluster.linkables
791 until
792 l_linkables.is_empty
793 loop
794 l_cluster.prune_all (l_linkables.item)
795 end
796 remove_cluster (l_cluster)
797 else
798 i := i + 1
799 end
800 end
801 end
802
803 synchronize_clusters (a_progress_bar: EB_PERCENT_PROGRESS_BAR) is
804 -- Synchronize all clusters in `Current'.
805 local
806 l_clusters: like flat_clusters
807 es_cluster: ES_CLUSTER
808 do
809 from
810 l_clusters := flat_clusters
811 l_clusters.start
812 until
813 l_clusters.after
814 loop
815 es_cluster ?= l_clusters.item
816 if es_cluster /= Void then
817 es_cluster.synchronize
818 end
819 l_clusters.forth
820 if a_progress_bar /= Void then
821 a_progress_bar.set_value (a_progress_bar.value + 1)
822 end
823 end
824 end
825
826 synchronize_classes (a_progress_bar: EB_PERCENT_PROGRESS_BAR) is
827 -- Synchronize all classes in `Current'.
828 local
829 l_classes: like flat_nodes
830 es_class: ES_CLASS
831 do
832 from
833 l_classes := flat_nodes
834 l_classes.start
835 until
836 l_classes.after
837 loop
838 es_class ?= l_classes.item
839 if es_class /= Void then
840 es_class.synchronize
841 end
842 l_classes.forth
843 if a_progress_bar /= Void then
844 a_progress_bar.set_value (a_progress_bar.value + 1)
845 end
846 end
847 end
848
849 synchronize_links (a_progress_bar: EB_PERCENT_PROGRESS_BAR) is
850 -- Synchronize all links in `Current'.
851 local
852 l_links: like flat_links
853 es_item: ES_ITEM
854 do
855 from
856 l_links := flat_links
857 l_links.start
858 until
859 l_links.after
860 loop
861 es_item ?= l_links.item
862 if es_item /= Void then
863 es_item.synchronize
864 end
865 l_links.forth
866 if a_progress_bar /= Void then
867 a_progress_bar.set_value (a_progress_bar.value + 1)
868 end
869 end
870 end
871
872 explore_relations is
873 -- Explore relations.
874 deferred
875 end
876
877 top_most_scope (a_cluster: ES_CLUSTER): ES_CLUSTER is
878 -- Possible top most cluster in the graph that contains dependent relations among classes in `a_cluster'.
879 require
880 a_cluster_not_void: a_cluster /= Void
881 do
882 if a_cluster.cluster = Void then
883 Result := a_cluster
884 elseif a_cluster.cluster.group.is_cluster then
885 Result := top_most_scope (a_cluster.cluster)
886 elseif a_cluster.cluster.group.is_library then
887 Result := a_cluster.cluster
888 end
889 ensure
890 Result_not_void: Result /= Void
891 end
892
893 feature_name_number: INTEGER
894 -- Number to append to next created feature.
895
896 class_name_to_node_lookup: HASH_TABLE [ES_CLASS, STRING]
897 -- Lookup tables to speed up `class_from_interface'.
898
899 inheritance_links_lookup: DS_HASH_TABLE [ES_INHERITANCE_LINK, like link_type]
900 -- Lookup tables to speed up `inheritance_link_connecting'.
901
902 client_supplier_links_lookup: DS_HASH_TABLE [ES_CLIENT_SUPPLIER_LINK, like link_type]
903 -- Lookup tables to speed up `client_supplier_link_connecting'.
904
905 link_comparer (u, v: like link_type): BOOLEAN is
906 -- Comparison agent used in `client_supplier_links_lookup' and in
907 -- `inheritance_links_lookup'.
908 require
909 u_not_void: u /= Void
910 v_not_void: v /= Void
911 do
912 Result := (u.item (1) = v.item (1)) and (u.item (2) = v.item (2))
913 end
914
915 link_type: TUPLE [EG_LINKABLE, EG_LINKABLE] is
916 -- For typing purposes only
917 do
918 end
919
920 node_type: ES_CLASS is
921 -- Type of nodes in `nodes'.
922 do
923
924 end
925
926 invariant
927 context_editor_not_void: context_editor /= Void
928 class_name_to_node_lookup_not_void: class_name_to_node_lookup /= Void
929 inheritance_links_lookup_not_void: inheritance_links_lookup /= Void
930 client_supplier_links_lookup_not_void: client_supplier_links_lookup /= Void
931
932 indexing
933 copyright: "Copyright (c) 1984-2006, Eiffel Software"
934 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
935 licensing_options: "http://www.eiffel.com/licensing"
936 copying: "[
937 This file is part of Eiffel Software's Eiffel Development Environment.
938
939 Eiffel Software's Eiffel Development Environment is free
940 software; you can redistribute it and/or modify it under
941 the terms of the GNU General Public License as published
942 by the Free Software Foundation, version 2 of the License
943 (available at the URL listed under "license" above).
944
945 Eiffel Software's Eiffel Development Environment is
946 distributed in the hope that it will be useful, but
947 WITHOUT ANY WARRANTY; without even the implied warranty
948 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
949 See the GNU General Public License for more details.
950
951 You should have received a copy of the GNU General Public
952 License along with Eiffel Software's Eiffel Development
953 Environment; if not, write to the Free Software Foundation,
954 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
955 ]"
956 source: "[
957 Eiffel Software
958 356 Storke Road, Goleta, CA 93117 USA
959 Telephone 805-685-1006, Fax 805-685-6869
960 Website http://www.eiffel.com
961 Customer support http://support.eiffel.com
962 ]"
963
964 end -- class ES_GRAPH

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23