/[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 62171 - (show annotations)
Tue Aug 1 01:27:17 2006 UTC (13 years, 4 months ago) by larryl
File size: 4685 byte(s)
First commit docking tabbed Eiffel Studio.
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.develop_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.develop_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_pixmaps.diagram_depth_of_relations_icon
95 end
96
97 pixel_buffer: EV_PIXEL_BUFFER is
98 -- Pixel buffer representing the command.
99 do
100 -- Currently there is no pixel buffer for this command.
101 end
102
103 tooltip: STRING is
104 -- Tooltip for the toolbar button.
105 do
106 Result := Interface_names.f_diagram_context_depth
107 end
108
109 menu_name: STRING is
110 -- Name for the menu entry.
111 do
112 Result := Interface_names.m_diagram_context_depth
113 end
114
115 name: STRING is "Context_depth"
116 -- Name of the command. Used to store the command in the
117 -- preferences.
118
119 class_depth_dialog: EB_CONTEXT_DEPTH_DIALOG
120 -- Dialog to tweak depths on class views.
121
122 cluster_depth_dialog: EB_CONTEXT_DEPTH_DIALOG;
123 -- Dialog to tweak depths on cluster views.
124
125 indexing
126 copyright: "Copyright (c) 1984-2006, Eiffel Software"
127 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
128 licensing_options: "http://www.eiffel.com/licensing"
129 copying: "[
130 This file is part of Eiffel Software's Eiffel Development Environment.
131
132 Eiffel Software's Eiffel Development Environment is free
133 software; you can redistribute it and/or modify it under
134 the terms of the GNU General Public License as published
135 by the Free Software Foundation, version 2 of the License
136 (available at the URL listed under "license" above).
137
138 Eiffel Software's Eiffel Development Environment is
139 distributed in the hope that it will be useful, but
140 WITHOUT ANY WARRANTY; without even the implied warranty
141 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
142 See the GNU General Public License for more details.
143
144 You should have received a copy of the GNU General Public
145 License along with Eiffel Software's Eiffel Development
146 Environment; if not, write to the Free Software Foundation,
147 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
148 ]"
149 source: "[
150 Eiffel Software
151 356 Storke Road, Goleta, CA 93117 USA
152 Telephone 805-685-1006, Fax 805-685-6869
153 Website http://www.eiffel.com
154 Customer support http://support.eiffel.com
155 ]"
156
157 end -- class EB_SELECT_DEPTH_COMMAND
158

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23