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

Contents of /branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/commands/eb_fill_cluster_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: 4823 byte(s)
First commit docking tabbed Eiffel Studio.
1 indexing
2 description : "Command to fill a cluster with all its classes."
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_FILL_CLUSTER_COMMAND
10
11 inherit
12 EB_CONTEXT_DIAGRAM_COMMAND
13 redefine
14 new_toolbar_item,
15 initialize
16 end
17
18 create
19 make
20
21 feature {NONE} -- Initialization
22
23 initialize is
24 -- Initialize default values.
25 do
26 create accelerator.make_with_key_combination (
27 create {EV_KEY}.make_with_code ({EV_KEY_CONSTANTS}.key_f),
28 True, False, False)
29 accelerator.actions.extend (agent execute)
30 end
31
32 feature -- Basic operations
33
34 execute is
35 -- Perform on center cluster.
36 local
37 cluster_fig: EIFFEL_CLUSTER_FIGURE
38 do
39 if is_sensitive then
40 check
41 only_aviable_in_cluster_graph: tool.cluster_graph /= Void
42 end
43 cluster_fig ?= tool.cluster_view.figure_from_model (tool.cluster_graph.center_cluster)
44 include_all_classes (cluster_fig)
45 end
46 end
47
48 execute_with_cluster_stone (a_stone: CLUSTER_STONE) is
49 -- Add all classes of `a_stone'.
50 local
51 es_cluster: ES_CLUSTER
52 cluster_fig: EIFFEL_CLUSTER_FIGURE
53 l_clusters: ARRAYED_LIST [ES_CLUSTER]
54 fig_stone: CLUSTER_FIGURE_STONE
55 do
56 check
57 only_aviable_in_cluster_graph: tool.cluster_graph /= Void
58 end
59 fig_stone ?= a_stone
60 if fig_stone /= Void then
61 include_all_classes (fig_stone.source)
62 else
63 l_clusters := tool.cluster_graph.cluster_from_interface (a_stone.group)
64 if l_clusters /= Void then
65 from
66 l_clusters.start
67 until
68 l_clusters.after
69 loop
70 es_cluster := l_clusters.item
71 cluster_fig ?= tool.cluster_view.figure_from_model (es_cluster)
72 include_all_classes (cluster_fig)
73 l_clusters.forth
74 end
75
76 end
77 end
78 end
79
80 new_toolbar_item (display_text: BOOLEAN): EB_COMMAND_TOOL_BAR_BUTTON is
81 -- Create a new toolbar button for this command.
82 do
83 Result := Precursor (display_text)
84 Result.drop_actions.extend (agent execute_with_cluster_stone)
85 end
86
87 feature {NONE} -- Implementation
88
89 include_all_classes (a_cluster_fig: EIFFEL_CLUSTER_FIGURE) is
90 -- Include all classes into `a_cluster'.
91 require
92 a_cluster_exists: a_cluster_fig /= Void
93 local
94 port_x, port_y: INTEGER
95 old_count: INTEGER
96 do
97 port_x := a_cluster_fig.port_x
98 port_y := a_cluster_fig.port_y
99
100 old_count := a_cluster_fig.model.flat_linkables.count
101 tool.cluster_graph.include_all_classes (a_cluster_fig.model)
102
103 if not tool.cluster_graph.last_included_classes.is_empty then
104 a_cluster_fig.reset_user_size
105 tool.world.update
106 tool.layout.set_spacing ({EB_DIAGRAM_TOOL}.default_bon_horizontal_spacing, {EB_DIAGRAM_TOOL}.default_bon_vertical_spacing)
107 tool.layout.layout_cluster_only (a_cluster_fig)
108
109 a_cluster_fig.set_port_position (port_x, port_y)
110 tool.restart_force_directed
111 tool.reset_history
112 tool.projector.full_project
113 end
114 end
115
116
117 pixmap: EV_PIXMAP is
118 -- Pixmaps representing the command.
119 do
120 Result := pixmaps.icon_pixmaps.diagram_fill_cluster_icon
121 end
122
123 pixel_buffer: EV_PIXEL_BUFFER is
124 -- Pixel buffer representing the command.
125 do
126 -- Currently there is no pixel buffer for this command.
127 end
128
129 tooltip: STRING is
130 -- Tooltip for the toolbar button.
131 do
132 Result := Interface_names.f_diagram_fill_cluster
133 end
134
135 name: STRING is "Cluster_filling";
136 -- Name of the command. Used to store the command in the
137 -- preferences.
138
139 indexing
140 copyright: "Copyright (c) 1984-2006, Eiffel Software"
141 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
142 licensing_options: "http://www.eiffel.com/licensing"
143 copying: "[
144 This file is part of Eiffel Software's Eiffel Development Environment.
145
146 Eiffel Software's Eiffel Development Environment is free
147 software; you can redistribute it and/or modify it under
148 the terms of the GNU General Public License as published
149 by the Free Software Foundation, version 2 of the License
150 (available at the URL listed under "license" above).
151
152 Eiffel Software's Eiffel Development Environment is
153 distributed in the hope that it will be useful, but
154 WITHOUT ANY WARRANTY; without even the implied warranty
155 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
156 See the GNU General Public License for more details.
157
158 You should have received a copy of the GNU General Public
159 License along with Eiffel Software's Eiffel Development
160 Environment; if not, write to the Free Software Foundation,
161 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
162 ]"
163 source: "[
164 Eiffel Software
165 356 Storke Road, Goleta, CA 93117 USA
166 Telephone 805-685-1006, Fax 805-685-6869
167 Website http://www.eiffel.com
168 Customer support http://support.eiffel.com
169 ]"
170
171 end -- class EB_FILL_CLUSTER_COMMAND

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23