/[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 47280 - (show annotations)
Tue Dec 28 19:29:19 2004 UTC (15 years ago) by bennob
Original Path: trunk/Src/bench/Eiffel/interface/new_graphical/commands/eb_select_depth_command.e
File size: 2826 byte(s)
Changed commands such that they work with the new diagram tool.

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 cd: EIFFEL_CLUSTER_DIAGRAM
26 dial: EB_CONTEXT_DEPTH_DIALOG
27 d: EIFFEL_CLASS_DIAGRAM
28 cg: ES_CLASS_GRAPH
29 do
30 d := tool.class_view
31 if d = Void then
32 cd := tool.cluster_view
33 create dial.make_for_cluster_view
34 dial.preset_for_cluster_view (cd)
35 dial.show_modal_to_window (tool.development_window.window)
36 if
37 not dial.cancelled
38 and
39 dial.supercluster_depth /= cd.model.supercluster_depth or
40 dial.subcluster_depth /= cd.model.subcluster_depth
41 then
42 history.wipe_out
43 cd.model.set_supercluster_depth (dial.supercluster_depth)
44 cd.model.set_subcluster_depth (dial.subcluster_depth)
45 tool.create_cluster_view (cd.model.center_cluster.cluster_i, False)
46 end
47 else
48 create dial.make_for_class_view
49 dial.preset_for_class_view (d)
50 dial.show_modal_to_window (tool.development_window.window)
51 cg := d.model
52 if
53 not dial.cancelled
54 and
55 (dial.ancestor_depth /= cg.ancestor_depth or
56 dial.descendant_depth /= cg.descendant_depth or
57 dial.client_depth /= cg.client_depth or
58 dial.supplier_depth /= cg.supplier_depth or
59 dial.all_classes_of_cluster /= cg.include_all_classes_of_cluster or
60 dial.only_classes_of_cluster /= cg.include_only_classes_of_cluster)
61 then
62 cg.set_ancestor_depth (dial.ancestor_depth)
63 cg.set_descendant_depth (dial.descendant_depth)
64 cg.set_client_depth (dial.client_depth)
65 cg.set_supplier_depth (dial.supplier_depth)
66 cg.set_include_all_classes_of_cluster (dial.all_classes_of_cluster)
67 cg.set_include_only_classes_of_cluster (dial.only_classes_of_cluster)
68 tool.create_class_view (cg.center_class.class_i, False)
69 end
70 end
71 end
72
73 feature {NONE} -- Implementation
74
75 pixmap: ARRAY [EV_PIXMAP] is
76 -- Pixmaps representing the command (one for the
77 -- gray version, one for the color version).
78 do
79 Result := Pixmaps.Icon_select_depth
80 end
81
82 tooltip: STRING is
83 -- Tooltip for the toolbar button.
84 do
85 Result := Interface_names.f_diagram_context_depth
86 end
87
88 menu_name: STRING is
89 -- Name for the menu entry.
90 do
91 Result := Interface_names.m_diagram_context_depth
92 end
93
94 name: STRING is "Context_depth"
95 -- Name of the command. Used to store the command in the
96 -- preferences.
97
98 class_depth_dialog: EB_CONTEXT_DEPTH_DIALOG
99 -- Dialog to tweak depths on class views.
100
101 cluster_depth_dialog: EB_CONTEXT_DEPTH_DIALOG
102 -- Dialog to tweak depths on cluster views.
103
104 end -- class EB_SELECT_DEPTH_COMMAND
105

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23