/[eiffelstudio]/branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/commands/eb_select_depth_command.e
ViewVC logotype

Contents of /branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/commands/eb_select_depth_command.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 26913 - (show annotations)
Sun Aug 12 23:50:20 2001 UTC (18 years, 5 months ago) by manus
Original Path: trunk/Src/bench/Eiffel/interface/new_graphical/commands/eb_select_depth_command.e
File size: 5582 byte(s)
Merged branch `dev46_manu' to the trunc.

1 indexing
2 description : "Command to change depth of relations."
3 date : "$Date$"
4 revision : "$Revision$"
5
6 class
7 EB_SELECT_DEPTH_COMMAND
8
9 inherit
10 EB_CONTEXT_DIAGRAM_COMMAND
11
12 SHARED_ERROR_HANDLER
13
14 create
15 make
16
17 feature -- Basic operations
18
19 execute is
20 -- User clicked on the button.
21 local
22 d: CONTEXT_DIAGRAM
23 cd: CLUSTER_DIAGRAM
24 sel: EB_VIEW_SELECTOR
25 tmp: LINKED_LIST [STRING]
26 dial: EB_CONTEXT_DEPTH_DIALOG
27 cancelled: BOOLEAN
28 do
29 if not cancelled then
30 d ?= tool.class_view
31 if d = Void then
32 cd ?= tool.cluster_view
33 check cd /= Void end
34 create dial.make_for_cluster_view
35 dial.preset_for_cluster_view (cd)
36 dial.show_modal_to_window (tool.development_window.window)
37 if
38 not dial.cancelled
39 and
40 dial.supercluster_depth /= cd.supercluster_depth or
41 dial.subcluster_depth /= cd.subcluster_depth
42 then
43 history.wipe_out
44 sel := dial.view_selector
45 if not sel.text.is_empty then
46 if sel.selected_item = Void then
47 tmp := sel.strings
48 if not tmp.has (sel.text) then
49 tmp.put_front (sel.text)
50 sel.set_strings (tmp)
51 sel.i_th (1).enable_select
52 else
53 tmp.compare_objects
54 tmp.search (sel.text)
55 sel.i_th (tmp.index).enable_select
56 tmp.compare_references
57 end
58 end
59 check
60 a_view_is_selected: sel.selected_item /= Void
61 end
62 if not sel.selected_item.text.is_equal (cd.current_view) then
63 tool.view_selector.select_actions.block
64 tool.view_selector.set_strings (sel.strings)
65 tool.view_selector.select_actions.resume
66 tool.view_selector.set_text (sel.selected_item.text)
67 tool.view_selector.return_actions.call ([])
68 end
69 end
70 tool.progress_dialog.set_title ("Synchronizing progress")
71 tool.progress_dialog.set_message ("Diagram for " + cd.center_cluster.cluster_i.cluster_name)
72 tool.progress_dialog.enable_cancel
73 tool.progress_dialog.start (5)
74 tool.progress_dialog.set_value (0)
75 tool.progress_dialog.show
76 history.wipe_out
77 cd.set_supercluster_depth (dial.supercluster_depth)
78 cd.set_subcluster_depth (dial.subcluster_depth)
79 cd.enable_placement_needed
80 cd.synchronize (True, tool.progress_dialog)
81 end
82 else
83 create dial.make_for_class_view
84 dial.preset_for_class_view (d)
85 dial.show_modal_to_window (tool.development_window.window)
86 if
87 not dial.cancelled
88 and
89 (dial.ancestor_depth /= d.ancestor_depth or
90 dial.descendant_depth /= d.descendant_depth or
91 dial.client_depth /= d.client_depth or
92 dial.supplier_depth /= d.supplier_depth or
93 dial.all_classes_of_cluster /= d.include_all_classes_of_cluster or
94 dial.only_classes_of_cluster /= d.include_only_classes_of_cluster)
95 then
96 history.wipe_out
97 sel := dial.view_selector
98 if not sel.text.is_empty then
99 if sel.selected_item = Void then
100 tmp := sel.strings
101 if not tmp.has (sel.text) then
102 tmp.put_front (sel.text)
103 sel.set_strings (tmp)
104 sel.i_th (1).enable_select
105 else
106 tmp.compare_objects
107 tmp.search (sel.text)
108 sel.i_th (tmp.index).enable_select
109 tmp.compare_references
110 end
111 end
112 check
113 a_view_is_selected: sel.selected_item /= Void
114 end
115 if not sel.selected_item.text.is_equal (d.current_view) then
116 tool.view_selector.select_actions.block
117 tool.view_selector.set_strings (sel.strings)
118 tool.view_selector.select_actions.resume
119 tool.view_selector.set_text (sel.selected_item.text)
120 tool.view_selector.return_actions.call ([])
121 end
122 end
123 tool.progress_dialog.set_title ("Synchronizing progress")
124 tool.progress_dialog.set_message ("Diagram for " + d.center_class.class_i.name_in_upper)
125 tool.progress_dialog.enable_cancel
126 tool.progress_dialog.start (6)
127 tool.progress_dialog.set_value (0)
128 tool.progress_dialog.show
129 history.wipe_out
130 d.set_ancestor_depth (dial.ancestor_depth)
131 d.set_descendant_depth (dial.descendant_depth)
132 d.set_client_depth (dial.client_depth)
133 d.set_supplier_depth (dial.supplier_depth)
134 d.set_include_all_classes_of_cluster (dial.all_classes_of_cluster)
135 d.set_include_only_classes_of_cluster (dial.only_classes_of_cluster)
136 d.enable_placement_needed
137 d.synchronize (True, tool.progress_dialog)
138 end
139 end
140 end
141 rescue
142 cancelled := True
143 Error_handler.error_list.wipe_out
144 tool.Progress_dialog.hide
145 tool.clear_area
146 tool.disable_toolbar
147 tool.development_window.window.set_pointer_style (tool.Default_pixmaps.standard_cursor)
148 retry
149 end
150
151 feature {NONE} -- Implementation
152
153 pixmap: ARRAY [EV_PIXMAP] is
154 -- Pixmaps representing the command (one for the
155 -- gray version, one for the color version).
156 do
157 Result := Pixmaps.Icon_select_depth
158 end
159
160 tooltip: STRING is
161 -- Tooltip for the toolbar button.
162 do
163 Result := "Select depth of relations"
164 end
165
166 description: STRING is
167 -- Description for this command.
168 do
169 Result := "Context dialog"
170 end
171
172 name: STRING is "Context_depth"
173 -- Name of the command. Used to store the command in the
174 -- preferences.
175
176 class_depth_dialog: EB_CONTEXT_DEPTH_DIALOG
177 -- Dialog to tweak depths on class views.
178
179 cluster_depth_dialog: EB_CONTEXT_DEPTH_DIALOG
180 -- Dialog to tweak depths on cluster views.
181
182 end -- class EB_SELECT_DEPTH_COMMAND
183

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23