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

Annotation 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 26941 - (hide annotations)
Tue Aug 14 19:40:50 2001 UTC (18 years, 5 months ago) by etienne
Original Path: trunk/Src/bench/Eiffel/interface/new_graphical/commands/eb_select_depth_command.e
File size: 5672 byte(s)
If the user cancels a diagram depth change, the previous diagram will now be rebuilt
when he or she clicks on another tab and on the diagram tab again.

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23