1 | |
---|
2 | |
---|
3 | ################################################################################ |
---|
4 | #This software was developed by the University of Tennessee as part of the |
---|
5 | #Distributed Data Analysis of Neutron Scattering Experiments (DANSE) |
---|
6 | #project funded by the US National Science Foundation. |
---|
7 | # |
---|
8 | #See the license text in license.txt |
---|
9 | # |
---|
10 | #copyright 2008, University of Tennessee |
---|
11 | ################################################################################ |
---|
12 | |
---|
13 | |
---|
14 | class PanelBase: |
---|
15 | """ |
---|
16 | Defines the API for a panels to work with |
---|
17 | the ViewerFrame toolbar and menu bar |
---|
18 | """ |
---|
19 | ## Internal nickname for the window, used by the AUI manager |
---|
20 | #window_name = "default" |
---|
21 | ## Name to appear on the window title bar |
---|
22 | #window_caption = "Welcome panel" |
---|
23 | ## Flag to tell the AUI manager to put this panel in the center pane |
---|
24 | #CENTER_PANE = True |
---|
25 | |
---|
26 | def __init__(self): |
---|
27 | """ |
---|
28 | Initialize some flag that Viewerframe used |
---|
29 | """ |
---|
30 | #panel manager |
---|
31 | self._manager = None |
---|
32 | |
---|
33 | self._print_flag = False |
---|
34 | self._undo_flag = False |
---|
35 | self._redo_flag = False |
---|
36 | self._preview_flag = False |
---|
37 | self._bookmark_flag = False |
---|
38 | self._zoom_in_flag = False |
---|
39 | self._zoom_out_flag = False |
---|
40 | self._zoom_flag = False |
---|
41 | self._save_flag = False |
---|
42 | self._drag_flag = False |
---|
43 | self._reset_flag = False |
---|
44 | |
---|
45 | def set_print_flag(self, flag=True): |
---|
46 | """ |
---|
47 | The derivative class sets the print flag value to indicate that it can |
---|
48 | be printed |
---|
49 | """ |
---|
50 | self._print_flag = flag |
---|
51 | |
---|
52 | def get_print_flag(self): |
---|
53 | """ |
---|
54 | Get the print flag to update appropriately the tool bar |
---|
55 | """ |
---|
56 | return self._print_flag |
---|
57 | |
---|
58 | def set_undo_flag(self, flag=True): |
---|
59 | """ |
---|
60 | The derivative class sets the undo flag value to indicate that the |
---|
61 | current action done can be canceled |
---|
62 | """ |
---|
63 | self._undo_flag = flag |
---|
64 | |
---|
65 | def get_undo_flag(self): |
---|
66 | """ |
---|
67 | Get the undo flag to update appropriately the tool bar |
---|
68 | """ |
---|
69 | return self._undo_flag |
---|
70 | |
---|
71 | def set_redo_flag(self, flag=True): |
---|
72 | """ |
---|
73 | The derivative class sets the redo flag value to indicate that the |
---|
74 | action done can be recovered |
---|
75 | """ |
---|
76 | self._redo_flag = flag |
---|
77 | |
---|
78 | def get_redo_flag(self): |
---|
79 | """ |
---|
80 | Get the redo flag to update appropriately the tool bar |
---|
81 | """ |
---|
82 | return self._redo_flag |
---|
83 | |
---|
84 | def set_zoomed_in_flag(self, flag=True): |
---|
85 | """ |
---|
86 | The derivative class sets the zoom in flag value to indicate that it |
---|
87 | can be zoomed in |
---|
88 | """ |
---|
89 | self._zoom_in_flag = flag |
---|
90 | |
---|
91 | def get_zoom_in_flag(self): |
---|
92 | """ |
---|
93 | Get the zoom in flag to update appropriately the tool bar |
---|
94 | """ |
---|
95 | return self._zoom_in_flag |
---|
96 | |
---|
97 | def set_zoomed_out_flag(self, flag=True): |
---|
98 | """ |
---|
99 | The derivative class sets the zoom out flag value to indicate that it |
---|
100 | can be zoomed out |
---|
101 | """ |
---|
102 | self._zoom_out_flag = flag |
---|
103 | |
---|
104 | def get_zoom_out_flag(self): |
---|
105 | """ |
---|
106 | Get the zoom out flag to update appropriately the tool bar |
---|
107 | """ |
---|
108 | return self._zoom_out_flag |
---|
109 | |
---|
110 | def set_zoom_flag(self, flag=True): |
---|
111 | """ |
---|
112 | The derivative class sets the zoom flag value to indicate that it |
---|
113 | can be zoomed |
---|
114 | """ |
---|
115 | self._zoom_flag = flag |
---|
116 | |
---|
117 | def get_zoom_flag(self): |
---|
118 | """ |
---|
119 | Get the zoom flag to update appropriately the tool bar |
---|
120 | """ |
---|
121 | return self._zoom_flag |
---|
122 | |
---|
123 | def set_bookmark_flag(self, flag=True): |
---|
124 | """ |
---|
125 | The derivative class sets the bookmark flag value to indicate that it |
---|
126 | can be bookmarked |
---|
127 | """ |
---|
128 | self._bookmark_flag = flag |
---|
129 | |
---|
130 | def get_bookmark_flag(self): |
---|
131 | """ |
---|
132 | Get the bookmark flag to update appropriately the tool bar |
---|
133 | """ |
---|
134 | return self._bookmark_flag |
---|
135 | |
---|
136 | def set_preview_flag(self, flag=True): |
---|
137 | """ |
---|
138 | The derivative class sets the preview flag value to indicate that it |
---|
139 | can be previewed |
---|
140 | """ |
---|
141 | self._preview_flag = flag |
---|
142 | |
---|
143 | def get_preview_flag(self): |
---|
144 | """ |
---|
145 | Get the preview flag to update appropriately the tool bar |
---|
146 | """ |
---|
147 | return self._preview_flag |
---|
148 | |
---|
149 | def set_save_flag(self, flag=True): |
---|
150 | """ |
---|
151 | The derivative class sets the drag flag value to indicate that it |
---|
152 | can be saved |
---|
153 | """ |
---|
154 | self._save_flag = flag |
---|
155 | |
---|
156 | def get_save_flag(self): |
---|
157 | """ |
---|
158 | Get the save flag to update appropriately the tool bar |
---|
159 | """ |
---|
160 | return self._save_flag |
---|
161 | |
---|
162 | def set_drag_flag(self, flag=True): |
---|
163 | """ |
---|
164 | The derivative class sets the drag flag value to indicate that |
---|
165 | dragging motion is possible |
---|
166 | """ |
---|
167 | self._drag_flag = flag |
---|
168 | |
---|
169 | def get_drag_flag(self): |
---|
170 | """ |
---|
171 | Get the drag flag to update appropriately the tool bar |
---|
172 | """ |
---|
173 | return self._drag_flag |
---|
174 | |
---|
175 | def set_reset_flag(self, flag=True): |
---|
176 | """ |
---|
177 | The derivative class sets the reset flag value to indicate that it |
---|
178 | can be reset |
---|
179 | """ |
---|
180 | self._reset_flag = flag |
---|
181 | |
---|
182 | def get_reset_flag(self): |
---|
183 | """ |
---|
184 | Get the reset flag to update appropriately the tool bar |
---|
185 | """ |
---|
186 | return self._reset_flag |
---|
187 | |
---|
188 | def on_reset(self, event): |
---|
189 | """ |
---|
190 | The derivative class state is restored |
---|
191 | """ |
---|
192 | def on_drag(self, event): |
---|
193 | """ |
---|
194 | The derivative class allows dragging motion if implemented |
---|
195 | """ |
---|
196 | def on_preview(self, event): |
---|
197 | """ |
---|
198 | Display a printable version of the class derivative |
---|
199 | """ |
---|
200 | def on_save(self, event): |
---|
201 | """ |
---|
202 | The state of the derivative class is restored |
---|
203 | """ |
---|
204 | def on_redo(self, event): |
---|
205 | """ |
---|
206 | The previous action is restored if possible |
---|
207 | """ |
---|
208 | def on_undo(self, event): |
---|
209 | """ |
---|
210 | The current action is canceled |
---|
211 | """ |
---|
212 | def on_bookmark(self, event): |
---|
213 | """ |
---|
214 | The derivative class is on bookmark mode if implemented |
---|
215 | """ |
---|
216 | def on_zoom_in(self, event): |
---|
217 | """ |
---|
218 | The derivative class is on zoom in mode if implemented |
---|
219 | """ |
---|
220 | def on_zoom_out(self, event): |
---|
221 | """ |
---|
222 | The derivative class is on zoom out mode if implemented |
---|
223 | """ |
---|
224 | def on_zoom(self, event): |
---|
225 | """ |
---|
226 | The derivative class is on zoom mode (using pane) |
---|
227 | if zoom mode is implemented |
---|
228 | """ |
---|
229 | def on_set_focus(self, event): |
---|
230 | """ |
---|
231 | The derivative class is on focus if implemented |
---|
232 | """ |
---|
233 | |
---|
234 | def get_data(self): |
---|
235 | """ |
---|
236 | return list of current data |
---|
237 | """ |
---|
238 | return |
---|
239 | |
---|
240 | def get_state(self): |
---|
241 | """ |
---|
242 | return the current state |
---|
243 | """ |
---|
244 | return |
---|
245 | |
---|
246 | def set_manager(self, manager): |
---|
247 | """ |
---|
248 | """ |
---|
249 | self._manager = manager |
---|
250 | |
---|
251 | def get_manager(self): |
---|
252 | """ |
---|
253 | """ |
---|
254 | return self._manager |
---|