/[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 58518 - (show annotations)
Thu Apr 27 20:21:42 2006 UTC (13 years, 8 months ago) by tedf
Original Path: trunk/Src/Eiffel/interface/new_graphical/commands/eb_select_depth_command.e
File size: 4516 byte(s)
Modification of diagram tool for new configuration system.
1 indexing
2 description : "Command to change depth of relations."
3 legal: "See notice at end of class."
4 status: "See notice at end of class."
5 date : "$Date$"
6 revision : "$Revision$"
7
8 class
9 EB_SELECT_DEPTH_COMMAND
10
11 inherit
12 EB_CONTEXT_DIAGRAM_COMMAND
13 redefine
14 menu_name,
15 initialize
16 end
17
18 SHARED_ERROR_HANDLER
19
20 create
21 make
22
23 feature {NONE} -- Initialization
24
25 initialize is
26 -- Initialize default values.
27 do
28 create accelerator.make_with_key_combination (
29 create {EV_KEY}.make_with_code ({EV_KEY_CONSTANTS}.key_d),
30 True, False, False)
31 accelerator.actions.extend (agent execute)
32 end
33
34 feature -- Basic operations
35
36 execute is
37 -- User clicked on the button.
38 local
39 cd: EIFFEL_CLUSTER_DIAGRAM
40 dial: EB_CONTEXT_DEPTH_DIALOG
41 d: EIFFEL_CLASS_DIAGRAM
42 cg: ES_CLASS_GRAPH
43 do
44 if is_sensitive then
45 d := tool.class_view
46 if d = Void then
47 cd := tool.cluster_view
48 create dial.make_for_cluster_view
49 dial.preset_for_cluster_view (cd)
50 dial.show_modal_to_window (tool.development_window.window)
51 if
52 not dial.cancelled
53 and
54 dial.supercluster_depth /= cd.model.supercluster_depth or
55 dial.subcluster_depth /= cd.model.subcluster_depth
56 then
57 history.wipe_out
58 cd.model.set_supercluster_depth (dial.supercluster_depth)
59 cd.model.set_subcluster_depth (dial.subcluster_depth)
60 tool.create_cluster_view (cd.model.center_cluster.group, False)
61 end
62 else
63 create dial.make_for_class_view
64 dial.preset_for_class_view (d)
65 dial.show_modal_to_window (tool.development_window.window)
66 cg := d.model
67 if
68 not dial.cancelled
69 and
70 (dial.ancestor_depth /= cg.ancestor_depth or
71 dial.descendant_depth /= cg.descendant_depth or
72 dial.client_depth /= cg.client_depth or
73 dial.supplier_depth /= cg.supplier_depth or
74 dial.all_classes_of_cluster /= cg.include_all_classes_of_cluster or
75 dial.only_classes_of_cluster /= cg.include_only_classes_of_cluster)
76 then
77 cg.set_ancestor_depth (dial.ancestor_depth)
78 cg.set_descendant_depth (dial.descendant_depth)
79 cg.set_client_depth (dial.client_depth)
80 cg.set_supplier_depth (dial.supplier_depth)
81 cg.set_include_all_classes_of_cluster (dial.all_classes_of_cluster)
82 cg.set_include_only_classes_of_cluster (dial.only_classes_of_cluster)
83 tool.create_class_view (cg.center_class.class_i, False)
84 end
85 end
86 end
87 end
88
89 feature {NONE} -- Implementation
90
91 pixmap: EV_PIXMAP is
92 -- Pixmap representing the command.
93 do
94 Result := Pixmaps.Icon_select_depth
95 end
96
97 tooltip: STRING is
98 -- Tooltip for the toolbar button.
99 do
100 Result := Interface_names.f_diagram_context_depth
101 end
102
103 menu_name: STRING is
104 -- Name for the menu entry.
105 do
106 Result := Interface_names.m_diagram_context_depth
107 end
108
109 name: STRING is "Context_depth"
110 -- Name of the command. Used to store the command in the
111 -- preferences.
112
113 class_depth_dialog: EB_CONTEXT_DEPTH_DIALOG
114 -- Dialog to tweak depths on class views.
115
116 cluster_depth_dialog: EB_CONTEXT_DEPTH_DIALOG;
117 -- Dialog to tweak depths on cluster views.
118
119 indexing
120 copyright: "Copyright (c) 1984-2006, Eiffel Software"
121 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
122 licensing_options: "http://www.eiffel.com/licensing"
123 copying: "[
124 This file is part of Eiffel Software's Eiffel Development Environment.
125
126 Eiffel Software's Eiffel Development Environment is free
127 software; you can redistribute it and/or modify it under
128 the terms of the GNU General Public License as published
129 by the Free Software Foundation, version 2 of the License
130 (available at the URL listed under "license" above).
131
132 Eiffel Software's Eiffel Development Environment is
133 distributed in the hope that it will be useful, but
134 WITHOUT ANY WARRANTY; without even the implied warranty
135 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
136 See the GNU General Public License for more details.
137
138 You should have received a copy of the GNU General Public
139 License along with Eiffel Software's Eiffel Development
140 Environment; if not, write to the Free Software Foundation,
141 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
142 ]"
143 source: "[
144 Eiffel Software
145 356 Storke Road, Goleta, CA 93117 USA
146 Telephone 805-685-1006, Fax 805-685-6869
147 Website http://www.eiffel.com
148 Customer support http://support.eiffel.com
149 ]"
150
151 end -- class EB_SELECT_DEPTH_COMMAND
152

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23