/[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 27345 - (show annotations)
Tue Sep 4 00:36:03 2001 UTC (18 years, 4 months ago) by etienne
Original Path: trunk/Src/bench/Eiffel/interface/new_graphical/commands/eb_select_depth_command.e
File size: 5732 byte(s)
Removed unnecessary descriptions and moved manifest string to INTERFACE_NAMES.

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23