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

Contents of /branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/commands/eb_toggle_force_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: 3763 byte(s)
First commit docking tabbed Eiffel Studio.
1 indexing
2 description: "Objects that is a command to turn on/off physics."
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_TOGGLE_FORCE_COMMAND
11
12 inherit
13 EB_CONTEXT_DIAGRAM_COMMAND
14 redefine
15 new_toolbar_item,
16 description,
17 initialize
18 end
19
20 EB_CONTEXT_DIAGRAM_TOGGLE_COMMAND
21
22 create
23 make
24
25 feature {NONE} -- Initialization
26
27 initialize is
28 -- Initialize default values.
29 do
30 create accelerator.make_with_key_combination (
31 create {EV_KEY}.make_with_code ({EV_KEY_CONSTANTS}.key_p),
32 True, False, False)
33 accelerator.actions.extend (agent execute)
34 end
35
36 feature -- Basic operations
37
38 execute is
39 -- Perform operation.
40 do
41 if is_sensitive then
42 if not tool.is_force_directed_used then
43 tool.enable_force_directed
44 enable_select
45 else
46 tool.disable_force_directed
47 disable_select
48 end
49 end
50 end
51
52 new_toolbar_item (display_text: BOOLEAN): EB_COMMAND_TOGGLE_TOOL_BAR_BUTTON is
53 -- Create a new toolbar button for this command.
54 --
55 -- Call `recycle' on the result when you don't need it anymore otherwise
56 -- it will never be garbage collected.
57 do
58 create Result.make (Current)
59 current_button := Result
60 if tool.is_force_directed_used then
61 Result.toggle
62 end
63 initialize_toolbar_item (Result, display_text)
64 Result.select_actions.extend (agent execute)
65 end
66
67 feature -- Access
68
69 tooltip: STRING is
70 -- Tooltip for the toolbar button.
71 do
72 if current_button.is_selected then
73 Result := Interface_names.f_diagram_force_directed_off
74 else
75 Result := Interface_names.f_diagram_force_directed_on
76 end
77 end
78
79 feature {NONE} -- Implementation
80
81 pixmap: EV_PIXMAP is
82 -- Pixmap representing the command.
83 do
84 Result := pixmaps.icon_pixmaps.diagram_toogle_physics_icon
85 end
86
87 pixel_buffer: EV_PIXEL_BUFFER is
88 -- Pixel buffer representing the command.
89 do
90 -- Currently there is no pixel buffer for this command.
91 end
92
93 description: STRING is
94 -- Description for this command.
95 do
96 Result := Interface_names.l_diagram_force_directed
97 end
98
99 name: STRING is "Force_directed"
100 -- Name of the command. Used to store the command in the
101 -- preferences.
102
103 feature {EB_DIAGRAM_TOOL} -- Implementation
104
105 current_button: EB_COMMAND_TOGGLE_TOOL_BAR_BUTTON;
106 -- Current toggle button.
107
108 indexing
109 copyright: "Copyright (c) 1984-2006, Eiffel Software"
110 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
111 licensing_options: "http://www.eiffel.com/licensing"
112 copying: "[
113 This file is part of Eiffel Software's Eiffel Development Environment.
114
115 Eiffel Software's Eiffel Development Environment is free
116 software; you can redistribute it and/or modify it under
117 the terms of the GNU General Public License as published
118 by the Free Software Foundation, version 2 of the License
119 (available at the URL listed under "license" above).
120
121 Eiffel Software's Eiffel Development Environment is
122 distributed in the hope that it will be useful, but
123 WITHOUT ANY WARRANTY; without even the implied warranty
124 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
125 See the GNU General Public License for more details.
126
127 You should have received a copy of the GNU General Public
128 License along with Eiffel Software's Eiffel Development
129 Environment; if not, write to the Free Software Foundation,
130 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
131 ]"
132 source: "[
133 Eiffel Software
134 356 Storke Road, Goleta, CA 93117 USA
135 Telephone 805-685-1006, Fax 805-685-6869
136 Website http://www.eiffel.com
137 Customer support http://support.eiffel.com
138 ]"
139
140 end -- class EB_TOGGLE_FORCE_COMMAND

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23