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

Contents of /branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/commands/eb_remove_anchor_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: 4708 byte(s)
First commit docking tabbed Eiffel Studio.
1 indexing
2 description: "Objects that alows to remove anchors from classes."
3 legal: "See notice at end of class."
4 status: "See notice at end of class."
5 author: "Benno Baumgartner"
6 date: "$Date$"
7 revision: "$Revision$"
8
9 class
10 EB_REMOVE_ANCHOR_COMMAND
11
12 inherit
13 EB_CONTEXT_DIAGRAM_COMMAND
14 redefine
15 new_toolbar_item,
16 description
17 end
18
19 create
20 make
21
22 feature -- Basic operations
23
24 execute is
25 -- Perform operation.
26 do
27 create explain_dialog.make_with_text (Interface_names.e_diagram_remove_anchor)
28 explain_dialog.show_modal_to_window (tool.develop_window.window)
29 end
30
31 new_toolbar_item (display_text: BOOLEAN): EB_COMMAND_TOOL_BAR_BUTTON is
32 -- Create a new toolbar button for this command.
33 --
34 -- Call `recycle' on the result when you don't need it anymore otherwise
35 -- it will never be garbage collected.
36 do
37 Result := Precursor (display_text)
38 Result.drop_actions.extend (agent execute_with_class)
39 Result.drop_actions.extend (agent execute_with_class_list)
40 Result.drop_actions.extend (agent execute_with_cluster)
41 end
42
43 feature {NONE} -- Implementation
44
45 execute_with_class (a_stone: CLASSI_FIGURE_STONE) is
46 -- Set `is_fixed' to false for class in `a_stone'.
47 do
48 if a_stone.source.is_fixed then
49 a_stone.source.set_is_fixed (False)
50 tool.restart_force_directed
51 else
52 a_stone.source.set_is_fixed (True)
53 end
54 end
55
56 execute_with_class_list (a_stone: CLASS_FIGURE_LIST_STONE) is
57 -- Set `is_fixed' to false for all classes in `a_stone'.
58 do
59 from
60 a_stone.classes.start
61 until
62 a_stone.classes.after
63 loop
64 a_stone.classes.item.set_is_fixed (not a_stone.classes.item.is_fixed)
65 a_stone.classes.forth
66 end
67 tool.restart_force_directed
68 end
69
70 execute_with_cluster (a_stone: CLUSTER_STONE) is
71 -- Set `is_fixed' to false for cluster in `a_stone'.
72 local
73 es_cluster: ES_CLUSTER
74 cluster_fig: EG_CLUSTER_FIGURE
75 l_clusters: ARRAYED_LIST [ES_CLUSTER]
76 do
77 l_clusters := tool.graph.cluster_from_interface (a_stone.group)
78 if not l_clusters.is_empty then
79 from
80 l_clusters.start
81 until
82 l_clusters.after
83 loop
84 es_cluster := l_clusters.item
85 cluster_fig ?= tool.world.figure_from_model (es_cluster)
86 if cluster_fig /= Void then
87 if cluster_fig.is_fixed then
88 cluster_fig.set_is_fixed (False)
89 tool.restart_force_directed
90 else
91 cluster_fig.set_is_fixed (True)
92 end
93 end
94 l_clusters.forth
95 end
96
97 end
98 end
99
100 explain_dialog: EB_INFORMATION_DIALOG
101 -- Dialog explaining how to use `Current'.
102
103 pixmap: EV_PIXMAP is
104 -- Pixmaps representing the command.
105 do
106 Result := pixmaps.icon_pixmaps.diagram_remove_anchor_icon
107 end
108
109 pixel_buffer: EV_PIXEL_BUFFER is
110 -- Pixel buffer representing the command.
111 do
112 -- Currently there is no pixel buffer for this command.
113 end
114
115 tooltip: STRING is
116 -- Tooltip for the toolbar button.
117 do
118 Result := interface_names.f_diagram_remove_anchor
119 end
120
121 description: STRING is
122 -- Description for this command.
123 do
124 Result := Interface_names.l_diagram_remove_anchor
125 end
126
127 name: STRING is "Anchor_remove"
128 -- Name of the command. Used to store the command in the
129 -- preferences.
130
131 feature {EB_CONTEXT_EDITOR} -- Implementation
132
133 current_button: EB_COMMAND_TOGGLE_TOOL_BAR_BUTTON;
134 -- Current toggle button.
135
136 indexing
137 copyright: "Copyright (c) 1984-2006, Eiffel Software"
138 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
139 licensing_options: "http://www.eiffel.com/licensing"
140 copying: "[
141 This file is part of Eiffel Software's Eiffel Development Environment.
142
143 Eiffel Software's Eiffel Development Environment is free
144 software; you can redistribute it and/or modify it under
145 the terms of the GNU General Public License as published
146 by the Free Software Foundation, version 2 of the License
147 (available at the URL listed under "license" above).
148
149 Eiffel Software's Eiffel Development Environment is
150 distributed in the hope that it will be useful, but
151 WITHOUT ANY WARRANTY; without even the implied warranty
152 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
153 See the GNU General Public License for more details.
154
155 You should have received a copy of the GNU General Public
156 License along with Eiffel Software's Eiffel Development
157 Environment; if not, write to the Free Software Foundation,
158 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
159 ]"
160 source: "[
161 Eiffel Software
162 356 Storke Road, Goleta, CA 93117 USA
163 Telephone 805-685-1006, Fax 805-685-6869
164 Website http://www.eiffel.com
165 Customer support http://support.eiffel.com
166 ]"
167
168 end -- class EB_REMOVE_ANCHOR_COMMAND

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23