Merge lp:~revager-developers/revager/assistant_redesign into lp:revager
- assistant_redesign
- Merge into trunk
Proposed by
Davide Casciato
Status: | Merged |
---|---|
Merged at revision: | 40 |
Proposed branch: | lp:~revager-developers/revager/assistant_redesign |
Merge into: | lp:revager |
Diff against target: |
4223 lines (+2424/-1188) 31 files modified
.project (+17/-17) src/org/revager/app/model/ApplicationData.java (+0/-1) src/org/revager/gui/AbstractDialog.java (+2/-3) src/org/revager/gui/AbstractDialogPanel.java (+63/-0) src/org/revager/gui/MainFrame.java (+24/-24) src/org/revager/gui/UI.java (+1/-1) src/org/revager/gui/actions/ActionRegistry.java (+11/-5) src/org/revager/gui/actions/InitializeNewReviewAction.java (+29/-15) src/org/revager/gui/actions/OpenAspectsManagerAction.java (+1/-2) src/org/revager/gui/actions/assistant/GoToAddAttPnlAction.java (+12/-7) src/org/revager/gui/actions/assistant/GoToFirstScreenPnlAction.java (+12/-25) src/org/revager/gui/actions/assistant/GoToOpenRevPnlAction.java (+14/-7) src/org/revager/gui/actions/assistant/OpenAssistantAction.java (+70/-0) src/org/revager/gui/actions/assistant/SelectLanguageAction.java (+73/-0) src/org/revager/gui/actions/attendee/AddResiAttToProtAction.java (+1/-2) src/org/revager/gui/actions/attendee/SelectAttOutOfDirAction.java (+6/-9) src/org/revager/gui/actions/popup/LanguagePopupWindowAction.java (+35/-0) src/org/revager/gui/dialogs/AssistantDialog.java (+0/-1042) src/org/revager/gui/dialogs/EditProductDialog.java (+0/-1) src/org/revager/gui/dialogs/SettingsDialog.java (+2/-3) src/org/revager/gui/dialogs/assistant/AssistantDialog.java (+283/-0) src/org/revager/gui/dialogs/assistant/FirstScreenPanel.java (+193/-0) src/org/revager/gui/dialogs/assistant/LanguagePopupWindow.java (+227/-0) src/org/revager/gui/dialogs/assistant/OpenReviewPanel.java (+310/-0) src/org/revager/gui/helpers/HLink.java (+526/-0) src/org/revager/gui/helpers/LinkGroup.java (+113/-0) src/org/revager/gui/helpers/VLink.java (+359/-0) src/org/revager/gui/models/StrengthTableModel.java (+6/-20) src/org/revager/resources/localeStrings_de.properties (+17/-2) src/org/revager/resources/localeStrings_en.properties (+17/-0) src/org/revager/tools/GUITools.java (+0/-2) |
To merge this branch: | bzr merge lp:~revager-developers/revager/assistant_redesign |
Related bugs: | |
Related blueprints: |
(SPEC) Redesign the first screen
(Medium)
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Team NEOS | Pending | ||
Review via email: mp+20957@code.launchpad.net |
Commit message
Description of the change
redesign of the assistant
To post a comment you must log in.
- 42. By Davide Casciato
-
review changes
- 43. By Davide Casciato
-
review changes
- 44. By D.Casciato <D.Casciato@Hyperion>
-
old revisions
- 45. By D.Casciato <D.Casciato@Hyperion>
-
bugfixing
- 46. By Johannes Wettinger
-
minor bugs fixed
- 47. By D.Casciato <D.Casciato@Hyperion>
-
minor bug fixes (windows7)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file '.project' |
2 | --- .project 2009-11-24 15:10:55 +0000 |
3 | +++ .project 2010-05-26 20:44:25 +0000 |
4 | @@ -1,17 +1,17 @@ |
5 | -<?xml version="1.0" encoding="UTF-8"?> |
6 | -<projectDescription> |
7 | - <name>RevAger</name> |
8 | - <comment></comment> |
9 | - <projects> |
10 | - </projects> |
11 | - <buildSpec> |
12 | - <buildCommand> |
13 | - <name>org.eclipse.jdt.core.javabuilder</name> |
14 | - <arguments> |
15 | - </arguments> |
16 | - </buildCommand> |
17 | - </buildSpec> |
18 | - <natures> |
19 | - <nature>org.eclipse.jdt.core.javanature</nature> |
20 | - </natures> |
21 | -</projectDescription> |
22 | +<?xml version="1.0" encoding="UTF-8"?> |
23 | +<projectDescription> |
24 | + <name>assistant_redesign</name> |
25 | + <comment></comment> |
26 | + <projects> |
27 | + </projects> |
28 | + <buildSpec> |
29 | + <buildCommand> |
30 | + <name>org.eclipse.jdt.core.javabuilder</name> |
31 | + <arguments> |
32 | + </arguments> |
33 | + </buildCommand> |
34 | + </buildSpec> |
35 | + <natures> |
36 | + <nature>org.eclipse.jdt.core.javanature</nature> |
37 | + </natures> |
38 | +</projectDescription> |
39 | |
40 | === modified file 'src/org/revager/app/model/ApplicationData.java' |
41 | --- src/org/revager/app/model/ApplicationData.java 2010-01-31 17:32:35 +0000 |
42 | +++ src/org/revager/app/model/ApplicationData.java 2010-05-26 20:44:25 +0000 |
43 | @@ -41,7 +41,6 @@ |
44 | import org.revager.app.model.appdata.AppSettingValue; |
45 | import org.revager.tools.FileTools; |
46 | |
47 | - |
48 | /** |
49 | * This class is a sub-class of Data an handles the application data, internally |
50 | * stored in a JavaDB. |
51 | |
52 | === modified file 'src/org/revager/gui/AbstractDialog.java' |
53 | --- src/org/revager/gui/AbstractDialog.java 2010-01-31 17:32:35 +0000 |
54 | +++ src/org/revager/gui/AbstractDialog.java 2010-05-26 20:44:25 +0000 |
55 | @@ -51,7 +51,6 @@ |
56 | import org.revager.gui.workers.LoadEmbeddedHelpWorker; |
57 | import org.revager.tools.GUITools; |
58 | |
59 | - |
60 | /** |
61 | * This class is the superclass for all dialogs in Resi. |
62 | */ |
63 | @@ -248,10 +247,10 @@ |
64 | */ |
65 | public void setTopPanel(JPanel panel) { |
66 | panel.setBackground(Color.WHITE); |
67 | - |
68 | + |
69 | panelTop.remove(panelGridTop); |
70 | panelTop.add(panel, BorderLayout.CENTER); |
71 | - |
72 | + |
73 | panelTop.revalidate(); |
74 | } |
75 | |
76 | |
77 | === added file 'src/org/revager/gui/AbstractDialogPanel.java' |
78 | --- src/org/revager/gui/AbstractDialogPanel.java 1970-01-01 00:00:00 +0000 |
79 | +++ src/org/revager/gui/AbstractDialogPanel.java 2010-05-26 20:44:25 +0000 |
80 | @@ -0,0 +1,63 @@ |
81 | +/* |
82 | + * Copyright 2009 Davide Casciato, Sandra Reich, Johannes Wettinger |
83 | + * |
84 | + * This file is part of Resi. |
85 | + * |
86 | + * Resi is free software: you can redistribute it and/or modify |
87 | + * it under the terms of the GNU General Public License as published by |
88 | + * the Free Software Foundation, either version 3 of the License, or |
89 | + * (at your option) any later version. |
90 | + * |
91 | + * Resi is distributed in the hope that it will be useful, |
92 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
93 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
94 | + * GNU General Public License for more details. |
95 | + * |
96 | + * You should have received a copy of the GNU General Public License |
97 | + * along with Resi. If not, see <http://www.gnu.org/licenses/>. |
98 | + */ |
99 | + |
100 | +package org.revager.gui; |
101 | + |
102 | +import javax.swing.JPanel; |
103 | + |
104 | +/** |
105 | + * This class is the superclass for the assistant panels. |
106 | + */ |
107 | +@SuppressWarnings("serial") |
108 | +public abstract class AbstractDialogPanel extends JPanel { |
109 | + |
110 | + private AbstractDialog parent; |
111 | + |
112 | + /** |
113 | + * Returns the parent of this component. |
114 | + */ |
115 | + public AbstractDialog getParent() { |
116 | + return parent; |
117 | + } |
118 | + |
119 | + /** |
120 | + * Sets the hint message in the parent. |
121 | + * |
122 | + * @param hintText |
123 | + */ |
124 | + public void setHint(String hintText) { |
125 | + |
126 | + parent.setMessage(hintText); |
127 | + |
128 | + } |
129 | + |
130 | + /** |
131 | + * Constructor with it's parent as parameter |
132 | + * |
133 | + * @param parent |
134 | + */ |
135 | + public AbstractDialogPanel(AbstractDialog parent) { |
136 | + |
137 | + super(); |
138 | + |
139 | + this.parent = parent; |
140 | + |
141 | + } |
142 | + |
143 | +} |
144 | |
145 | === modified file 'src/org/revager/gui/MainFrame.java' |
146 | --- src/org/revager/gui/MainFrame.java 2010-01-31 17:32:35 +0000 |
147 | +++ src/org/revager/gui/MainFrame.java 2010-05-26 20:44:25 +0000 |
148 | @@ -96,7 +96,7 @@ |
149 | import org.revager.gui.actions.OpenProtocolFrameAction; |
150 | import org.revager.gui.actions.SaveReviewAction; |
151 | import org.revager.gui.actions.SaveReviewAsAction; |
152 | -import org.revager.gui.actions.SelectModeAction; |
153 | +import org.revager.gui.actions.assistant.OpenAssistantAction; |
154 | import org.revager.gui.actions.attendee.AddAttendeeAction; |
155 | import org.revager.gui.actions.attendee.EditAttendeeAction; |
156 | import org.revager.gui.actions.attendee.RemoveAttendeeAction; |
157 | @@ -113,7 +113,6 @@ |
158 | import org.revager.tools.GUITools; |
159 | import org.revager.tools.TreeTools; |
160 | |
161 | - |
162 | /** |
163 | * This class represents the main frame. |
164 | */ |
165 | @@ -221,7 +220,6 @@ |
166 | private JButton commentMeeting; |
167 | private JButton removeMeeting; |
168 | |
169 | - |
170 | /* |
171 | * Hint items |
172 | */ |
173 | @@ -605,7 +603,7 @@ |
174 | |
175 | meetingsTree.getSelectionModel().setSelectionMode( |
176 | TreeSelectionModel.SINGLE_TREE_SELECTION); |
177 | - |
178 | + |
179 | treeScrollPane = new JScrollPane(meetingsTree); |
180 | |
181 | /* |
182 | @@ -638,7 +636,7 @@ |
183 | "meeting.edit")); |
184 | editMeeting.addActionListener(ActionRegistry.getInstance().get( |
185 | EditMeetingAction.class.getName())); |
186 | - |
187 | + |
188 | meetingButtons.add(editMeeting); |
189 | |
190 | commentMeeting = GUITools.newImageButton(); |
191 | @@ -653,21 +651,22 @@ |
192 | meetingButtons.add(commentMeeting); |
193 | |
194 | editProtocol = GUITools.newImageButton(); |
195 | - editProtocol.setIcon(Data.getInstance().getIcon("protocolFrame_25x25_0.png")); |
196 | - editProtocol.setRolloverIcon(Data.getInstance() |
197 | - .getIcon("protocolFrame_25x25.png")); |
198 | + editProtocol.setIcon(Data.getInstance().getIcon( |
199 | + "protocolFrame_25x25_0.png")); |
200 | + editProtocol.setRolloverIcon(Data.getInstance().getIcon( |
201 | + "protocolFrame_25x25.png")); |
202 | editProtocol.setToolTipText(Data.getInstance().getLocaleStr( |
203 | "mainFrame.protocolMode")); |
204 | editProtocol.addActionListener(ActionRegistry.getInstance().get( |
205 | OpenProtocolFrameAction.class.getName())); |
206 | - |
207 | + |
208 | meetingButtons.add(editProtocol); |
209 | - |
210 | + |
211 | commentMeeting.setEnabled(false); |
212 | editMeeting.setEnabled(false); |
213 | removeMeeting.setEnabled(false); |
214 | editProtocol.setEnabled(false); |
215 | - |
216 | + |
217 | attendees = new JLabel(Data.getInstance().getLocaleStr( |
218 | "mainFrame.meetings.attendees")); |
219 | attendees.setBorder(labelBorder); |
220 | @@ -964,7 +963,7 @@ |
221 | tbShowAssistant.setToolTipText(Data.getInstance().getLocaleStr( |
222 | "menu.showAssistant")); |
223 | tbShowAssistant.addActionListener(ActionRegistry.getInstance().get( |
224 | - SelectModeAction.class.getName())); |
225 | + OpenAssistantAction.class.getName())); |
226 | |
227 | addTopComponent(tbShowAssistant); |
228 | |
229 | @@ -1007,11 +1006,11 @@ |
230 | AddAttendeeAction.class.getName())); |
231 | |
232 | addTopComponent(tbNewAttendee); |
233 | - |
234 | + |
235 | tbNewMeeting = GUITools.newImageButton(Data.getInstance().getIcon( |
236 | - "addMeeting_50x50_0.png"), Data.getInstance().getIcon( |
237 | - "addMeeting_50x50.png"), ActionRegistry.getInstance().get( |
238 | - AddMeetingAction.class.getName())); |
239 | + "addMeeting_50x50_0.png"), Data.getInstance().getIcon( |
240 | + "addMeeting_50x50.png"), ActionRegistry.getInstance().get( |
241 | + AddMeetingAction.class.getName())); |
242 | |
243 | addTopComponent(tbNewMeeting); |
244 | |
245 | @@ -1110,7 +1109,7 @@ |
246 | menuFile.setText(Data.getInstance().getLocaleStr("menu.file")); |
247 | |
248 | fileSelectModeItem = new JMenuItem(ActionRegistry.getInstance().get( |
249 | - SelectModeAction.class.getName())); |
250 | + OpenAssistantAction.class.getName())); |
251 | |
252 | menuFile.add(fileSelectModeItem); |
253 | |
254 | @@ -2002,21 +2001,22 @@ |
255 | editAttendee.setEnabled(false); |
256 | } |
257 | |
258 | - if(Data.getInstance().getMode().equals("instant")){ |
259 | - List<Meeting> meetingsList=Application.getInstance().getMeetingMgmt().getMeetings(); |
260 | - for(Meeting meet:meetingsList){ |
261 | - if(meet.isSetProtocol()==false && meetingsList.size()!=0){ |
262 | + if (Data.getInstance().getMode().equals("instant")) { |
263 | + List<Meeting> meetingsList = Application.getInstance() |
264 | + .getMeetingMgmt().getMeetings(); |
265 | + for (Meeting meet : meetingsList) { |
266 | + if (meet.isSetProtocol() == false && meetingsList.size() != 0) { |
267 | addMeeting.setEnabled(false); |
268 | tbNewMeeting.setEnabled(false); |
269 | newMeetingItem.setEnabled(false); |
270 | - }else{ |
271 | + } else { |
272 | addMeeting.setEnabled(true); |
273 | tbNewMeeting.setEnabled(true); |
274 | newMeetingItem.setEnabled(true); |
275 | } |
276 | } |
277 | } |
278 | - |
279 | + |
280 | if (getSelectedMeeting() != null) { |
281 | commentMeeting.setEnabled(true); |
282 | editMeeting.setEnabled(true); |
283 | @@ -2181,7 +2181,7 @@ |
284 | addAttendee.setEnabled(enabled); |
285 | attendeesTable.setEnabled(enabled); |
286 | editAspects.setEnabled(enabled); |
287 | - |
288 | + |
289 | tbNewMeeting.setEnabled(enabled); |
290 | tbNewAttendee.setEnabled(enabled); |
291 | tbManageSeverities.setEnabled(enabled); |
292 | |
293 | === modified file 'src/org/revager/gui/UI.java' |
294 | --- src/org/revager/gui/UI.java 2010-01-31 17:32:35 +0000 |
295 | +++ src/org/revager/gui/UI.java 2010-05-26 20:44:25 +0000 |
296 | @@ -36,7 +36,7 @@ |
297 | import org.revager.app.model.Data; |
298 | import org.revager.gui.aspects_manager.AspectsManagerFrame; |
299 | import org.revager.gui.dialogs.AboutDialog; |
300 | -import org.revager.gui.dialogs.AssistantDialog; |
301 | +import org.revager.gui.dialogs.assistant.AssistantDialog; |
302 | import org.revager.gui.dialogs.AttendeeDialog; |
303 | import org.revager.gui.dialogs.CSVProfilesDialog; |
304 | import org.revager.gui.dialogs.CreateInvitationsDialog; |
305 | |
306 | === modified file 'src/org/revager/gui/actions/ActionRegistry.java' |
307 | --- src/org/revager/gui/actions/ActionRegistry.java 2010-01-31 17:32:35 +0000 |
308 | +++ src/org/revager/gui/actions/ActionRegistry.java 2010-05-26 20:44:25 +0000 |
309 | @@ -23,6 +23,11 @@ |
310 | |
311 | import javax.swing.Action; |
312 | |
313 | +import org.revager.gui.actions.assistant.GoToAddAttPnlAction; |
314 | +import org.revager.gui.actions.assistant.GoToFirstScreenPnlAction; |
315 | +import org.revager.gui.actions.assistant.GoToOpenRevPnlAction; |
316 | +import org.revager.gui.actions.assistant.OpenAssistantAction; |
317 | +import org.revager.gui.actions.assistant.SelectLanguageAction; |
318 | import org.revager.gui.actions.attendee.AddAttToProtAction; |
319 | import org.revager.gui.actions.attendee.AddAttendeeAction; |
320 | import org.revager.gui.actions.attendee.AddResiAttToProtAction; |
321 | @@ -48,7 +53,6 @@ |
322 | import org.revager.gui.actions.severities.PushSeverityUpAction; |
323 | import org.revager.gui.actions.severities.RemoveSeverityAction; |
324 | |
325 | - |
326 | /** |
327 | * The action registry contains all actions of this application, so they can |
328 | * accessed easily. |
329 | @@ -125,9 +129,9 @@ |
330 | |
331 | register(new SaveReviewAsAction()); |
332 | register(new SaveReviewAction()); |
333 | - register(new OpenScribeModeAction()); |
334 | - register(new OpenModeratorModeAction()); |
335 | - register(new InitializeMainFrameAction()); |
336 | + register(new GoToAddAttPnlAction()); |
337 | + register(new GoToOpenRevPnlAction()); |
338 | + register(new InitializeNewReviewAction()); |
339 | |
340 | register(new ManageSeveritiesAction()); |
341 | register(new EditMeetingAction()); |
342 | @@ -154,7 +158,7 @@ |
343 | register(new OpenAspectsManagerAction()); |
344 | |
345 | register(new CommentMeetingAction()); |
346 | - register(new SelectModeAction()); |
347 | + register(new GoToFirstScreenPnlAction()); |
348 | register(new SelectAttOutOfDirAction()); |
349 | register(new OpenProtocolFrameAction()); |
350 | register(new AddResiAttToProtAction()); |
351 | @@ -164,5 +168,7 @@ |
352 | register(new EditAttFromProtAction()); |
353 | register(new OpenExpPDFDialogAction()); |
354 | register(new OpenExpCSVDialogAction()); |
355 | + register(new SelectLanguageAction()); |
356 | + register(new OpenAssistantAction()); |
357 | } |
358 | } |
359 | |
360 | === renamed file 'src/org/revager/gui/actions/InitializeMainFrameAction.java' => 'src/org/revager/gui/actions/InitializeNewReviewAction.java' |
361 | --- src/org/revager/gui/actions/InitializeMainFrameAction.java 2010-01-31 17:32:35 +0000 |
362 | +++ src/org/revager/gui/actions/InitializeNewReviewAction.java 2010-05-26 20:44:25 +0000 |
363 | @@ -22,17 +22,18 @@ |
364 | |
365 | import javax.swing.AbstractAction; |
366 | |
367 | +import org.revager.app.model.Data; |
368 | import org.revager.gui.UI; |
369 | -import org.revager.gui.dialogs.AssistantDialog; |
370 | -import org.revager.gui.workers.LoadReviewWorker; |
371 | +import org.revager.gui.actions.attendee.ConfirmAttendeeAction; |
372 | +import org.revager.gui.dialogs.AttendeeDialog; |
373 | +import org.revager.gui.dialogs.assistant.AssistantDialog; |
374 | import org.revager.gui.workers.NewReviewWorker; |
375 | |
376 | - |
377 | /** |
378 | * The Class InitializeMainFrameAction. |
379 | */ |
380 | @SuppressWarnings("serial") |
381 | -public class InitializeMainFrameAction extends AbstractAction { |
382 | +public class InitializeNewReviewAction extends AbstractAction { |
383 | |
384 | /* |
385 | * (non-Javadoc) |
386 | @@ -42,19 +43,32 @@ |
387 | */ |
388 | @Override |
389 | public void actionPerformed(ActionEvent e) { |
390 | - AssistantDialog.Selection sel = UI.getInstance().getAssistantDialog() |
391 | - .getSelected(); |
392 | - |
393 | - if (sel == AssistantDialog.Selection.NEW_REVIEW) { |
394 | + if (Data.getInstance().getMode().equals("moderator")) { |
395 | new NewReviewWorker().execute(); |
396 | - } else if (sel == AssistantDialog.Selection.LOAD_REVIEW) { |
397 | - new LoadReviewWorker(UI.getInstance().getAssistantDialog() |
398 | - .getPath()).execute(); |
399 | - } else if (sel == AssistantDialog.Selection.MANAGE_ASPECTS) { |
400 | - UI.getInstance().setStatus(UI.Status.NO_FILE_LOADED); |
401 | - |
402 | + |
403 | UI.getInstance().getAssistantDialog().setVisible(false); |
404 | - UI.getInstance().getAspectsManagerFrame().setVisible(true); |
405 | + } else if (Data.getInstance().getMode().equals("instant")) { |
406 | + AssistantDialog assistant = UI.getInstance().getAssistantDialog(); |
407 | + AttendeeDialog attDiag = UI.getInstance().getAttendeeDialog(); |
408 | + |
409 | + if (!attDiag.getNameTxtFld().getText().trim().equals("")) { |
410 | + UI.getInstance().getAssistantDialog().setVisible(false); |
411 | + |
412 | + ActionRegistry.getInstance().get( |
413 | + ConfirmAttendeeAction.class.getName()).actionPerformed( |
414 | + null); |
415 | + |
416 | + new NewReviewWorker().execute(); |
417 | + } else { |
418 | + String message = ""; |
419 | + |
420 | + message = Data.getInstance().getLocaleStr( |
421 | + "attendeeDialog.message.noName"); |
422 | + |
423 | + assistant.setMessage(message); |
424 | + |
425 | + attDiag.getNameTxtFld().setBorder(UI.MARKED_BORDER_INLINE); |
426 | + } |
427 | } |
428 | } |
429 | |
430 | |
431 | === modified file 'src/org/revager/gui/actions/OpenAspectsManagerAction.java' |
432 | --- src/org/revager/gui/actions/OpenAspectsManagerAction.java 2010-01-31 17:32:35 +0000 |
433 | +++ src/org/revager/gui/actions/OpenAspectsManagerAction.java 2010-05-26 20:44:25 +0000 |
434 | @@ -28,7 +28,6 @@ |
435 | import org.revager.app.model.Data; |
436 | import org.revager.gui.UI; |
437 | |
438 | - |
439 | /** |
440 | * The Class OpenAspectsManagerAction. |
441 | */ |
442 | @@ -57,7 +56,7 @@ |
443 | public void actionPerformed(ActionEvent e) { |
444 | UI.getInstance().getAspectsManagerFrame().setSelectedReviewer( |
445 | UI.getInstance().getMainFrame().getSelectedAttendee()); |
446 | - |
447 | + UI.getInstance().getAssistantDialog().setVisible(false); |
448 | UI.getInstance().getAspectsManagerFrame().setVisible(true); |
449 | } |
450 | |
451 | |
452 | === added directory 'src/org/revager/gui/actions/assistant' |
453 | === renamed file 'src/org/revager/gui/actions/OpenScribeModeAction.java' => 'src/org/revager/gui/actions/assistant/GoToAddAttPnlAction.java' |
454 | --- src/org/revager/gui/actions/OpenScribeModeAction.java 2010-01-31 17:32:35 +0000 |
455 | +++ src/org/revager/gui/actions/assistant/GoToAddAttPnlAction.java 2010-05-26 20:44:25 +0000 |
456 | @@ -16,21 +16,23 @@ |
457 | * You should have received a copy of the GNU General Public License |
458 | * along with Resi. If not, see <http://www.gnu.org/licenses/>. |
459 | */ |
460 | -package org.revager.gui.actions; |
461 | +package org.revager.gui.actions.assistant; |
462 | |
463 | import java.awt.event.ActionEvent; |
464 | |
465 | import javax.swing.AbstractAction; |
466 | |
467 | -import org.revager.app.model.Data; |
468 | import org.revager.gui.UI; |
469 | |
470 | - |
471 | /** |
472 | - * The Class OpenScribeModeAction. |
473 | + * The Class GoToAddAttPnlAction. Calling this action will set the assistant to |
474 | + * the AddAttendeePanel. |
475 | + * |
476 | + * @author D.Casciato |
477 | + * |
478 | */ |
479 | @SuppressWarnings("serial") |
480 | -public class OpenScribeModeAction extends AbstractAction { |
481 | +public class GoToAddAttPnlAction extends AbstractAction { |
482 | |
483 | /* |
484 | * (non-Javadoc) |
485 | @@ -40,8 +42,11 @@ |
486 | */ |
487 | @Override |
488 | public void actionPerformed(ActionEvent e) { |
489 | - Data.getInstance().setMode("scribe"); |
490 | - UI.getInstance().getAssistantDialog().setSelectReview(); |
491 | + UI.getInstance().getAssistantDialog().setCurrentPnl( |
492 | + UI.getInstance().getAssistantDialog().getAddAttendeePanel()); |
493 | + UI.getInstance().getAssistantDialog().updateMessage(); |
494 | + UI.getInstance().getAssistantDialog().updateContents(); |
495 | + UI.getInstance().getAssistantDialog().updateWizardBttns(); |
496 | } |
497 | |
498 | } |
499 | |
500 | === renamed file 'src/org/revager/gui/actions/SelectModeAction.java' => 'src/org/revager/gui/actions/assistant/GoToFirstScreenPnlAction.java' |
501 | --- src/org/revager/gui/actions/SelectModeAction.java 2010-01-31 17:32:35 +0000 |
502 | +++ src/org/revager/gui/actions/assistant/GoToFirstScreenPnlAction.java 2010-05-26 20:44:25 +0000 |
503 | @@ -16,39 +16,23 @@ |
504 | * You should have received a copy of the GNU General Public License |
505 | * along with Resi. If not, see <http://www.gnu.org/licenses/>. |
506 | */ |
507 | -package org.revager.gui.actions; |
508 | +package org.revager.gui.actions.assistant; |
509 | |
510 | -import java.awt.Toolkit; |
511 | import java.awt.event.ActionEvent; |
512 | -import java.awt.event.KeyEvent; |
513 | |
514 | import javax.swing.AbstractAction; |
515 | -import javax.swing.Action; |
516 | -import javax.swing.KeyStroke; |
517 | |
518 | -import org.revager.app.model.Data; |
519 | import org.revager.gui.UI; |
520 | |
521 | - |
522 | /** |
523 | - * The Class SelectModeAction. |
524 | + * The Class GoToFirstScreenPnlAction. Calling this action will set the assistant to |
525 | + * the FirstScreenPanel. |
526 | + * |
527 | + * @author D.Casciato |
528 | + * |
529 | */ |
530 | @SuppressWarnings("serial") |
531 | -public class SelectModeAction extends AbstractAction { |
532 | - |
533 | - /** |
534 | - * Instantiates a new select mode action. |
535 | - */ |
536 | - public SelectModeAction() { |
537 | - super(); |
538 | - |
539 | - putValue(Action.SMALL_ICON, Data.getInstance().getIcon( |
540 | - "menuAssistant_16x16.png")); |
541 | - putValue(Action.NAME, Data.getInstance().getLocaleStr( |
542 | - "menu.showAssistant")); |
543 | - putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_M, Toolkit |
544 | - .getDefaultToolkit().getMenuShortcutKeyMask())); |
545 | - } |
546 | +public class GoToFirstScreenPnlAction extends AbstractAction { |
547 | |
548 | /* |
549 | * (non-Javadoc) |
550 | @@ -58,8 +42,11 @@ |
551 | */ |
552 | @Override |
553 | public void actionPerformed(ActionEvent e) { |
554 | - UI.getInstance().getAssistantDialog().setSelectMode(); |
555 | - UI.getInstance().getAssistantDialog().setVisible(true); |
556 | + UI.getInstance().getAssistantDialog().setCurrentPnl( |
557 | + UI.getInstance().getAssistantDialog().getFirstScreenPanel()); |
558 | + UI.getInstance().getAssistantDialog().updateMessage(); |
559 | + UI.getInstance().getAssistantDialog().updateContents(); |
560 | + UI.getInstance().getAssistantDialog().updateWizardBttns(); |
561 | } |
562 | |
563 | } |
564 | |
565 | === renamed file 'src/org/revager/gui/actions/OpenModeratorModeAction.java' => 'src/org/revager/gui/actions/assistant/GoToOpenRevPnlAction.java' |
566 | --- src/org/revager/gui/actions/OpenModeratorModeAction.java 2010-01-31 17:32:35 +0000 |
567 | +++ src/org/revager/gui/actions/assistant/GoToOpenRevPnlAction.java 2010-05-26 20:44:25 +0000 |
568 | @@ -16,21 +16,23 @@ |
569 | * You should have received a copy of the GNU General Public License |
570 | * along with Resi. If not, see <http://www.gnu.org/licenses/>. |
571 | */ |
572 | -package org.revager.gui.actions; |
573 | +package org.revager.gui.actions.assistant; |
574 | |
575 | import java.awt.event.ActionEvent; |
576 | |
577 | import javax.swing.AbstractAction; |
578 | |
579 | -import org.revager.app.model.Data; |
580 | import org.revager.gui.UI; |
581 | |
582 | - |
583 | /** |
584 | - * The Class OpenModeratorModeAction. |
585 | + * The Class GoToOpenReviewPanel. Calling this action will set the assistant to |
586 | + * the OpenReviewPanel. |
587 | + * |
588 | + * @author D.Casciato |
589 | + * |
590 | */ |
591 | @SuppressWarnings("serial") |
592 | -public class OpenModeratorModeAction extends AbstractAction { |
593 | +public class GoToOpenRevPnlAction extends AbstractAction { |
594 | |
595 | /* |
596 | * (non-Javadoc) |
597 | @@ -40,8 +42,13 @@ |
598 | */ |
599 | @Override |
600 | public void actionPerformed(ActionEvent e) { |
601 | - Data.getInstance().setMode("moderator"); |
602 | - UI.getInstance().getAssistantDialog().setSelectReview(); |
603 | + |
604 | + UI.getInstance().getAssistantDialog().setCurrentPnl( |
605 | + UI.getInstance().getAssistantDialog().getOpenReviewPanel()); |
606 | + UI.getInstance().getAssistantDialog().updateMessage(); |
607 | + UI.getInstance().getAssistantDialog().updateContents(); |
608 | + UI.getInstance().getAssistantDialog().updateWizardBttns(); |
609 | + |
610 | } |
611 | |
612 | } |
613 | |
614 | === added file 'src/org/revager/gui/actions/assistant/OpenAssistantAction.java' |
615 | --- src/org/revager/gui/actions/assistant/OpenAssistantAction.java 1970-01-01 00:00:00 +0000 |
616 | +++ src/org/revager/gui/actions/assistant/OpenAssistantAction.java 2010-05-26 20:44:25 +0000 |
617 | @@ -0,0 +1,70 @@ |
618 | +/* |
619 | + * Copyright 2009 Davide Casciato, Sandra Reich, Johannes Wettinger |
620 | + * |
621 | + * This file is part of Resi. |
622 | + * |
623 | + * Resi is free software: you can redistribute it and/or modify |
624 | + * it under the terms of the GNU General Public License as published by |
625 | + * the Free Software Foundation, either version 3 of the License, or |
626 | + * (at your option) any later version. |
627 | + * |
628 | + * Resi is distributed in the hope that it will be useful, |
629 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
630 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
631 | + * GNU General Public License for more details. |
632 | + * |
633 | + * You should have received a copy of the GNU General Public License |
634 | + * along with Resi. If not, see <http://www.gnu.org/licenses/>. |
635 | + */ |
636 | +package org.revager.gui.actions.assistant; |
637 | + |
638 | +import java.awt.Toolkit; |
639 | +import java.awt.event.ActionEvent; |
640 | +import java.awt.event.KeyEvent; |
641 | + |
642 | +import javax.swing.AbstractAction; |
643 | +import javax.swing.Action; |
644 | +import javax.swing.KeyStroke; |
645 | + |
646 | +import org.revager.app.model.Data; |
647 | +import org.revager.gui.UI; |
648 | + |
649 | + |
650 | +@SuppressWarnings("serial") |
651 | +/** |
652 | + * The class OpenAssistantAction. |
653 | + * |
654 | + */ |
655 | +public class OpenAssistantAction extends AbstractAction{ |
656 | + |
657 | + /** |
658 | + * Opens the AssistantDialog. |
659 | + */ |
660 | + public OpenAssistantAction() { |
661 | + super(); |
662 | + |
663 | + putValue(Action.SMALL_ICON, Data.getInstance().getIcon( |
664 | + "menuAssistant_16x16.png")); |
665 | + putValue(Action.NAME, Data.getInstance().getLocaleStr( |
666 | + "menu.showAssistant")); |
667 | + putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_M, Toolkit |
668 | + .getDefaultToolkit().getMenuShortcutKeyMask())); |
669 | + } |
670 | + |
671 | + /* |
672 | + * (non-Javadoc) |
673 | + * |
674 | + * @see |
675 | + * java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) |
676 | + */ |
677 | + @Override |
678 | + public void actionPerformed(ActionEvent e) { |
679 | + UI.getInstance().getAssistantDialog().setCurrentPnl( |
680 | + UI.getInstance().getAssistantDialog().getFirstScreenPanel()); |
681 | + UI.getInstance().getAssistantDialog().updateMessage(); |
682 | + UI.getInstance().getAssistantDialog().updateContents(); |
683 | + UI.getInstance().getAssistantDialog().updateWizardBttns(); |
684 | + UI.getInstance().getAssistantDialog().setVisible(true); |
685 | + } |
686 | + |
687 | +} |
688 | \ No newline at end of file |
689 | |
690 | === added file 'src/org/revager/gui/actions/assistant/SelectLanguageAction.java' |
691 | --- src/org/revager/gui/actions/assistant/SelectLanguageAction.java 1970-01-01 00:00:00 +0000 |
692 | +++ src/org/revager/gui/actions/assistant/SelectLanguageAction.java 2010-05-26 20:44:25 +0000 |
693 | @@ -0,0 +1,73 @@ |
694 | +/* |
695 | + * Copyright 2009 Davide Casciato, Sandra Reich, Johannes Wettinger |
696 | + * |
697 | + * This file is part of Resi. |
698 | + * |
699 | + * Resi is free software: you can redistribute it and/or modify |
700 | + * it under the terms of the GNU General Public License as published by |
701 | + * the Free Software Foundation, either version 3 of the License, or |
702 | + * (at your option) any later version. |
703 | + * |
704 | + * Resi is distributed in the hope that it will be useful, |
705 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
706 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
707 | + * GNU General Public License for more details. |
708 | + * |
709 | + * You should have received a copy of the GNU General Public License |
710 | + * along with Resi. If not, see <http://www.gnu.org/licenses/>. |
711 | + */ |
712 | +package org.revager.gui.actions.assistant; |
713 | + |
714 | +import java.awt.event.ActionEvent; |
715 | + |
716 | +import javax.swing.AbstractAction; |
717 | + |
718 | +import org.revager.app.model.ApplicationData; |
719 | +import org.revager.app.model.Data; |
720 | +import org.revager.app.model.DataException; |
721 | +import org.revager.app.model.appdata.AppSettingKey; |
722 | +import org.revager.gui.UI; |
723 | +import org.revager.gui.dialogs.assistant.LanguagePopupWindow; |
724 | + |
725 | +/** |
726 | + * The Class GoToAddAttPnlAction. Calling this action will open a pop-up to |
727 | + * select a language. After confirming you'll need to restart the application to |
728 | + * activate the language changes. |
729 | + * |
730 | + * @author D.Casciato |
731 | + * |
732 | + */ |
733 | +@SuppressWarnings("serial") |
734 | +public class SelectLanguageAction extends AbstractAction { |
735 | + |
736 | + private LanguagePopupWindow popup; |
737 | + private ApplicationData appData = Data.getInstance().getAppData(); |
738 | + |
739 | + /* |
740 | + * (non-Javadoc) |
741 | + * |
742 | + * @see |
743 | + * java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) |
744 | + */ |
745 | + @Override |
746 | + public void actionPerformed(ActionEvent arg0) { |
747 | + |
748 | + if (UI.getInstance().getAssistantDialog().isVisible()) |
749 | + popup = new LanguagePopupWindow(UI.getInstance() |
750 | + .getAssistantDialog(), Data.getInstance().getLocaleStr( |
751 | + "assistantDialog.selectLanguage")); |
752 | + popup.setVisible(true); |
753 | + |
754 | + if (popup.getButtonClicked() == LanguagePopupWindow.ButtonClicked.OK) { |
755 | + try { |
756 | + appData.setSetting(AppSettingKey.APP_LANGUAGE, popup |
757 | + .getSelectedLanguage()); |
758 | + UI.getInstance().getAssistantDialog().setMessage( |
759 | + Data.getInstance().getLocaleStr( |
760 | + "settingsDialog.general.langHintRestart")); |
761 | + } catch (DataException e) { |
762 | + e.printStackTrace(); |
763 | + } |
764 | + } |
765 | + } |
766 | +} |
767 | |
768 | === modified file 'src/org/revager/gui/actions/attendee/AddResiAttToProtAction.java' |
769 | --- src/org/revager/gui/actions/attendee/AddResiAttToProtAction.java 2010-01-31 17:32:35 +0000 |
770 | +++ src/org/revager/gui/actions/attendee/AddResiAttToProtAction.java 2010-05-26 20:44:25 +0000 |
771 | @@ -29,7 +29,6 @@ |
772 | import org.revager.gui.UI; |
773 | import org.revager.gui.protocol.AddResiAttToProtPopupWindow; |
774 | |
775 | - |
776 | /** |
777 | * The Class AddResiAttToProtAction. |
778 | */ |
779 | @@ -59,7 +58,7 @@ |
780 | |
781 | localAtt = Application.getInstance().getAttendeeMgmt().getAttendee( |
782 | Integer.parseInt(attId)); |
783 | - |
784 | + |
785 | Application.getInstance().getProtocolMgmt().addAttendee(localAtt, |
786 | prep, prot); |
787 | UI.getInstance().getProtocolFrame().getPatm().setProtocol(prot); |
788 | |
789 | === modified file 'src/org/revager/gui/actions/attendee/SelectAttOutOfDirAction.java' |
790 | --- src/org/revager/gui/actions/attendee/SelectAttOutOfDirAction.java 2010-01-31 17:32:35 +0000 |
791 | +++ src/org/revager/gui/actions/attendee/SelectAttOutOfDirAction.java 2010-05-26 20:44:25 +0000 |
792 | @@ -27,13 +27,13 @@ |
793 | import org.revager.gui.DirectoryPopupWindow; |
794 | import org.revager.gui.UI; |
795 | |
796 | - |
797 | /** |
798 | * The Class SelectAttOutOfDirAction. |
799 | */ |
800 | @SuppressWarnings("serial") |
801 | public class SelectAttOutOfDirAction extends AbstractAction { |
802 | private DirectoryPopupWindow popup; |
803 | + |
804 | /* |
805 | * (non-Javadoc) |
806 | * |
807 | @@ -42,11 +42,11 @@ |
808 | */ |
809 | @Override |
810 | public void actionPerformed(ActionEvent ev) { |
811 | - if(UI.getInstance().getAttendeeDialog().isVisible()) |
812 | + if (UI.getInstance().getAttendeeDialog().isVisible()) |
813 | popup = new DirectoryPopupWindow(UI.getInstance() |
814 | - .getAttendeeDialog(), Data.getInstance().getLocaleStr( |
815 | - "popup.directory.title")); |
816 | - else if(UI.getInstance().getAssistantDialog().isVisible()) |
817 | + .getAttendeeDialog(), Data.getInstance().getLocaleStr( |
818 | + "popup.directory.title")); |
819 | + else if (UI.getInstance().getAssistantDialog().isVisible()) |
820 | popup = new DirectoryPopupWindow(UI.getInstance() |
821 | .getAssistantDialog(), Data.getInstance().getLocaleStr( |
822 | "popup.directory.title")); |
823 | @@ -56,12 +56,9 @@ |
824 | if (popup.getAttendeeBx().getSelectedItem() != null) { |
825 | AppAttendee appAtt = ((AppAttendee) popup.getAttendeeBx() |
826 | .getSelectedItem()); |
827 | - |
828 | - if(UI.getInstance().getAttendeeDialog().isVisible()) |
829 | + |
830 | UI.getInstance().getAttendeeDialog().setCurrentAppAttendee( |
831 | appAtt); |
832 | - else if(UI.getInstance().getAssistantDialog().isVisible()) |
833 | - UI.getInstance().getAssistantDialog().setCurrentAppAttendee(appAtt); |
834 | } |
835 | } |
836 | } |
837 | |
838 | === added file 'src/org/revager/gui/actions/popup/LanguagePopupWindowAction.java' |
839 | --- src/org/revager/gui/actions/popup/LanguagePopupWindowAction.java 1970-01-01 00:00:00 +0000 |
840 | +++ src/org/revager/gui/actions/popup/LanguagePopupWindowAction.java 2010-05-26 20:44:25 +0000 |
841 | @@ -0,0 +1,35 @@ |
842 | +package org.revager.gui.actions.popup; |
843 | + |
844 | +import java.awt.event.ActionEvent; |
845 | + |
846 | +import javax.swing.AbstractAction; |
847 | + |
848 | +import org.revager.gui.dialogs.assistant.LanguagePopupWindow; |
849 | +import org.revager.gui.dialogs.assistant.LanguagePopupWindow.ButtonClicked; |
850 | + |
851 | +@SuppressWarnings("serial") |
852 | +public class LanguagePopupWindowAction extends AbstractAction { |
853 | + |
854 | + private LanguagePopupWindow popupWindow = null; |
855 | + |
856 | + private ButtonClicked buttonClick = null; |
857 | + |
858 | + public LanguagePopupWindowAction(LanguagePopupWindow popupWin, |
859 | + ButtonClicked buttonClk) { |
860 | + this.popupWindow = popupWin; |
861 | + this.buttonClick = buttonClk; |
862 | + } |
863 | + |
864 | + /* |
865 | + * (non-Javadoc) |
866 | + * |
867 | + * @see |
868 | + * java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) |
869 | + */ |
870 | + @Override |
871 | + public void actionPerformed(ActionEvent e) { |
872 | + popupWindow.setButtonClicked(buttonClick); |
873 | + popupWindow.setVisible(false); |
874 | + } |
875 | + |
876 | +} |
877 | |
878 | === removed file 'src/org/revager/gui/dialogs/AssistantDialog.java' |
879 | --- src/org/revager/gui/dialogs/AssistantDialog.java 2010-01-31 17:32:35 +0000 |
880 | +++ src/org/revager/gui/dialogs/AssistantDialog.java 1970-01-01 00:00:00 +0000 |
881 | @@ -1,1042 +0,0 @@ |
882 | -/* |
883 | - * Copyright 2009 Davide Casciato, Sandra Reich, Johannes Wettinger |
884 | - * |
885 | - * This file is part of Resi. |
886 | - * |
887 | - * Resi is free software: you can redistribute it and/or modify |
888 | - * it under the terms of the GNU General Public License as published by |
889 | - * the Free Software Foundation, either version 3 of the License, or |
890 | - * (at your option) any later version. |
891 | - * |
892 | - * Resi is distributed in the hope that it will be useful, |
893 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
894 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
895 | - * GNU General Public License for more details. |
896 | - * |
897 | - * You should have received a copy of the GNU General Public License |
898 | - * along with Resi. If not, see <http://www.gnu.org/licenses/>. |
899 | - */ |
900 | -package org.revager.gui.dialogs; |
901 | - |
902 | -import java.awt.BorderLayout; |
903 | -import java.awt.Color; |
904 | -import java.awt.Dimension; |
905 | -import java.awt.Font; |
906 | -import java.awt.Frame; |
907 | -import java.awt.GridBagConstraints; |
908 | -import java.awt.GridBagLayout; |
909 | -import java.awt.GridLayout; |
910 | -import java.awt.event.ActionEvent; |
911 | -import java.awt.event.ActionListener; |
912 | -import java.awt.event.FocusEvent; |
913 | -import java.awt.event.FocusListener; |
914 | -import java.awt.event.ItemEvent; |
915 | -import java.awt.event.ItemListener; |
916 | -import java.awt.event.KeyEvent; |
917 | -import java.awt.event.KeyListener; |
918 | -import java.awt.event.MouseEvent; |
919 | -import java.awt.event.MouseListener; |
920 | -import java.io.File; |
921 | -import java.util.ArrayList; |
922 | -import java.util.List; |
923 | -import java.util.Vector; |
924 | - |
925 | -import javax.swing.BorderFactory; |
926 | -import javax.swing.ButtonGroup; |
927 | -import javax.swing.ImageIcon; |
928 | -import javax.swing.JButton; |
929 | -import javax.swing.JComboBox; |
930 | -import javax.swing.JDialog; |
931 | -import javax.swing.JLabel; |
932 | -import javax.swing.JList; |
933 | -import javax.swing.JOptionPane; |
934 | -import javax.swing.JPanel; |
935 | -import javax.swing.JRadioButton; |
936 | -import javax.swing.JScrollPane; |
937 | -import javax.swing.JTable; |
938 | -import javax.swing.JTextArea; |
939 | -import javax.swing.JTextField; |
940 | -import javax.swing.ListSelectionModel; |
941 | -import javax.swing.SwingWorker; |
942 | -import javax.swing.border.MatteBorder; |
943 | -import javax.swing.event.ChangeEvent; |
944 | -import javax.swing.event.ChangeListener; |
945 | -import javax.swing.event.ListSelectionEvent; |
946 | -import javax.swing.event.ListSelectionListener; |
947 | - |
948 | -import org.revager.app.Application; |
949 | -import org.revager.app.ResiFileFilter; |
950 | -import org.revager.app.model.Data; |
951 | -import org.revager.app.model.DataException; |
952 | -import org.revager.app.model.appdata.AppAttendee; |
953 | -import org.revager.app.model.schema.Attendee; |
954 | -import org.revager.app.model.schema.Role; |
955 | -import org.revager.gui.AbstractDialog; |
956 | -import org.revager.gui.StrengthPopupWindow; |
957 | -import org.revager.gui.UI; |
958 | -import org.revager.gui.StrengthPopupWindow.ButtonClicked; |
959 | -import org.revager.gui.actions.ActionRegistry; |
960 | -import org.revager.gui.actions.ExitAction; |
961 | -import org.revager.gui.actions.InitializeMainFrameAction; |
962 | -import org.revager.gui.actions.OpenModeratorModeAction; |
963 | -import org.revager.gui.actions.OpenScribeModeAction; |
964 | -import org.revager.gui.actions.attendee.SelectAttOutOfDirAction; |
965 | -import org.revager.gui.helpers.FileChooser; |
966 | -import org.revager.gui.models.StrengthTableModel; |
967 | -import org.revager.gui.workers.LoadStdCatalogsWorker; |
968 | -import org.revager.tools.GUITools; |
969 | - |
970 | - |
971 | -/** |
972 | - * The Class AssistantDialog. |
973 | - */ |
974 | -@SuppressWarnings("serial") |
975 | -public class AssistantDialog extends AbstractDialog { |
976 | - |
977 | - /** |
978 | - * The Enum Selection. |
979 | - */ |
980 | - public enum Selection { |
981 | - NEW_REVIEW, LOAD_REVIEW, MANAGE_ASPECTS; |
982 | - } |
983 | - |
984 | - private Selection selected = Selection.NEW_REVIEW; |
985 | - |
986 | - /** |
987 | - * Gets the selected. |
988 | - * |
989 | - * @return the selected |
990 | - */ |
991 | - public Selection getSelected() { |
992 | - return selected; |
993 | - } |
994 | - |
995 | - private GridBagLayout gbl = new GridBagLayout(); |
996 | - private JPanel basePanel = new JPanel(gbl); |
997 | - |
998 | - private JButton buttonExit = new JButton(Data.getInstance().getLocaleStr( |
999 | - "closeApplication")); |
1000 | - private JButton buttonBack = new JButton(Data.getInstance().getLocaleStr( |
1001 | - "back")); |
1002 | - private JButton buttonConfirm = new JButton(Data.getInstance() |
1003 | - .getLocaleStr("confirm")); |
1004 | - |
1005 | - private JList listLastRevs; |
1006 | - |
1007 | - private JTextField pathTxtFld = new JTextField(); |
1008 | - |
1009 | - private final ImageIcon ICON_BROWSE = Data.getInstance().getIcon( |
1010 | - "buttonBrowse_22x22_0.png"); |
1011 | - private final ImageIcon ICON_BROWSE_ROLLOVER = Data.getInstance().getIcon( |
1012 | - "buttonBrowse_22x22.png"); |
1013 | - private JButton buttonBrowse = GUITools.newImageButton(ICON_BROWSE, |
1014 | - ICON_BROWSE_ROLLOVER); |
1015 | - private Level dialogLevel; |
1016 | - private JLabel nameLabel; |
1017 | - private JLabel contactLabel; |
1018 | - private JLabel roleLabel; |
1019 | - private JLabel strengthLabel; |
1020 | - private JTextField nameTxtFld; |
1021 | - private JTextArea contactTxtArea; |
1022 | - private JComboBox roleCmbBx; |
1023 | - private JTable strengthTbl; |
1024 | - |
1025 | - private JButton directoryBttn; |
1026 | - private JButton addStrength = null; |
1027 | - private JButton removeStrength = null; |
1028 | - |
1029 | - private StrengthTableModel stm = null; |
1030 | - private List<String> strengthList = null; |
1031 | - private JScrollPane contactScrllPn; |
1032 | - private JPanel buttonPanel = null; |
1033 | - |
1034 | - private AppAttendee currentAppAttendee; |
1035 | - //private Attendee currentAttendee; |
1036 | - |
1037 | - public enum Level { |
1038 | - LEVEL1, LEVEL2, LEVEL3 |
1039 | - }; |
1040 | - |
1041 | - private boolean nameMissing; |
1042 | - |
1043 | - /** |
1044 | - * Returns if name is missing or not |
1045 | - * |
1046 | - * @return missing |
1047 | - */ |
1048 | - public boolean isNameMissing() { |
1049 | - return nameMissing; |
1050 | - } |
1051 | - |
1052 | - /** |
1053 | - * Gets the path. |
1054 | - * |
1055 | - * @return the path |
1056 | - */ |
1057 | - public String getPath() { |
1058 | - return pathTxtFld.getText(); |
1059 | - } |
1060 | - |
1061 | - /** |
1062 | - * Sets the path. |
1063 | - * |
1064 | - * @param path |
1065 | - * the new path |
1066 | - */ |
1067 | - public void setPath(String path) { |
1068 | - pathTxtFld.setText(path); |
1069 | - } |
1070 | - |
1071 | - /** |
1072 | - * Sets the select mode. |
1073 | - */ |
1074 | - public void setSelectMode() { |
1075 | - dialogLevel = Level.LEVEL1; |
1076 | - |
1077 | - setDescription(Data.getInstance().getLocaleStr( |
1078 | - "assistantDialog.selectModeDescription")); |
1079 | - |
1080 | - basePanel.removeAll(); |
1081 | - |
1082 | - basePanel.setLayout(gbl); |
1083 | - |
1084 | - buttonConfirm.setEnabled(false); |
1085 | - buttonConfirm.setIcon(Data.getInstance().getIcon("buttonOk_16x16.png")); |
1086 | - buttonConfirm.setText(Data.getInstance().getLocaleStr("confirm")); |
1087 | - |
1088 | - buttonBack.setEnabled(false); |
1089 | - |
1090 | - JButton moderator = GUITools.newImageButton(); |
1091 | - moderator |
1092 | - .setIcon(Data.getInstance().getIcon("moderator_128x128_0.png")); |
1093 | - moderator.setRolloverIcon(Data.getInstance().getIcon( |
1094 | - "moderator_128x128.png")); |
1095 | - moderator.addActionListener(ActionRegistry.getInstance().get( |
1096 | - OpenModeratorModeAction.class.getName())); |
1097 | - |
1098 | - JButton scribe = GUITools.newImageButton(); |
1099 | - scribe.setIcon(Data.getInstance().getIcon("scribe_128x128_0.png")); |
1100 | - scribe |
1101 | - .setRolloverIcon(Data.getInstance().getIcon( |
1102 | - "scribe_128x128.png")); |
1103 | - scribe.addActionListener(ActionRegistry.getInstance().get( |
1104 | - OpenScribeModeAction.class.getName())); |
1105 | - |
1106 | - JButton instantReview = GUITools.newImageButton(Data.getInstance() |
1107 | - .getIcon("instantReview_128x128_0.png"), Data.getInstance() |
1108 | - .getIcon("instantReview_128x128.png")); |
1109 | - instantReview.addActionListener(new ActionListener() { |
1110 | - |
1111 | - @Override |
1112 | - public void actionPerformed(ActionEvent e) { |
1113 | - Data.getInstance().setMode("instant"); |
1114 | - UI.getInstance().getAssistantDialog().setSelectReview(); |
1115 | - } |
1116 | - }); |
1117 | - instantReview.setEnabled(true); |
1118 | - |
1119 | - JLabel scribeLabel = new JLabel(Data.getInstance().getLocaleStr( |
1120 | - "mode.scribe")); |
1121 | - JLabel moderatorLabel = new JLabel(Data.getInstance().getLocaleStr( |
1122 | - "mode.moderator")); |
1123 | - JLabel instantRevLabel = new JLabel(Data.getInstance().getLocaleStr( |
1124 | - "mode.instant")); |
1125 | - |
1126 | - buttonExit.addActionListener(ActionRegistry.getInstance().get( |
1127 | - ExitAction.class.getName())); |
1128 | - |
1129 | - GUITools |
1130 | - .addComponent(basePanel, gbl, moderator, 0, 0, 1, 1, 1.0, 1.0, |
1131 | - 0, 20, 0, 20, GridBagConstraints.NONE, |
1132 | - GridBagConstraints.SOUTH); |
1133 | - GUITools.addComponent(basePanel, gbl, moderatorLabel, 0, 1, 1, 1, 1.0, |
1134 | - 1.0, 0, 20, 0, 20, GridBagConstraints.NONE, |
1135 | - GridBagConstraints.NORTH); |
1136 | - GUITools.addComponent(basePanel, gbl, instantReview, 1, 0, 1, 1, 1.0, |
1137 | - 1.0, 0, 20, 0, 20, GridBagConstraints.NONE, |
1138 | - GridBagConstraints.SOUTH); |
1139 | - GUITools.addComponent(basePanel, gbl, instantRevLabel, 1, 1, 1, 1, 1.0, |
1140 | - 1.0, 0, 20, 0, 20, GridBagConstraints.NONE, |
1141 | - GridBagConstraints.NORTH); |
1142 | - GUITools.addComponent(basePanel, gbl, scribe, 2, 0, 1, 1, 1.0, 1.0, 0, |
1143 | - 20, 0, 20, GridBagConstraints.NONE, GridBagConstraints.SOUTH); |
1144 | - GUITools.addComponent(basePanel, gbl, scribeLabel, 2, 1, 1, 1, 1.0, |
1145 | - 1.0, 0, 20, 0, 20, GridBagConstraints.NONE, |
1146 | - GridBagConstraints.NORTH); |
1147 | - |
1148 | - buttonConfirm.requestFocusInWindow(); |
1149 | - |
1150 | - basePanel.repaint(); |
1151 | - |
1152 | - pack(); |
1153 | - } |
1154 | - |
1155 | - /** |
1156 | - * Sets the select review. |
1157 | - */ |
1158 | - public void setSelectReview() { |
1159 | - |
1160 | - dialogLevel = Level.LEVEL2; |
1161 | - |
1162 | - setDescription(Data.getInstance().getLocaleStr( |
1163 | - "assistantDialog.selectReviewDescription")); |
1164 | - |
1165 | - basePanel.removeAll(); |
1166 | - |
1167 | - buttonBack.setEnabled(true); |
1168 | - buttonConfirm.setEnabled(true); |
1169 | - |
1170 | - final JLabel labelSelectReview = new JLabel(Data.getInstance() |
1171 | - .getLocaleStr("assistantDialog.selectReview") |
1172 | - + ":"); |
1173 | - final JLabel labelLastReviews = new JLabel(Data.getInstance() |
1174 | - .getLocaleStr("assistantDialog.lastReviews") |
1175 | - + ":"); |
1176 | - |
1177 | - pathTxtFld.setBorder(UI.STANDARD_BORDER_INLINE); |
1178 | - |
1179 | - /* |
1180 | - * List of last reviews |
1181 | - */ |
1182 | - listLastRevs = new JList(); |
1183 | - listLastRevs.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); |
1184 | - listLastRevs.setSelectedIndex(0); |
1185 | - listLastRevs.setListData(getLastReviews()); |
1186 | - listLastRevs.setBorder(UI.STANDARD_BORDER); |
1187 | - listLastRevs.setFont(listLastRevs.getFont().deriveFont(Font.PLAIN)); |
1188 | - listLastRevs.addListSelectionListener(new ListSelectionListener() { |
1189 | - @Override |
1190 | - public void valueChanged(ListSelectionEvent e) { |
1191 | - List<String> lastRevs; |
1192 | - try { |
1193 | - lastRevs = Data.getInstance().getAppData().getLastReviews(); |
1194 | - if (listLastRevs.getSelectedIndex() > -1) { |
1195 | - String selectedReview = lastRevs.get(listLastRevs |
1196 | - .getSelectedIndex()); |
1197 | - |
1198 | - if (!pathTxtFld.getText().equals(selectedReview)) { |
1199 | - pathTxtFld.setText(selectedReview); |
1200 | - } |
1201 | - } |
1202 | - } catch (DataException exc) { |
1203 | - JOptionPane.showMessageDialog(null, GUITools |
1204 | - .getMessagePane(exc.getMessage()), Data |
1205 | - .getInstance().getLocaleStr("error"), |
1206 | - JOptionPane.ERROR_MESSAGE); |
1207 | - } |
1208 | - } |
1209 | - }); |
1210 | - |
1211 | - ButtonGroup choice = new ButtonGroup(); |
1212 | - |
1213 | - final JRadioButton newReview = new JRadioButton(Data.getInstance() |
1214 | - .getLocaleStr("menu.file.newReview"), true); |
1215 | - choice.add(newReview); |
1216 | - |
1217 | - final JRadioButton openReview = new JRadioButton(Data.getInstance() |
1218 | - .getLocaleStr("menu.file.openReview")); |
1219 | - choice.add(openReview); |
1220 | - |
1221 | - final JRadioButton manageAspects = new JRadioButton(Data.getInstance() |
1222 | - .getLocaleStr("assistantDialog.manageCatalogs")); |
1223 | - choice.add(manageAspects); |
1224 | - |
1225 | - openReview.setEnabled(Data.getInstance().getModeParam( |
1226 | - "ableToOpenReview")); |
1227 | - openReview.addChangeListener(new ChangeListener() { |
1228 | - @Override |
1229 | - public void stateChanged(ChangeEvent e) { |
1230 | - if (openReview.isSelected()) { |
1231 | - pathTxtFld.setEnabled(true); |
1232 | - buttonBrowse.setEnabled(true); |
1233 | - listLastRevs.setEnabled(true); |
1234 | - selected = Selection.LOAD_REVIEW; |
1235 | - labelSelectReview.setEnabled(true); |
1236 | - labelLastReviews.setEnabled(true); |
1237 | - } |
1238 | - } |
1239 | - }); |
1240 | - |
1241 | - newReview.setEnabled(Data.getInstance().getModeParam( |
1242 | - "ableToCreateNewReview")); |
1243 | - newReview.addChangeListener(new ChangeListener() { |
1244 | - @Override |
1245 | - public void stateChanged(ChangeEvent e) { |
1246 | - if (newReview.isSelected()) { |
1247 | - pathTxtFld.setEnabled(false); |
1248 | - buttonBrowse.setEnabled(false); |
1249 | - listLastRevs.setEnabled(false); |
1250 | - selected = Selection.NEW_REVIEW; |
1251 | - labelSelectReview.setEnabled(false); |
1252 | - labelLastReviews.setEnabled(false); |
1253 | - } |
1254 | - } |
1255 | - }); |
1256 | - |
1257 | - manageAspects.setEnabled(Data.getInstance().getModeParam( |
1258 | - "ableToUseAspectsManager")); |
1259 | - manageAspects.addChangeListener(new ChangeListener() { |
1260 | - @Override |
1261 | - public void stateChanged(ChangeEvent e) { |
1262 | - if (manageAspects.isSelected()) { |
1263 | - pathTxtFld.setEnabled(false); |
1264 | - buttonBrowse.setEnabled(false); |
1265 | - listLastRevs.setEnabled(false); |
1266 | - selected = Selection.MANAGE_ASPECTS; |
1267 | - labelSelectReview.setEnabled(false); |
1268 | - labelLastReviews.setEnabled(false); |
1269 | - } |
1270 | - } |
1271 | - }); |
1272 | - |
1273 | - /* |
1274 | - * Set start selection |
1275 | - */ |
1276 | - if (Data.getInstance().getModeParam("ableToCreateNewReview")) { |
1277 | - newReview.setSelected(true); |
1278 | - selected = Selection.NEW_REVIEW; |
1279 | - } else if (Data.getInstance().getModeParam("ableToOpenReview")) { |
1280 | - openReview.setSelected(true); |
1281 | - selected = Selection.LOAD_REVIEW; |
1282 | - } |
1283 | - |
1284 | - pathTxtFld.setEnabled(openReview.isSelected()); |
1285 | - buttonBrowse.setEnabled(openReview.isSelected()); |
1286 | - listLastRevs.setEnabled(openReview.isSelected()); |
1287 | - labelSelectReview.setEnabled(openReview.isSelected()); |
1288 | - labelLastReviews.setEnabled(openReview.isSelected()); |
1289 | - |
1290 | - // container,layout, component,gx,gy,gwidth,gheight,weightx,weighty, t, |
1291 | - // l, b, r, a, i |
1292 | - GUITools.addComponent(basePanel, gbl, manageAspects, 0, 0, 1, 1, 0, 0, |
1293 | - 0, 0, 0, 0, GridBagConstraints.NONE, |
1294 | - GridBagConstraints.NORTHWEST); |
1295 | - GUITools.addComponent(basePanel, gbl, newReview, 0, 1, 1, 1, 0, 0, 10, |
1296 | - 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.NORTHWEST); |
1297 | - GUITools.addComponent(basePanel, gbl, openReview, 0, 2, 1, 1, 0, 0, 10, |
1298 | - 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.NORTHWEST); |
1299 | - GUITools.addComponent(basePanel, gbl, labelSelectReview, 0, 3, 1, 1, 0, |
1300 | - 0, 0, 20, 0, 0, GridBagConstraints.NONE, |
1301 | - GridBagConstraints.WEST); |
1302 | - GUITools.addComponent(basePanel, gbl, pathTxtFld, 1, 3, 2, 1, 1.0, 0.3, |
1303 | - 20, 0, 20, 0, GridBagConstraints.HORIZONTAL, |
1304 | - GridBagConstraints.WEST); |
1305 | - GUITools.addComponent(basePanel, gbl, buttonBrowse, 3, 3, 1, 1, 0, 0, |
1306 | - 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST); |
1307 | - GUITools.addComponent(basePanel, gbl, labelLastReviews, 0, 4, 1, 1, |
1308 | - 0.0, 0.0, 0, 20, 0, 0, GridBagConstraints.NONE, |
1309 | - GridBagConstraints.WEST); |
1310 | - GUITools.addComponent(basePanel, gbl, listLastRevs, 2, 4, 2, 2, 1.0, |
1311 | - 1.0, 0, 0, 0, 0, GridBagConstraints.BOTH, |
1312 | - GridBagConstraints.NORTHWEST); |
1313 | - |
1314 | - buttonConfirm.requestFocusInWindow(); |
1315 | - |
1316 | - basePanel.repaint(); |
1317 | - |
1318 | - pack(); |
1319 | - } |
1320 | - |
1321 | - /** |
1322 | - * Changes to level3 view of the dialog |
1323 | - */ |
1324 | - public void setAddAttToInstRev() { |
1325 | - dialogLevel = Level.LEVEL3; |
1326 | - |
1327 | - setDescription(Data.getInstance().getLocaleStr( |
1328 | - "addYourself.description")); |
1329 | - |
1330 | - basePanel.removeAll(); |
1331 | - |
1332 | - buttonBack.setEnabled(true); |
1333 | - buttonConfirm.setEnabled(true); |
1334 | - |
1335 | - nameLabel = new JLabel(Data.getInstance().getLocaleStr("attendee.name")); |
1336 | - contactLabel = new JLabel(Data.getInstance().getLocaleStr( |
1337 | - "attendee.contact")); |
1338 | - roleLabel = new JLabel(Data.getInstance().getLocaleStr("attendee.role")); |
1339 | - strengthLabel = new JLabel(Data.getInstance().getLocaleStr( |
1340 | - "attendee.priorities")); |
1341 | - |
1342 | - nameTxtFld = new JTextField(); |
1343 | - contactTxtArea = new JTextArea(); |
1344 | - contactTxtArea.addFocusListener(focusListener); |
1345 | - contactScrllPn = GUITools.setIntoScrllPn(contactTxtArea); |
1346 | - roleCmbBx = new JComboBox(); |
1347 | - roleCmbBx.addFocusListener(focusListener); |
1348 | - |
1349 | - for (Role x : Role.values()) { |
1350 | - String roleString = "role.".concat(x.value()); |
1351 | - roleCmbBx.addItem(Data.getInstance().getLocaleStr(roleString)); |
1352 | - } |
1353 | - |
1354 | - roleCmbBx.addItemListener(new ItemListener() { |
1355 | - @Override |
1356 | - public void itemStateChanged(ItemEvent ev) { |
1357 | - updateStrengthTable(); |
1358 | - } |
1359 | - }); |
1360 | - |
1361 | - // roleCmbBx.setSelectedItem(Data.getInstance().getLocaleStr( |
1362 | - // "role." + Role.REVIEWER.toString().toLowerCase())); |
1363 | - |
1364 | - strengthTbl = GUITools.newStandardTable(null, false); |
1365 | - |
1366 | - directoryBttn = GUITools.newImageButton(Data.getInstance().getIcon( |
1367 | - "directory_25x25_0.png"), Data.getInstance().getIcon( |
1368 | - "directory_25x25.png")); |
1369 | - directoryBttn.setToolTipText(Data.getInstance().getLocaleStr( |
1370 | - "attendee.directory")); |
1371 | - directoryBttn.addActionListener(ActionRegistry.getInstance().get( |
1372 | - SelectAttOutOfDirAction.class.getName())); |
1373 | - buttonPanel = new JPanel(new GridLayout(3, 1)); |
1374 | - |
1375 | - strengthTbl.addFocusListener(focusListener); |
1376 | - strengthTbl.addMouseListener(new MouseListener() { |
1377 | - @Override |
1378 | - public void mouseClicked(MouseEvent e) { |
1379 | - updateStrengthButtons(); |
1380 | - } |
1381 | - |
1382 | - @Override |
1383 | - public void mouseEntered(MouseEvent e) { |
1384 | - } |
1385 | - |
1386 | - @Override |
1387 | - public void mouseExited(MouseEvent e) { |
1388 | - } |
1389 | - |
1390 | - @Override |
1391 | - public void mousePressed(MouseEvent e) { |
1392 | - } |
1393 | - |
1394 | - @Override |
1395 | - public void mouseReleased(MouseEvent e) { |
1396 | - } |
1397 | - }); |
1398 | - |
1399 | - addStrength = GUITools.newImageButton(); |
1400 | - addStrength.setIcon(Data.getInstance().getIcon("add_25x25_0.png")); |
1401 | - addStrength |
1402 | - .setRolloverIcon(Data.getInstance().getIcon("add_25x25.png")); |
1403 | - addStrength.setToolTipText(Data.getInstance().getLocaleStr( |
1404 | - "attendeeDialog.addStrength")); |
1405 | - |
1406 | - addStrength.addActionListener(new ActionListener() { |
1407 | - @Override |
1408 | - public void actionPerformed(ActionEvent ev) { |
1409 | - final String title = Data.getInstance().getLocaleStr( |
1410 | - "popup.addStrength.title"); |
1411 | - |
1412 | - SwingWorker<Void, Void> showPopupWorker = new SwingWorker<Void, Void>() { |
1413 | - @Override |
1414 | - protected Void doInBackground() throws Exception { |
1415 | - StrengthPopupWindow popup = new StrengthPopupWindow(UI |
1416 | - .getInstance().getAssistantDialog(), title); |
1417 | - |
1418 | - /* |
1419 | - * Import the standard catalogs, if no catalogs exist in |
1420 | - * the database |
1421 | - */ |
1422 | - try { |
1423 | - if (Data.getInstance().getAppData() |
1424 | - .getNumberOfCatalogs() == 0) { |
1425 | - switchToProgressMode(Data |
1426 | - .getInstance() |
1427 | - .getLocaleStr("status.importingCatalog")); |
1428 | - |
1429 | - LoadStdCatalogsWorker catalogWorker = new LoadStdCatalogsWorker(); |
1430 | - |
1431 | - catalogWorker.execute(); |
1432 | - |
1433 | - while (!catalogWorker.isDone() |
1434 | - && !catalogWorker.isCancelled()) { |
1435 | - Thread.sleep(500); |
1436 | - } |
1437 | - |
1438 | - switchToEditMode(); |
1439 | - } |
1440 | - } catch (Exception exc) { |
1441 | - /* |
1442 | - * do nothing |
1443 | - */ |
1444 | - } |
1445 | - |
1446 | - /* |
1447 | - * Show the popup |
1448 | - */ |
1449 | - popup.setVisible(true); |
1450 | - |
1451 | - if (popup.getButtonClicked() == ButtonClicked.OK) { |
1452 | - for (String cat : popup.getSelCateList()) { |
1453 | - if (!strengthList.contains(cat)) { |
1454 | - strengthList.add(cat); |
1455 | - } |
1456 | - } |
1457 | - |
1458 | - stm.fireTableDataChanged(); |
1459 | - |
1460 | - updateStrengthButtons(); |
1461 | - } |
1462 | - |
1463 | - return null; |
1464 | - } |
1465 | - }; |
1466 | - |
1467 | - showPopupWorker.execute(); |
1468 | - } |
1469 | - }); |
1470 | - |
1471 | - buttonPanel.add(addStrength); |
1472 | - |
1473 | - removeStrength = GUITools.newImageButton(); |
1474 | - removeStrength |
1475 | - .setIcon(Data.getInstance().getIcon("remove_25x25_0.png")); |
1476 | - removeStrength.setRolloverIcon(Data.getInstance().getIcon( |
1477 | - "remove_25x25.png")); |
1478 | - removeStrength.setToolTipText(Data.getInstance().getLocaleStr( |
1479 | - "attendeeDialog.remStrength")); |
1480 | - removeStrength.addActionListener(new ActionListener() { |
1481 | - @Override |
1482 | - public void actionPerformed(ActionEvent ev) { |
1483 | - int selRow = strengthTbl.getSelectedRow(); |
1484 | - |
1485 | - String str = (String) stm.getValueAt(selRow, 1); |
1486 | - |
1487 | - strengthList.remove(str); |
1488 | - |
1489 | - stm.fireTableDataChanged(); |
1490 | - |
1491 | - updateStrengthButtons(); |
1492 | - } |
1493 | - }); |
1494 | - |
1495 | - buttonPanel.add(removeStrength); |
1496 | - |
1497 | - JScrollPane strScrllPn = GUITools.setIntoScrollPane(strengthTbl); |
1498 | - |
1499 | - GUITools.addComponent(basePanel, gbl, nameLabel, 0, 0, 1, 1, 0, 0, 0, |
1500 | - 20, 0, 20, GridBagConstraints.NONE, |
1501 | - GridBagConstraints.NORTHWEST); |
1502 | - GUITools.addComponent(basePanel, gbl, nameTxtFld, 1, 0, 3, 1, 1.0, 0, |
1503 | - 0, 20, 0, 0, GridBagConstraints.HORIZONTAL, |
1504 | - GridBagConstraints.NORTHWEST); |
1505 | - GUITools.addComponent(basePanel, gbl, directoryBttn, 4, 0, 1, 1, 0, 0, |
1506 | - 0, 5, 0, 20, GridBagConstraints.NONE, |
1507 | - GridBagConstraints.NORTHWEST); |
1508 | - GUITools.addComponent(basePanel, gbl, contactLabel, 0, 1, 1, 1, 0, 0, |
1509 | - 5, 20, 0, 20, GridBagConstraints.NONE, |
1510 | - GridBagConstraints.NORTHWEST); |
1511 | - GUITools.addComponent(basePanel, gbl, contactScrllPn, 1, 1, 3, 3, 1.0, |
1512 | - 0.5, 5, 20, 0, 0, GridBagConstraints.BOTH, |
1513 | - GridBagConstraints.NORTHWEST); |
1514 | - GUITools.addComponent(basePanel, gbl, roleLabel, 0, 4, 1, 1, 0, 0, 10, |
1515 | - 20, 0, 20, GridBagConstraints.NONE, |
1516 | - GridBagConstraints.NORTHWEST); |
1517 | - GUITools.addComponent(basePanel, gbl, roleCmbBx, 1, 4, 3, 1, 1.0, 0, |
1518 | - 10, 20, 0, 0, GridBagConstraints.HORIZONTAL, |
1519 | - GridBagConstraints.NORTHWEST); |
1520 | - GUITools.addComponent(basePanel, gbl, strengthLabel, 0, 5, 1, 1, 0, 0, |
1521 | - 17, 20, 0, 20, GridBagConstraints.NONE, |
1522 | - GridBagConstraints.NORTHWEST); |
1523 | - GUITools.addComponent(basePanel, gbl, strScrllPn, 1, 5, 3, 2, 1.0, 0.5, |
1524 | - 15, 20, 0, 0, GridBagConstraints.BOTH, |
1525 | - GridBagConstraints.NORTHWEST); |
1526 | - GUITools.addComponent(basePanel, gbl, buttonPanel, 4, 5, 1, 2, 0, 0, |
1527 | - 17, 5, 0, 0, GridBagConstraints.NONE, |
1528 | - GridBagConstraints.NORTHWEST); |
1529 | - |
1530 | - setCurrentAttendee(null); |
1531 | - |
1532 | - basePanel.repaint(); |
1533 | - |
1534 | - pack(); |
1535 | - } |
1536 | - |
1537 | - /** |
1538 | - * Instantiates a new assistant dialog. |
1539 | - * |
1540 | - * @param parent |
1541 | - * the parent |
1542 | - */ |
1543 | - public AssistantDialog(Frame parent) { |
1544 | - super(parent); |
1545 | - |
1546 | - dialogLevel = Level.LEVEL1; |
1547 | - setTitle(Data.getInstance().getLocaleStr("assistantDialog.title")); |
1548 | - setIcon(Data.getInstance().getIcon("assistantDialog_64x64.png")); |
1549 | - |
1550 | - addButton(buttonExit); |
1551 | - addButton(buttonBack); |
1552 | - addButton(buttonConfirm); |
1553 | - |
1554 | - getContentPane().setLayout(new BorderLayout()); |
1555 | - add(basePanel, BorderLayout.CENTER); |
1556 | - |
1557 | - pathTxtFld.setColumns(13); |
1558 | - pathTxtFld.setText(""); |
1559 | - pathTxtFld.setBorder(BorderFactory.createLineBorder(Color.GRAY)); |
1560 | - pathTxtFld.addKeyListener(new KeyListener() { |
1561 | - @Override |
1562 | - public void keyPressed(KeyEvent arg0) { |
1563 | - } |
1564 | - |
1565 | - @Override |
1566 | - public void keyReleased(KeyEvent e) { |
1567 | - listLastRevs.setListData(getLastReviews()); |
1568 | - } |
1569 | - |
1570 | - @Override |
1571 | - public void keyTyped(KeyEvent e) { |
1572 | - } |
1573 | - }); |
1574 | - |
1575 | - MatteBorder padding = new MatteBorder(0, 10, 0, 0, getContentPane() |
1576 | - .getBackground()); |
1577 | - buttonBrowse.setBorder(padding); |
1578 | - |
1579 | - buttonExit.setIcon(Data.getInstance().getIcon("buttonExit_16x16.png")); |
1580 | - buttonBack.setIcon(Data.getInstance().getIcon("buttonBack_16x16.png")); |
1581 | - buttonConfirm.setIcon(Data.getInstance().getIcon("buttonOk_16x16.png")); |
1582 | - |
1583 | - buttonBrowse.setToolTipText(Data.getInstance().getLocaleStr( |
1584 | - "assistantDialog.browseToolTip")); |
1585 | - buttonBrowse.addActionListener(new ActionListener() { |
1586 | - @Override |
1587 | - public void actionPerformed(ActionEvent e) { |
1588 | - FileChooser fileChooser = UI.getInstance().getFileChooser(); |
1589 | - |
1590 | - if (fileChooser.showDialog(UI.getInstance() |
1591 | - .getAssistantDialog(), FileChooser.MODE_OPEN_FILE, |
1592 | - ResiFileFilter.TYPE_REVIEW) == FileChooser.SELECTED_APPROVE) { |
1593 | - String reviewPath = fileChooser.getFile().getAbsolutePath(); |
1594 | - |
1595 | - UI.getInstance().getAssistantDialog().setPath(reviewPath); |
1596 | - |
1597 | - listLastRevs.setListData(getLastReviews()); |
1598 | - } |
1599 | - } |
1600 | - }); |
1601 | - |
1602 | - buttonBack.addActionListener(new ActionListener() { |
1603 | - @Override |
1604 | - public void actionPerformed(ActionEvent arg0) { |
1605 | - if (dialogLevel == Level.LEVEL2) { |
1606 | - UI.getInstance().getAssistantDialog().setSelectMode(); |
1607 | - dialogLevel = Level.LEVEL1; |
1608 | - } else if (dialogLevel == Level.LEVEL3) { |
1609 | - UI.getInstance().getAssistantDialog().setSelectReview(); |
1610 | - dialogLevel = Level.LEVEL2; |
1611 | - } |
1612 | - } |
1613 | - }); |
1614 | - |
1615 | - buttonConfirm.addActionListener(new ActionListener() { |
1616 | - @Override |
1617 | - public void actionPerformed(ActionEvent e) { |
1618 | - // No review path |
1619 | - if (UI.getInstance().getAssistantDialog().getSelected() == AssistantDialog.Selection.LOAD_REVIEW |
1620 | - && UI.getInstance().getAssistantDialog().getPath() |
1621 | - .equals("")) { |
1622 | - JOptionPane.showMessageDialog(UI.getInstance() |
1623 | - .getAssistantDialog(), GUITools.getMessagePane(Data |
1624 | - .getInstance().getLocaleStr( |
1625 | - "message.selectReviewToLoad")), Data |
1626 | - .getInstance().getLocaleStr("error"), |
1627 | - JOptionPane.ERROR_MESSAGE); |
1628 | - |
1629 | - return; |
1630 | - } |
1631 | - |
1632 | - // Set AddAttendee screen |
1633 | - if (UI.getInstance().getAssistantDialog().getSelected() == AssistantDialog.Selection.NEW_REVIEW |
1634 | - && Data.getInstance().getMode().equals("instant") |
1635 | - && dialogLevel == Level.LEVEL2) { |
1636 | - setAddAttToInstRev(); |
1637 | - |
1638 | - dialogLevel = Level.LEVEL3; |
1639 | - |
1640 | - return; |
1641 | - } |
1642 | - |
1643 | - // Do some checks and updates on level 3 |
1644 | - if (dialogLevel == Level.LEVEL3) { |
1645 | - |
1646 | - |
1647 | - if (!nameTxtFld.getText().trim().equals("")) { |
1648 | - ActionRegistry.getInstance().get( |
1649 | - InitializeMainFrameAction.class.getName()) |
1650 | - .actionPerformed(e); |
1651 | - updateInstantAtt(); |
1652 | - }else{ |
1653 | - String message=""; |
1654 | - message = Data.getInstance().getLocaleStr( |
1655 | - "attendeeDialog.message.noName"); |
1656 | - |
1657 | - setMessage(message); |
1658 | - nameTxtFld.setBorder(UI.MARKED_BORDER_INLINE); |
1659 | - } |
1660 | - |
1661 | - return; |
1662 | - } |
1663 | - |
1664 | - ActionRegistry.getInstance().get( |
1665 | - InitializeMainFrameAction.class.getName()) |
1666 | - .actionPerformed(e); |
1667 | - } |
1668 | - }); |
1669 | - |
1670 | - setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); |
1671 | - |
1672 | - setSelectMode(); |
1673 | - |
1674 | - setMinimumSize(new Dimension(550, 500)); |
1675 | - |
1676 | - pack(); |
1677 | - } |
1678 | - |
1679 | - /* |
1680 | - * (non-Javadoc) |
1681 | - * |
1682 | - * @see org.revager.gui.AbstractDialog#setVisible(boolean) |
1683 | - */ |
1684 | - @Override |
1685 | - public void setVisible(boolean vis) { |
1686 | - if (vis) { |
1687 | - setLocationToCenter(); |
1688 | - |
1689 | - } |
1690 | - |
1691 | - super.setVisible(vis); |
1692 | - } |
1693 | - |
1694 | - /** |
1695 | - * Gets the last reviews. |
1696 | - * |
1697 | - * @return the last reviews |
1698 | - */ |
1699 | - private Vector<String> getLastReviews() { |
1700 | - Vector<String> vecLastReviews = new Vector<String>(); |
1701 | - |
1702 | - try { |
1703 | - for (String rev : Data.getInstance().getAppData().getLastReviews()) { |
1704 | - vecLastReviews.add(new File(rev).getName()); |
1705 | - } |
1706 | - } catch (DataException exc) { |
1707 | - JOptionPane.showMessageDialog(null, GUITools.getMessagePane(exc |
1708 | - .getMessage()), Data.getInstance().getLocaleStr("error"), |
1709 | - JOptionPane.ERROR_MESSAGE); |
1710 | - } |
1711 | - |
1712 | - return vecLastReviews; |
1713 | - } |
1714 | - |
1715 | - private FocusListener focusListener = new FocusListener() { |
1716 | - @Override |
1717 | - public void focusGained(FocusEvent e) { |
1718 | - if (e.getSource() != strengthTbl) { |
1719 | - if (strengthTbl.getRowCount() > 0) { |
1720 | - strengthTbl.removeRowSelectionInterval(0, strengthTbl |
1721 | - .getRowCount() - 1); |
1722 | - |
1723 | - updateStrengthButtons(); |
1724 | - } |
1725 | - } |
1726 | - } |
1727 | - |
1728 | - @Override |
1729 | - public void focusLost(FocusEvent e) { |
1730 | - } |
1731 | - }; |
1732 | - |
1733 | - /** |
1734 | - * Update strength buttons. |
1735 | - */ |
1736 | - private void updateStrengthButtons() { |
1737 | - if (strengthTbl.getSelectedRow() != -1 && strengthTbl.isEnabled()) { |
1738 | - removeStrength.setEnabled(true); |
1739 | - } else { |
1740 | - removeStrength.setEnabled(false); |
1741 | - } |
1742 | - } |
1743 | - |
1744 | - /** |
1745 | - * Sets the current app attendee. |
1746 | - * |
1747 | - * @param appAtt |
1748 | - * the new current app attendee |
1749 | - */ |
1750 | - public void setCurrentAppAttendee(AppAttendee appAtt) { |
1751 | - this.currentAppAttendee = appAtt; |
1752 | - |
1753 | - nameTxtFld.setBorder(UI.STANDARD_BORDER_INLINE); |
1754 | - contactScrllPn.setBorder(UI.STANDARD_BORDER); |
1755 | - |
1756 | - nameTxtFld.setText(currentAppAttendee.getName()); |
1757 | - |
1758 | - try { |
1759 | - contactTxtArea.setText(currentAppAttendee.getContact()); |
1760 | - } catch (DataException e) { |
1761 | - JOptionPane.showMessageDialog(this, GUITools.getMessagePane(e |
1762 | - .getMessage()), Data.getInstance().getLocaleStr("error"), |
1763 | - JOptionPane.ERROR_MESSAGE); |
1764 | - } |
1765 | - |
1766 | - updateStrengthTable(); |
1767 | - } |
1768 | - |
1769 | - /** |
1770 | - * Sets the current attendee. |
1771 | - * |
1772 | - * @param att |
1773 | - * the new current attendee |
1774 | - */ |
1775 | - public void setCurrentAttendee(Attendee att) { |
1776 | - //currentAttendee = att; |
1777 | - currentAppAttendee = null; |
1778 | - |
1779 | - nameTxtFld.setText(null); |
1780 | - contactTxtArea.setText(null); |
1781 | - roleCmbBx.setSelectedItem(Data.getInstance().getLocaleStr( |
1782 | - "role." + Role.REVIEWER.toString().toLowerCase())); |
1783 | - |
1784 | - updateStrengthTable(); |
1785 | - } |
1786 | - |
1787 | - /** |
1788 | - * Update strength table. |
1789 | - */ |
1790 | - private void updateStrengthTable() { |
1791 | - |
1792 | - try { |
1793 | - strengthList = currentAppAttendee.getStrengths(); |
1794 | - } catch (Exception e) { |
1795 | - strengthList = new ArrayList<String>(); |
1796 | - } |
1797 | - |
1798 | - if (stm == null) { |
1799 | - stm = new StrengthTableModel(); |
1800 | - strengthTbl.setModel(stm); |
1801 | - } |
1802 | - |
1803 | - stm.fireTableDataChanged(); |
1804 | - |
1805 | - /* |
1806 | - * View of strengths |
1807 | - */ |
1808 | - boolean enable = false; |
1809 | - |
1810 | - if (((String) roleCmbBx.getSelectedItem()).equals(Data.getInstance() |
1811 | - .getLocaleStr("role.reviewer"))) { |
1812 | - enable = true; |
1813 | - } |
1814 | - |
1815 | - addStrength.setEnabled(enable); |
1816 | - removeStrength.setEnabled(false); |
1817 | - strengthTbl.setEnabled(enable); |
1818 | - strengthLabel.setEnabled(enable); |
1819 | - |
1820 | - if (enable) { |
1821 | - strengthTbl.setForeground(Color.BLACK); |
1822 | - } else { |
1823 | - strengthTbl.setForeground(Color.GRAY); |
1824 | - } |
1825 | - } |
1826 | - |
1827 | - /** |
1828 | - * Gets the strength list. |
1829 | - * |
1830 | - * @return the strengthList |
1831 | - */ |
1832 | - public List<String> getStrengthList() { |
1833 | - if (strengthList == null) { |
1834 | - strengthList = new ArrayList<String>(); |
1835 | - } |
1836 | - |
1837 | - return strengthList; |
1838 | - } |
1839 | - |
1840 | - /** |
1841 | - * Adds instant reviewer |
1842 | - * |
1843 | - */ |
1844 | - public void updateInstantAtt() { |
1845 | - |
1846 | - Role[] roles = Role.values(); |
1847 | - String attContact; |
1848 | - |
1849 | - nameTxtFld.setBorder(UI.STANDARD_BORDER_INLINE); |
1850 | - contactScrllPn.setBorder(UI.STANDARD_BORDER); |
1851 | - |
1852 | - String attName = nameTxtFld.getText(); |
1853 | - if (contactTxtArea.getText() != null) |
1854 | - attContact = contactTxtArea.getText(); |
1855 | - else |
1856 | - attContact = ""; |
1857 | - |
1858 | - Role attRole = roles[roleCmbBx.getSelectedIndex()]; |
1859 | - |
1860 | - nameMissing = false; |
1861 | - |
1862 | - |
1863 | - |
1864 | - /* |
1865 | - * Update the app attendee in the database |
1866 | - */ |
1867 | - try { |
1868 | - if (currentAppAttendee == null) { |
1869 | - currentAppAttendee = Data.getInstance().getAppData() |
1870 | - .getAttendee(attName, attContact); |
1871 | - |
1872 | - if (currentAppAttendee == null) { |
1873 | - currentAppAttendee = Data.getInstance().getAppData() |
1874 | - .newAttendee(attName, attContact); |
1875 | - } |
1876 | - } else { |
1877 | - currentAppAttendee.setNameAndContact(attName, attContact); |
1878 | - } |
1879 | - |
1880 | - for (String str : currentAppAttendee.getStrengths()) { |
1881 | - currentAppAttendee.removeStrength(str); |
1882 | - } |
1883 | - |
1884 | - for (String str : strengthList) { |
1885 | - currentAppAttendee.addStrength(str); |
1886 | - } |
1887 | - } catch (DataException e1) { |
1888 | - JOptionPane.showMessageDialog(UI.getInstance() |
1889 | - .getAssistantDialog(), GUITools.getMessagePane(e1 |
1890 | - .getMessage()), Data.getInstance() |
1891 | - .getLocaleStr("error"), JOptionPane.ERROR_MESSAGE); |
1892 | - } |
1893 | - |
1894 | - /* |
1895 | - * update the review attendee |
1896 | - */ |
1897 | - Attendee newAtt = new Attendee(); |
1898 | - |
1899 | - newAtt.setName(attName); |
1900 | - newAtt.setContact(attContact); |
1901 | - newAtt.setRole(attRole); |
1902 | - |
1903 | - Application.getInstance().getAttendeeMgmt().addAttendee(attName, |
1904 | - attContact, attRole, null); |
1905 | - |
1906 | - setVisible(false); |
1907 | - |
1908 | - UI.getInstance().getAspectsManagerFrame().updateViews(); |
1909 | - |
1910 | - |
1911 | - } |
1912 | - |
1913 | - /** |
1914 | - * Gets the dialog level |
1915 | - * |
1916 | - * @return dialogLevel |
1917 | - */ |
1918 | - public Level getLevel() { |
1919 | - |
1920 | - return dialogLevel; |
1921 | - } |
1922 | - |
1923 | -} |
1924 | |
1925 | === modified file 'src/org/revager/gui/dialogs/EditProductDialog.java' |
1926 | --- src/org/revager/gui/dialogs/EditProductDialog.java 2010-01-31 17:32:35 +0000 |
1927 | +++ src/org/revager/gui/dialogs/EditProductDialog.java 2010-05-26 20:44:25 +0000 |
1928 | @@ -55,7 +55,6 @@ |
1929 | import org.revager.gui.models.ReferenceTableModel; |
1930 | import org.revager.tools.GUITools; |
1931 | |
1932 | - |
1933 | /** |
1934 | * The Class EditProductDialog. |
1935 | */ |
1936 | |
1937 | === modified file 'src/org/revager/gui/dialogs/SettingsDialog.java' |
1938 | --- src/org/revager/gui/dialogs/SettingsDialog.java 2010-01-31 17:32:35 +0000 |
1939 | +++ src/org/revager/gui/dialogs/SettingsDialog.java 2010-05-26 20:44:25 +0000 |
1940 | @@ -63,7 +63,6 @@ |
1941 | import org.revager.tools.FileTools; |
1942 | import org.revager.tools.GUITools; |
1943 | |
1944 | - |
1945 | /** |
1946 | * The Class SettingsDialog. |
1947 | */ |
1948 | @@ -314,8 +313,8 @@ |
1949 | if (currentLang.equals(selectedLang)) { |
1950 | setMessage(null); |
1951 | } else { |
1952 | - setMessage(Data.getInstance() |
1953 | - .getLocaleStr("settingsDialog.general.langHintRestart")); |
1954 | + setMessage(Data.getInstance().getLocaleStr( |
1955 | + "settingsDialog.general.langHintRestart")); |
1956 | } |
1957 | } |
1958 | }); |
1959 | |
1960 | === added directory 'src/org/revager/gui/dialogs/assistant' |
1961 | === added file 'src/org/revager/gui/dialogs/assistant/AssistantDialog.java' |
1962 | --- src/org/revager/gui/dialogs/assistant/AssistantDialog.java 1970-01-01 00:00:00 +0000 |
1963 | +++ src/org/revager/gui/dialogs/assistant/AssistantDialog.java 2010-05-26 20:44:25 +0000 |
1964 | @@ -0,0 +1,283 @@ |
1965 | +/* |
1966 | + * Copyright 2009 Davide Casciato, Sandra Reich, Johannes Wettinger |
1967 | + * |
1968 | + * This file is part of Resi. |
1969 | + * |
1970 | + * Resi is free software: you can redistribute it and/or modify |
1971 | + * it under the terms of the GNU General Public License as published by |
1972 | + * the Free Software Foundation, either version 3 of the License, or |
1973 | + * (at your option) any later version. |
1974 | + * |
1975 | + * Resi is distributed in the hope that it will be useful, |
1976 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1977 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1978 | + * GNU General Public License for more details. |
1979 | + * |
1980 | + * You should have received a copy of the GNU General Public License |
1981 | + * along with Resi. If not, see <http://www.gnu.org/licenses/>. |
1982 | + */ |
1983 | +package org.revager.gui.dialogs.assistant; |
1984 | + |
1985 | +import java.awt.BorderLayout; |
1986 | +import java.awt.Container; |
1987 | +import java.awt.Dimension; |
1988 | +import java.awt.Frame; |
1989 | +import java.awt.event.ActionEvent; |
1990 | +import java.awt.event.ActionListener; |
1991 | + |
1992 | +import javax.swing.ImageIcon; |
1993 | +import javax.swing.JButton; |
1994 | +import javax.swing.JDialog; |
1995 | + |
1996 | +import org.revager.app.model.Data; |
1997 | +import org.revager.gui.AbstractDialog; |
1998 | +import org.revager.gui.UI; |
1999 | +import org.revager.gui.actions.ActionRegistry; |
2000 | +import org.revager.gui.actions.InitializeNewReviewAction; |
2001 | +import org.revager.gui.actions.assistant.GoToFirstScreenPnlAction; |
2002 | + |
2003 | +/** |
2004 | + * The class AssistantDialog. |
2005 | + * |
2006 | + * @author D.Casciato |
2007 | + * |
2008 | + */ |
2009 | +@SuppressWarnings("serial") |
2010 | +public class AssistantDialog extends AbstractDialog { |
2011 | + |
2012 | + private Container currentPnl; |
2013 | + private FirstScreenPanel firstScreenPanel = new FirstScreenPanel(this); |
2014 | + private OpenReviewPanel openReviewPanel = new OpenReviewPanel(this); |
2015 | + private Container addAttendeePanel = UI.getInstance().getAttendeeDialog() |
2016 | + .getContentPane(); |
2017 | + |
2018 | + private ImageIcon revagerIcon = Data.getInstance().getIcon( |
2019 | + "revager_50x50.png"); |
2020 | + |
2021 | + /** |
2022 | + * Action to shut down the application. |
2023 | + */ |
2024 | + private ActionListener exitApp = new ActionListener() { |
2025 | + |
2026 | + @Override |
2027 | + public void actionPerformed(ActionEvent e) { |
2028 | + System.exit(0); |
2029 | + } |
2030 | + |
2031 | + }; |
2032 | + |
2033 | + /** |
2034 | + * Action to initialize a new review. |
2035 | + */ |
2036 | + private ActionListener initQuickRev = ActionRegistry.getInstance().get( |
2037 | + InitializeNewReviewAction.class.getName()); |
2038 | + |
2039 | + /* |
2040 | + * Strings |
2041 | + */ |
2042 | + private String firstScreenDescStrng = Data.getInstance().getLocaleStr( |
2043 | + "assistantDialog.firstDesc"); |
2044 | + |
2045 | + private String openRevDescStrng = Data.getInstance().getLocaleStr( |
2046 | + "assistantDialog.openDesc"); |
2047 | + |
2048 | + private String addAttDescStrng = Data.getInstance().getLocaleStr( |
2049 | + "addYourself.description"); |
2050 | + private String localMode = "moderator"; |
2051 | + |
2052 | + /* |
2053 | + * |
2054 | + * Wizard buttons |
2055 | + */ |
2056 | + private JButton backBttn = new JButton(); |
2057 | + private JButton finishBttn = new JButton(); |
2058 | + private ImageIcon confirmIcon = Data.getInstance().getIcon( |
2059 | + "buttonOk_16x16.png"); |
2060 | + private String confirmString = Data.getInstance().getLocaleStr("confirm"); |
2061 | + |
2062 | + /** |
2063 | + * Sets the localMode parameter |
2064 | + * |
2065 | + * @param string |
2066 | + */ |
2067 | + public void setLocalMode(String string) { |
2068 | + this.localMode = string; |
2069 | + |
2070 | + } |
2071 | + |
2072 | + /** |
2073 | + * Returns the currentPanel. |
2074 | + * |
2075 | + * @return |
2076 | + */ |
2077 | + public Container getCurrentPnl() { |
2078 | + return currentPnl; |
2079 | + } |
2080 | + |
2081 | + /** |
2082 | + * Sets the currentPanel. |
2083 | + * |
2084 | + * @param currentPnl |
2085 | + */ |
2086 | + public void setCurrentPnl(Container currentPnl) { |
2087 | + |
2088 | + this.currentPnl = currentPnl; |
2089 | + |
2090 | + } |
2091 | + |
2092 | + /** |
2093 | + * Returns the FirstScreenPanel. |
2094 | + * |
2095 | + * @return |
2096 | + */ |
2097 | + public FirstScreenPanel getFirstScreenPanel() { |
2098 | + return firstScreenPanel; |
2099 | + } |
2100 | + |
2101 | + /** |
2102 | + * Returns the OpenReviewPanel. |
2103 | + * |
2104 | + * @return |
2105 | + */ |
2106 | + public OpenReviewPanel getOpenReviewPanel() { |
2107 | + return openReviewPanel; |
2108 | + } |
2109 | + |
2110 | + /** |
2111 | + * Returns the AddAttendeePanel. |
2112 | + * |
2113 | + * @return |
2114 | + */ |
2115 | + public Container getAddAttendeePanel() { |
2116 | + return addAttendeePanel; |
2117 | + } |
2118 | + |
2119 | + /** |
2120 | + * Returns the BackButton. |
2121 | + * |
2122 | + * @return |
2123 | + */ |
2124 | + public JButton getBackBttn() { |
2125 | + return backBttn; |
2126 | + } |
2127 | + |
2128 | + /** |
2129 | + * constructor |
2130 | + * |
2131 | + * @param parent |
2132 | + */ |
2133 | + public AssistantDialog(Frame parent) { |
2134 | + super(parent); |
2135 | + |
2136 | + defineWizardBttns(); |
2137 | + Data.getInstance().setMode("moderator"); |
2138 | + setIcon(revagerIcon); |
2139 | + setCurrentPnl(firstScreenPanel); |
2140 | + getContentPane().setLayout(new BorderLayout()); |
2141 | + backBttn.addActionListener(ActionRegistry.getInstance().get( |
2142 | + GoToFirstScreenPnlAction.class.getName())); |
2143 | + |
2144 | + updateContents(); |
2145 | + |
2146 | + setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); |
2147 | + |
2148 | + setMinimumSize(new Dimension(650, 500)); |
2149 | + |
2150 | + pack(); |
2151 | + } |
2152 | + |
2153 | + /** |
2154 | + * Defines the wizard buttons ; should be invoked in the constructor once. |
2155 | + */ |
2156 | + private void defineWizardBttns() { |
2157 | + |
2158 | + backBttn.setText(Data.getInstance().getLocaleStr("back")); |
2159 | + backBttn.setIcon(Data.getInstance().getIcon("buttonBack_16x16.png")); |
2160 | + |
2161 | + finishBttn.setText(confirmString); |
2162 | + finishBttn.setIcon(confirmIcon); |
2163 | + |
2164 | + this.addButton(backBttn); |
2165 | + this.addButton(finishBttn); |
2166 | + |
2167 | + backBttn.setEnabled(false); |
2168 | + finishBttn.setEnabled(false); |
2169 | + } |
2170 | + |
2171 | + /** |
2172 | + * Updates the wizard buttons and should be invoked after the content has |
2173 | + * changed. |
2174 | + */ |
2175 | + public void updateWizardBttns() { |
2176 | + finishBttn.removeActionListener(exitApp); |
2177 | + finishBttn.removeActionListener(openReviewPanel.openExistRev); |
2178 | + finishBttn.removeActionListener(initQuickRev); |
2179 | + |
2180 | + if (currentPnl == firstScreenPanel) { |
2181 | + |
2182 | + backBttn.setEnabled(false); |
2183 | + finishBttn.setEnabled(false); |
2184 | + |
2185 | + } else if (currentPnl == addAttendeePanel) { |
2186 | + |
2187 | + backBttn.setEnabled(true); |
2188 | + finishBttn.setEnabled(true); |
2189 | + finishBttn.addActionListener(initQuickRev); |
2190 | + |
2191 | + } else if (currentPnl == openReviewPanel) { |
2192 | + |
2193 | + backBttn.setEnabled(true); |
2194 | + finishBttn.setEnabled(true); |
2195 | + finishBttn.addActionListener(openReviewPanel.openExistRev); |
2196 | + if (openReviewPanel.getLastRevsVector().size() == 0) |
2197 | + finishBttn.setEnabled(false); |
2198 | + |
2199 | + } |
2200 | + } |
2201 | + |
2202 | + /** |
2203 | + * Updates the content area. |
2204 | + */ |
2205 | + public void updateContents() { |
2206 | + |
2207 | + this.getContentPane().removeAll(); |
2208 | + |
2209 | + updateMessage(); |
2210 | + |
2211 | + if (currentPnl == firstScreenPanel) { |
2212 | + this.getContentPane().add(firstScreenPanel, BorderLayout.CENTER); |
2213 | + Data.getInstance().setMode("moderator"); |
2214 | + } else if (currentPnl == addAttendeePanel) { |
2215 | + this.getContentPane().add(addAttendeePanel, BorderLayout.CENTER); |
2216 | + Data.getInstance().setMode("instant"); |
2217 | + |
2218 | + UI.getInstance().getAttendeeDialog().setCurrentAttendee(null); |
2219 | + UI.getInstance().getAttendeeDialog().getNameTxtFld().setText( |
2220 | + System.getProperty("user.name")); |
2221 | + } else if (currentPnl == openReviewPanel) { |
2222 | + this.getContentPane().add(openReviewPanel, BorderLayout.CENTER); |
2223 | + Data.getInstance().setMode(localMode); |
2224 | + } |
2225 | + |
2226 | + this.getContentPane().validate(); |
2227 | + this.getContentPane().repaint(); |
2228 | + |
2229 | + } |
2230 | + |
2231 | + /** |
2232 | + * Updates the description of the assistant, depending from the |
2233 | + * currentPanel. |
2234 | + */ |
2235 | + public void updateMessage() { |
2236 | + |
2237 | + if (currentPnl == firstScreenPanel) { |
2238 | + setDescription(firstScreenDescStrng); |
2239 | + } else if (currentPnl == addAttendeePanel) { |
2240 | + setDescription(addAttDescStrng); |
2241 | + } else if (currentPnl == openReviewPanel) { |
2242 | + setDescription(openRevDescStrng); |
2243 | + } |
2244 | + |
2245 | + } |
2246 | + |
2247 | +} |
2248 | |
2249 | === added file 'src/org/revager/gui/dialogs/assistant/FirstScreenPanel.java' |
2250 | --- src/org/revager/gui/dialogs/assistant/FirstScreenPanel.java 1970-01-01 00:00:00 +0000 |
2251 | +++ src/org/revager/gui/dialogs/assistant/FirstScreenPanel.java 2010-05-26 20:44:25 +0000 |
2252 | @@ -0,0 +1,193 @@ |
2253 | +/* |
2254 | + * Copyright 2009 Davide Casciato, Sandra Reich, Johannes Wettinger |
2255 | + * |
2256 | + * This file is part of Resi. |
2257 | + * |
2258 | + * Resi is free software: you can redistribute it and/or modify |
2259 | + * it under the terms of the GNU General Public License as published by |
2260 | + * the Free Software Foundation, either version 3 of the License, or |
2261 | + * (at your option) any later version. |
2262 | + * |
2263 | + * Resi is distributed in the hope that it will be useful, |
2264 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2265 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2266 | + * GNU General Public License for more details. |
2267 | + * |
2268 | + * You should have received a copy of the GNU General Public License |
2269 | + * along with Resi. If not, see <http://www.gnu.org/licenses/>. |
2270 | + */ |
2271 | +package org.revager.gui.dialogs.assistant; |
2272 | + |
2273 | +import java.awt.GridBagConstraints; |
2274 | +import java.awt.GridBagLayout; |
2275 | +import java.awt.event.ActionListener; |
2276 | + |
2277 | +import javax.swing.ImageIcon; |
2278 | +import javax.swing.JSeparator; |
2279 | +import javax.swing.SwingConstants; |
2280 | + |
2281 | +import org.revager.app.model.Data; |
2282 | +import org.revager.gui.AbstractDialog; |
2283 | +import org.revager.gui.AbstractDialogPanel; |
2284 | +import org.revager.gui.actions.ActionRegistry; |
2285 | +import org.revager.gui.actions.InitializeNewReviewAction; |
2286 | +import org.revager.gui.actions.OpenAspectsManagerAction; |
2287 | +import org.revager.gui.actions.assistant.GoToAddAttPnlAction; |
2288 | +import org.revager.gui.actions.assistant.GoToOpenRevPnlAction; |
2289 | +import org.revager.gui.actions.assistant.SelectLanguageAction; |
2290 | +import org.revager.gui.helpers.HLink; |
2291 | +import org.revager.gui.helpers.VLink; |
2292 | +import org.revager.tools.GUITools; |
2293 | + |
2294 | +/** |
2295 | + * The class FirstScreenPanel. |
2296 | + * |
2297 | + * @author D.Casciato |
2298 | + * |
2299 | + */ |
2300 | + |
2301 | +@SuppressWarnings("serial") |
2302 | +public class FirstScreenPanel extends AbstractDialogPanel { |
2303 | + |
2304 | + private JSeparator dottedSprtr = new JSeparator(SwingConstants.HORIZONTAL); |
2305 | + |
2306 | + private GridBagLayout gbl1 = new GridBagLayout(); |
2307 | + |
2308 | + |
2309 | + /** |
2310 | + * Action to select a language. |
2311 | + */ |
2312 | + private ActionListener selectLanguageAction = ActionRegistry.getInstance() |
2313 | + .get(SelectLanguageAction.class.getName()); |
2314 | + /** |
2315 | + * Action to open up the Aspects-Manager. |
2316 | + */ |
2317 | + private ActionListener openAspMngrAction = ActionRegistry.getInstance() |
2318 | + .get(OpenAspectsManagerAction.class.getName()); |
2319 | + |
2320 | + /* |
2321 | + * Strings |
2322 | + */ |
2323 | + private String quickRevTooltipStrng = Data.getInstance().getLocaleStr( |
2324 | + "assistantDialog.quickRev.rollover"); |
2325 | + private String newRevTooltipStrng = Data.getInstance().getLocaleStr( |
2326 | + "assistantDialog.newRev.rollover"); |
2327 | + private String openRevTooltipStrng = Data.getInstance().getLocaleStr( |
2328 | + "assistantDialog.openRev.rollover"); |
2329 | + private String selectLanguageTooltipStrng = Data.getInstance() |
2330 | + .getLocaleStr("assistantDialog.selectLanguage.rollover"); |
2331 | + private String openAspectsMngrTooltipStrng = Data.getInstance() |
2332 | + .getLocaleStr("assistantDialog.openAspectsMngr.rollover"); |
2333 | + |
2334 | + private String openRevStrng = Data.getInstance().getLocaleStr( |
2335 | + "assistantDialog.openReview"); |
2336 | + |
2337 | + private String languageStrng = Data.getInstance().getLocaleStr( |
2338 | + "assistantDialog.selectLanguage"); |
2339 | + private String aspectsManagerStrng = Data.getInstance().getLocaleStr( |
2340 | + "assistantDialog.aspectsManager"); |
2341 | + private String newReviewStrng = Data.getInstance().getLocaleStr( |
2342 | + "assistantDialog.newReview"); |
2343 | + private String quickstartStrng = Data.getInstance().getLocaleStr( |
2344 | + "assistantDialog.quickstart"); |
2345 | + |
2346 | + /* |
2347 | + *ImageIcons |
2348 | + */ |
2349 | + private ImageIcon moderatorIcon = Data.getInstance().getIcon( |
2350 | + "moderator_128x128_0.png"); |
2351 | + private ImageIcon moderatorRolloverIcon = Data.getInstance().getIcon( |
2352 | + "moderator_128x128.png"); |
2353 | + private ImageIcon openRevIcon = Data.getInstance().getIcon( |
2354 | + "scribe_128x128_0.png"); |
2355 | + private ImageIcon openRevRolloverIcon = Data.getInstance().getIcon( |
2356 | + "scribe_128x128.png"); |
2357 | + private ImageIcon quickstartIcon = Data.getInstance().getIcon( |
2358 | + "instantReview_128x128_0.png"); |
2359 | + private ImageIcon quickstartRolloverIcon = Data.getInstance().getIcon( |
2360 | + "instantReview_128x128.png"); |
2361 | + private ImageIcon languageIcon = Data.getInstance().getIcon( |
2362 | + "language_31x20_0.png"); |
2363 | + private ImageIcon languageRolloverIcon = Data.getInstance().getIcon( |
2364 | + "language_31x20.png"); |
2365 | + private ImageIcon aspectsManagerIcon = Data.getInstance().getIcon( |
2366 | + "aspectsManager_25x25_0.png"); |
2367 | + private ImageIcon aspectsManagerRolloverIcon = Data.getInstance().getIcon( |
2368 | + "aspectsManager_25x25.png"); |
2369 | + |
2370 | + /* |
2371 | + * Links |
2372 | + */ |
2373 | + private VLink newReviewLnk = new VLink(newReviewStrng, moderatorIcon, |
2374 | + moderatorRolloverIcon); |
2375 | + private VLink quickstartLnk = new VLink(quickstartStrng, quickstartIcon, |
2376 | + quickstartRolloverIcon); |
2377 | + private VLink openReviewLnk = new VLink(openRevStrng, openRevIcon, |
2378 | + openRevRolloverIcon); |
2379 | + private HLink selectLanguageLnk = new HLink(languageStrng, languageIcon, |
2380 | + languageRolloverIcon, null); |
2381 | + private HLink openAspManagerLnk = new HLink(aspectsManagerStrng, |
2382 | + aspectsManagerIcon, aspectsManagerRolloverIcon, null); |
2383 | + |
2384 | + /** |
2385 | + * Constructor |
2386 | + * |
2387 | + * @param parent |
2388 | + */ |
2389 | + public FirstScreenPanel(AbstractDialog parent) { |
2390 | + super(parent); |
2391 | + createFirstScreenPnl(); |
2392 | + } |
2393 | + |
2394 | + /** |
2395 | + * Method which creates and locates the components of the panel. |
2396 | + */ |
2397 | + private void createFirstScreenPnl() { |
2398 | + |
2399 | + quickstartLnk.setFather(this); |
2400 | + newReviewLnk.setFather(this); |
2401 | + openReviewLnk.setFather(this); |
2402 | + selectLanguageLnk.setFather(this); |
2403 | + openAspManagerLnk.setFather(this); |
2404 | + |
2405 | + newReviewLnk.addActionListener(ActionRegistry.getInstance().get( |
2406 | + InitializeNewReviewAction.class.getName())); |
2407 | + |
2408 | + openReviewLnk.addActionListener(ActionRegistry.getInstance().get(GoToOpenRevPnlAction.class.getName())); |
2409 | + quickstartLnk.addActionListener(ActionRegistry.getInstance().get(GoToAddAttPnlAction.class.getName())); |
2410 | + selectLanguageLnk.addActionListener(selectLanguageAction); |
2411 | + openAspManagerLnk.addActionListener(openAspMngrAction); |
2412 | + |
2413 | + selectLanguageLnk.setUnderlined(true); |
2414 | + openAspManagerLnk.setUnderlined(true); |
2415 | + |
2416 | + quickstartLnk.addRolloverText(quickRevTooltipStrng); |
2417 | + |
2418 | + openReviewLnk.addRolloverText(openRevTooltipStrng); |
2419 | + newReviewLnk.addRolloverText(newRevTooltipStrng); |
2420 | + selectLanguageLnk.addRolloverText(selectLanguageTooltipStrng); |
2421 | + openAspManagerLnk.addRolloverText(openAspectsMngrTooltipStrng); |
2422 | + |
2423 | + this.setLayout(gbl1); |
2424 | + GUITools.addComponent(this, gbl1, newReviewLnk, 0, 0, 1, 1, |
2425 | + 1.0, 1.0, 0, 20, 0, 20, GridBagConstraints.BOTH, |
2426 | + GridBagConstraints.NORTHWEST); |
2427 | + GUITools.addComponent(this, gbl1, quickstartLnk, 1, 0, 1, |
2428 | + 1, 1.0, 1.0, 0, 20, 0, 20, GridBagConstraints.BOTH, |
2429 | + GridBagConstraints.NORTHWEST); |
2430 | + GUITools.addComponent(this, gbl1, openReviewLnk, 2, 0, 1, |
2431 | + 1, 1.0, 1.0, 0, 20, 0, 20, GridBagConstraints.BOTH, |
2432 | + GridBagConstraints.NORTHWEST); |
2433 | + GUITools.addComponent(this, gbl1, dottedSprtr, 0, 1, 3, 1, |
2434 | + 1.0, 0.0, 20, 20, 0, 0, GridBagConstraints.HORIZONTAL, |
2435 | + GridBagConstraints.CENTER); |
2436 | + GUITools.addComponent(this, gbl1, selectLanguageLnk, 0, 2, |
2437 | + 1, 1, 1.0, 0.0, 20, 20, 0, 0, GridBagConstraints.HORIZONTAL, |
2438 | + GridBagConstraints.CENTER); |
2439 | + GUITools.addComponent(this, gbl1, openAspManagerLnk, 2, 2, |
2440 | + 1, 1, 1.0, 0.0, 20, 0, 0, 0, GridBagConstraints.HORIZONTAL, |
2441 | + GridBagConstraints.CENTER); |
2442 | + |
2443 | + } |
2444 | + |
2445 | +} |
2446 | |
2447 | === added file 'src/org/revager/gui/dialogs/assistant/LanguagePopupWindow.java' |
2448 | --- src/org/revager/gui/dialogs/assistant/LanguagePopupWindow.java 1970-01-01 00:00:00 +0000 |
2449 | +++ src/org/revager/gui/dialogs/assistant/LanguagePopupWindow.java 2010-05-26 20:44:25 +0000 |
2450 | @@ -0,0 +1,227 @@ |
2451 | +/* |
2452 | + * Copyright 2009 Davide Casciato, Sandra Reich, Johannes Wettinger |
2453 | + * |
2454 | + * This file is part of Resi. |
2455 | + * |
2456 | + * Resi is free software: you can redistribute it and/or modify |
2457 | + * it under the terms of the GNU General Public License as published by |
2458 | + * the Free Software Foundation, either version 3 of the License, or |
2459 | + * (at your option) any later version. |
2460 | + * |
2461 | + * Resi is distributed in the hope that it will be useful, |
2462 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2463 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2464 | + * GNU General Public License for more details. |
2465 | + * |
2466 | + * You should have received a copy of the GNU General Public License |
2467 | + * along with Resi. If not, see <http://www.gnu.org/licenses/>. |
2468 | + */ |
2469 | +package org.revager.gui.dialogs.assistant; |
2470 | + |
2471 | +import java.awt.BorderLayout; |
2472 | +import java.awt.Dimension; |
2473 | +import java.awt.GridBagConstraints; |
2474 | +import java.awt.GridBagLayout; |
2475 | +import java.awt.Window; |
2476 | + |
2477 | +import javax.swing.BorderFactory; |
2478 | +import javax.swing.ImageIcon; |
2479 | +import javax.swing.JButton; |
2480 | +import javax.swing.JDialog; |
2481 | +import javax.swing.JPanel; |
2482 | +import javax.swing.JTextArea; |
2483 | + |
2484 | +import org.revager.app.model.ApplicationData; |
2485 | +import org.revager.app.model.Data; |
2486 | +import org.revager.app.model.DataException; |
2487 | +import org.revager.app.model.appdata.AppSettingKey; |
2488 | +import org.revager.gui.UI; |
2489 | +import org.revager.gui.actions.popup.LanguagePopupWindowAction; |
2490 | +import org.revager.gui.helpers.HLink; |
2491 | +import org.revager.gui.helpers.LinkGroup; |
2492 | +import org.revager.tools.GUITools; |
2493 | + |
2494 | +/** |
2495 | + * The Class LanguagePopupWindow. |
2496 | + * |
2497 | + * @author D.Casciato |
2498 | + * |
2499 | + */ |
2500 | +@SuppressWarnings("serial") |
2501 | +public class LanguagePopupWindow extends JDialog { |
2502 | + |
2503 | + /** |
2504 | + * The Enum ButtonClicked. |
2505 | + */ |
2506 | + public static enum ButtonClicked { |
2507 | + OK, ABORT; |
2508 | + }; |
2509 | + |
2510 | + private ApplicationData appData = Data.getInstance().getAppData(); |
2511 | + |
2512 | + private ButtonClicked buttonClicked = null; |
2513 | + |
2514 | + private GridBagLayout gbl = new GridBagLayout(); |
2515 | + /* |
2516 | + * Panels |
2517 | + */ |
2518 | + private JPanel inputPnl = new JPanel(gbl); |
2519 | + private JPanel panelBase = GUITools.newPopupBasePanel(); |
2520 | + |
2521 | + /* |
2522 | + * Strings |
2523 | + */ |
2524 | + private String germanStrng = Data.getInstance().getLocaleStr( |
2525 | + "popup.language.german"); |
2526 | + private String englishStrng = Data.getInstance().getLocaleStr( |
2527 | + "popup.language.english"); |
2528 | + |
2529 | + /* |
2530 | + * ImageIcons |
2531 | + */ |
2532 | + private ImageIcon germanIcon = Data.getInstance().getIcon( |
2533 | + "german_31x20_0.png"); |
2534 | + private ImageIcon germanRolloverIcon = Data.getInstance().getIcon( |
2535 | + "german_31x20.png"); |
2536 | + private ImageIcon englishIcon = Data.getInstance().getIcon( |
2537 | + "english_31x20_0.png"); |
2538 | + private ImageIcon englishRolloverIcon = Data.getInstance().getIcon( |
2539 | + "english_31x20.png"); |
2540 | + private String currentLang; |
2541 | + |
2542 | + /* |
2543 | + * Links and LinkGroup |
2544 | + */ |
2545 | + private LinkGroup languageGrp = new LinkGroup(); |
2546 | + private HLink germanHLnk = new HLink(germanStrng, germanIcon, |
2547 | + germanRolloverIcon, languageGrp); |
2548 | + private HLink englishHLnk = new HLink(englishStrng, englishIcon, |
2549 | + englishRolloverIcon, languageGrp); |
2550 | + |
2551 | + /** |
2552 | + * Returns the selected language. |
2553 | + * |
2554 | + * @return |
2555 | + */ |
2556 | + public String getSelectedLanguage() { |
2557 | + if (languageGrp.getSelectedLinkText().contains( |
2558 | + Data.getInstance().getLocaleStr("popup.language.german"))) |
2559 | + return "de"; |
2560 | + else |
2561 | + return "en"; |
2562 | + } |
2563 | + |
2564 | + /** |
2565 | + * Constructor |
2566 | + * |
2567 | + * @param parent |
2568 | + * @param titleText |
2569 | + */ |
2570 | + public LanguagePopupWindow(Window parent, String titleText) { |
2571 | + super(parent); |
2572 | + |
2573 | + setLayout(new BorderLayout()); |
2574 | + |
2575 | + setUndecorated(true); |
2576 | + |
2577 | + setModal(true); |
2578 | + |
2579 | + JTextArea textTitle = GUITools.newPopupTitleArea(titleText); |
2580 | + |
2581 | + panelBase.add(textTitle, BorderLayout.NORTH); |
2582 | + |
2583 | + try { |
2584 | + currentLang = appData.getSetting(AppSettingKey.APP_LANGUAGE); |
2585 | + } catch (DataException e) { |
2586 | + currentLang = null; |
2587 | + } |
2588 | + languageGrp.addLink(germanHLnk); |
2589 | + languageGrp.addLink(englishHLnk); |
2590 | + |
2591 | + if (currentLang.equals("de")) |
2592 | + languageGrp.selectLink(germanHLnk); |
2593 | + else if (currentLang.equals("en")) |
2594 | + languageGrp.selectLink(englishHLnk); |
2595 | + |
2596 | + GUITools.addComponent(inputPnl, gbl, germanHLnk, 0, 0, 1, 1, 1.0, 1.0, |
2597 | + 10, 10, 0, 10, GridBagConstraints.BOTH, |
2598 | + GridBagConstraints.CENTER); |
2599 | + GUITools.addComponent(inputPnl, gbl, englishHLnk, 0, 1, 1, 1, 1.0, 1.0, |
2600 | + 10, 10, 10, 10, GridBagConstraints.BOTH, |
2601 | + GridBagConstraints.CENTER); |
2602 | + |
2603 | + panelBase.add(inputPnl, BorderLayout.CENTER); |
2604 | + |
2605 | + /* |
2606 | + * The buttons to abort and confirm the input |
2607 | + */ |
2608 | + JButton buttonAbort = GUITools.newImageButton(); |
2609 | + buttonAbort.setIcon(Data.getInstance().getIcon( |
2610 | + "buttonCancel_24x24_0.png")); |
2611 | + buttonAbort.setRolloverIcon(Data.getInstance().getIcon( |
2612 | + "buttonCancel_24x24.png")); |
2613 | + buttonAbort.setToolTipText(Data.getInstance().getLocaleStr("abort")); |
2614 | + buttonAbort.addActionListener(new LanguagePopupWindowAction(this, |
2615 | + ButtonClicked.ABORT)); |
2616 | + |
2617 | + JButton buttonConfirm = GUITools.newImageButton(); |
2618 | + buttonConfirm.setIcon(Data.getInstance() |
2619 | + .getIcon("buttonOk_24x24_0.png")); |
2620 | + buttonConfirm.setRolloverIcon(Data.getInstance().getIcon( |
2621 | + "buttonOk_24x24.png")); |
2622 | + buttonConfirm |
2623 | + .setToolTipText(Data.getInstance().getLocaleStr("confirm")); |
2624 | + buttonConfirm.addActionListener(new LanguagePopupWindowAction(this, |
2625 | + ButtonClicked.OK)); |
2626 | + |
2627 | + JPanel panelButtons = new JPanel(new BorderLayout()); |
2628 | + panelButtons.setBackground(UI.POPUP_BACKGROUND); |
2629 | + panelButtons.setBorder(BorderFactory.createLineBorder(panelButtons |
2630 | + .getBackground(), 3)); |
2631 | + panelButtons.add(buttonAbort, BorderLayout.WEST); |
2632 | + panelButtons.add(buttonConfirm, BorderLayout.EAST); |
2633 | + |
2634 | + /* |
2635 | + * Base panel |
2636 | + */ |
2637 | + panelBase.add(panelButtons, BorderLayout.SOUTH); |
2638 | + |
2639 | + add(panelBase, BorderLayout.CENTER); |
2640 | + |
2641 | + /* |
2642 | + * Set size and location |
2643 | + */ |
2644 | + Dimension popupSize = new Dimension(130, 170); |
2645 | + |
2646 | + setMinimumSize(popupSize); |
2647 | + setSize(popupSize); |
2648 | + setPreferredSize(popupSize); |
2649 | + |
2650 | + pack(); |
2651 | + |
2652 | + setAlwaysOnTop(true); |
2653 | + toFront(); |
2654 | + |
2655 | + GUITools.setLocationToCursorPos(this); |
2656 | + } |
2657 | + |
2658 | + /** |
2659 | + * Gets the button clicked. |
2660 | + * |
2661 | + * @return the buttonClicked |
2662 | + */ |
2663 | + public ButtonClicked getButtonClicked() { |
2664 | + return buttonClicked; |
2665 | + } |
2666 | + |
2667 | + /** |
2668 | + * Sets the button clicked. |
2669 | + * |
2670 | + * @param buttonClicked |
2671 | + * the buttonClicked to set |
2672 | + */ |
2673 | + public void setButtonClicked(ButtonClicked buttonClicked) { |
2674 | + this.buttonClicked = buttonClicked; |
2675 | + } |
2676 | + |
2677 | +} |
2678 | |
2679 | === added file 'src/org/revager/gui/dialogs/assistant/OpenReviewPanel.java' |
2680 | --- src/org/revager/gui/dialogs/assistant/OpenReviewPanel.java 1970-01-01 00:00:00 +0000 |
2681 | +++ src/org/revager/gui/dialogs/assistant/OpenReviewPanel.java 2010-05-26 20:44:25 +0000 |
2682 | @@ -0,0 +1,310 @@ |
2683 | +/* |
2684 | + * Copyright 2009 Davide Casciato, Sandra Reich, Johannes Wettinger |
2685 | + * |
2686 | + * This file is part of Resi. |
2687 | + * |
2688 | + * Resi is free software: you can redistribute it and/or modify |
2689 | + * it under the terms of the GNU General Public License as published by |
2690 | + * the Free Software Foundation, either version 3 of the License, or |
2691 | + * (at your option) any later version. |
2692 | + * |
2693 | + * Resi is distributed in the hope that it will be useful, |
2694 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2695 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2696 | + * GNU General Public License for more details. |
2697 | + * |
2698 | + * You should have received a copy of the GNU General Public License |
2699 | + * along with Resi. If not, see <http://www.gnu.org/licenses/>. |
2700 | + */ |
2701 | +package org.revager.gui.dialogs.assistant; |
2702 | + |
2703 | +import java.awt.Font; |
2704 | +import java.awt.GridBagConstraints; |
2705 | +import java.awt.GridBagLayout; |
2706 | +import java.awt.event.ActionEvent; |
2707 | +import java.awt.event.ActionListener; |
2708 | +import java.io.File; |
2709 | +import java.util.List; |
2710 | +import java.util.Vector; |
2711 | + |
2712 | +import javax.swing.ImageIcon; |
2713 | +import javax.swing.JLabel; |
2714 | +import javax.swing.JOptionPane; |
2715 | +import javax.swing.JSeparator; |
2716 | +import javax.swing.SwingConstants; |
2717 | + |
2718 | +import org.revager.app.ResiFileFilter; |
2719 | +import org.revager.app.model.Data; |
2720 | +import org.revager.app.model.DataException; |
2721 | +import org.revager.gui.AbstractDialog; |
2722 | +import org.revager.gui.AbstractDialogPanel; |
2723 | +import org.revager.gui.UI; |
2724 | +import org.revager.gui.helpers.FileChooser; |
2725 | +import org.revager.gui.helpers.HLink; |
2726 | +import org.revager.gui.helpers.LinkGroup; |
2727 | +import org.revager.gui.workers.LoadReviewWorker; |
2728 | +import org.revager.tools.GUITools; |
2729 | + |
2730 | +/** |
2731 | + * The class OpenReviewPanel. |
2732 | + * |
2733 | + * @author D.Casciato |
2734 | + * |
2735 | + */ |
2736 | +@SuppressWarnings("serial") |
2737 | +public class OpenReviewPanel extends AbstractDialogPanel{ |
2738 | + |
2739 | + private GridBagLayout gbl2 = new GridBagLayout(); |
2740 | + |
2741 | + |
2742 | + /* |
2743 | + * Strings |
2744 | + */ |
2745 | + private String moderatorStrng = Data.getInstance().getLocaleStr( |
2746 | + "mode.moderator"); |
2747 | + private String scribeStrng = Data.getInstance().getLocaleStr( |
2748 | + "mode.scribeOrSingle"); |
2749 | + private String anotherRevStrng = Data.getInstance().getLocaleStr( |
2750 | + "assistantDialog.selectAnotherRev"); |
2751 | + private String noRevsStrng = Data.getInstance().getLocaleStr( |
2752 | + "assistantDialog.noRevs");; |
2753 | + private String firstRevStrng; |
2754 | + private String secondRevStrng; |
2755 | + private String thirdRevStrng; |
2756 | + private String fourthRevStrng; |
2757 | + |
2758 | + /* |
2759 | + * ImageIcons |
2760 | + */ |
2761 | + private ImageIcon smallModeratorIcon = Data.getInstance().getIcon( |
2762 | + "moderator_50x50_0.png"); |
2763 | + private ImageIcon smallModeratorRolloverIcon = Data.getInstance().getIcon( |
2764 | + "moderator_50x50.png"); |
2765 | + private ImageIcon scribeIcon = Data.getInstance().getIcon( |
2766 | + "scribe_50x50_0.png"); |
2767 | + private ImageIcon scribeRolloverIcon = Data.getInstance().getIcon( |
2768 | + "scribe_50x50.png"); |
2769 | + private ImageIcon reviewIcon = Data.getInstance().getIcon( |
2770 | + "review_40x40_0.png"); |
2771 | + private ImageIcon reviewRolloverIcon = Data.getInstance().getIcon( |
2772 | + "review_40x40.png"); |
2773 | + private ImageIcon browseIcon = Data.getInstance().getIcon( |
2774 | + "open_40x40_0.png"); |
2775 | + private ImageIcon browseRolloverIcon = Data.getInstance().getIcon( |
2776 | + "open_40x40.png"); |
2777 | + |
2778 | + /* |
2779 | + * links and LinkGroups |
2780 | + */ |
2781 | + private LinkGroup modeGrp = new LinkGroup(); |
2782 | + private HLink moderatorLnk = new HLink(moderatorStrng, smallModeratorIcon, |
2783 | + smallModeratorRolloverIcon, modeGrp); |
2784 | + private HLink scribeSingleRevLnk = new HLink(scribeStrng, scribeIcon, |
2785 | + scribeRolloverIcon, modeGrp); |
2786 | + |
2787 | + private LinkGroup lastRevsGrp = new LinkGroup(); |
2788 | + private HLink firstReviewLnk; |
2789 | + private HLink secondReviewLnk; |
2790 | + private HLink thirdReviewLnk; |
2791 | + private HLink fourthReviewLnk; |
2792 | + private HLink anotherReviewLnk; |
2793 | + |
2794 | + /* |
2795 | + * Others |
2796 | + */ |
2797 | + private JLabel noRevsLbl = new JLabel(noRevsStrng); |
2798 | + |
2799 | + private Vector<String> lastRevsVector = getLastReviews(); |
2800 | + |
2801 | + /** |
2802 | + * Action to open an existing review. |
2803 | + */ |
2804 | + public ActionListener openExistRev = new ActionListener() { |
2805 | + |
2806 | + @Override |
2807 | + public void actionPerformed(ActionEvent e) { |
2808 | + |
2809 | + try { |
2810 | + List<String> lastRevs = Data.getInstance().getAppData() |
2811 | + .getLastReviews(); |
2812 | + int index = lastRevsGrp.getSelectedLinkIndex(); |
2813 | + String revPath = lastRevs.get(index); |
2814 | + new LoadReviewWorker(revPath).execute(); |
2815 | + } catch (DataException e1) { |
2816 | + // TODO Auto-generated catch block |
2817 | + e1.printStackTrace(); |
2818 | + } |
2819 | + |
2820 | + } |
2821 | + |
2822 | + }; |
2823 | + |
2824 | + /** |
2825 | + * Action to open another review. |
2826 | + */ |
2827 | + private ActionListener openAnotherRev = new ActionListener() { |
2828 | + |
2829 | + @Override |
2830 | + public void actionPerformed(ActionEvent arg0) { |
2831 | + FileChooser fileChooser = UI.getInstance().getFileChooser(); |
2832 | + |
2833 | + if (fileChooser.showDialog(UI.getInstance().getAssistantDialog(), |
2834 | + FileChooser.MODE_OPEN_FILE, ResiFileFilter.TYPE_REVIEW) == FileChooser.SELECTED_APPROVE) { |
2835 | + String reviewPath = fileChooser.getFile().getAbsolutePath(); |
2836 | + new LoadReviewWorker(reviewPath).execute(); |
2837 | + } |
2838 | + } |
2839 | + }; |
2840 | + |
2841 | + /** |
2842 | + * Returns the group of the recent reviews. |
2843 | + * @return |
2844 | + */ |
2845 | + public LinkGroup getLastRevsGrp() { |
2846 | + return lastRevsGrp; |
2847 | + } |
2848 | + |
2849 | + /** |
2850 | + * Returns the vector of the recent reviews. |
2851 | + * @return |
2852 | + */ |
2853 | + public Vector<String> getLastRevsVector() { |
2854 | + return lastRevsVector; |
2855 | + } |
2856 | + |
2857 | + /** |
2858 | + * Constructor |
2859 | + * |
2860 | + * @param parent |
2861 | + */ |
2862 | + public OpenReviewPanel(AbstractDialog parent) { |
2863 | + super(parent); |
2864 | + createOpenReviewPnl(); |
2865 | + } |
2866 | + |
2867 | + /** |
2868 | + * Method which creates and locates the component of this panel. |
2869 | + */ |
2870 | + private void createOpenReviewPnl() { |
2871 | + |
2872 | + this.setLayout(gbl2); |
2873 | + |
2874 | + moderatorLnk.addActionListener(new ActionListener() { |
2875 | + |
2876 | + @Override |
2877 | + public void actionPerformed(ActionEvent e) { |
2878 | + UI.getInstance().getAssistantDialog().setLocalMode("moderator"); |
2879 | + Data.getInstance().setMode("moderator"); |
2880 | + } |
2881 | + }); |
2882 | + |
2883 | + scribeSingleRevLnk.addActionListener(new ActionListener() { |
2884 | + |
2885 | + @Override |
2886 | + public void actionPerformed(ActionEvent e) { |
2887 | + UI.getInstance().getAssistantDialog().setLocalMode("scribe"); |
2888 | + Data.getInstance().setMode("scribe"); |
2889 | + } |
2890 | + }); |
2891 | + |
2892 | + modeGrp.addLink(moderatorLnk); |
2893 | + modeGrp.addLink(scribeSingleRevLnk); |
2894 | + modeGrp.selectLink(moderatorLnk); |
2895 | + |
2896 | + GUITools.addComponent(this, gbl2, moderatorLnk, 0, 0, 1, 1, |
2897 | + 0.5, 0.0, 0, 20, 0, 20, GridBagConstraints.HORIZONTAL, |
2898 | + GridBagConstraints.NORTHWEST); |
2899 | + GUITools.addComponent(this, gbl2, scribeSingleRevLnk, 0, 1, |
2900 | + 1, 2, 0.5, 0.0, 20, 20, 0, 20, GridBagConstraints.HORIZONTAL, |
2901 | + GridBagConstraints.NORTHWEST); |
2902 | + GUITools.addComponent(this, gbl2, new JSeparator( |
2903 | + SwingConstants.VERTICAL), 1, 0, 1, 6, 0.0, 1.0, 0, 0, 0, 0, |
2904 | + GridBagConstraints.VERTICAL, GridBagConstraints.NORTHWEST); |
2905 | + |
2906 | + try { |
2907 | + firstRevStrng = lastRevsVector.get(0); |
2908 | + firstReviewLnk = new HLink(firstRevStrng, reviewIcon, |
2909 | + reviewRolloverIcon, lastRevsGrp); |
2910 | + lastRevsGrp.addLink(firstReviewLnk); |
2911 | + lastRevsGrp.selectLink(firstReviewLnk); |
2912 | + GUITools.addComponent(this, gbl2, firstReviewLnk, 2, 0, |
2913 | + 1, 1, 1.0, 0.0, 0, 40, 0, 0, GridBagConstraints.HORIZONTAL, |
2914 | + GridBagConstraints.NORTHWEST); |
2915 | + |
2916 | + } catch (Exception e) { |
2917 | + noRevsLbl.setFont(new Font(Font.SANS_SERIF, Font.ITALIC, 12)); |
2918 | + GUITools.addComponent(this, gbl2, noRevsLbl, 2, 0, 1, 1, |
2919 | + 1.0, 0.0, 15, 80, 0, 0, GridBagConstraints.HORIZONTAL, |
2920 | + GridBagConstraints.NORTHWEST); |
2921 | + } |
2922 | + try { |
2923 | + secondRevStrng = lastRevsVector.get(1); |
2924 | + secondReviewLnk = new HLink(secondRevStrng, reviewIcon, |
2925 | + reviewRolloverIcon, lastRevsGrp); |
2926 | + lastRevsGrp.addLink(secondReviewLnk); |
2927 | + GUITools.addComponent(this, gbl2, secondReviewLnk, 2, 1, |
2928 | + 1, 1, 1.0, 0.0, 0, 40, 0, 0, GridBagConstraints.HORIZONTAL, |
2929 | + GridBagConstraints.NORTHWEST); |
2930 | + |
2931 | + } catch (Exception e) { |
2932 | + |
2933 | + } |
2934 | + try { |
2935 | + thirdRevStrng = lastRevsVector.get(2); |
2936 | + thirdReviewLnk = new HLink(thirdRevStrng, reviewIcon, |
2937 | + reviewRolloverIcon, lastRevsGrp); |
2938 | + lastRevsGrp.addLink(thirdReviewLnk); |
2939 | + GUITools.addComponent(this, gbl2, thirdReviewLnk, 2, 2, |
2940 | + 1, 1, 1.0, 0.0, 0, 40, 0, 0, GridBagConstraints.HORIZONTAL, |
2941 | + GridBagConstraints.NORTHWEST); |
2942 | + |
2943 | + } catch (Exception e) { |
2944 | + |
2945 | + } |
2946 | + |
2947 | + try { |
2948 | + fourthRevStrng = lastRevsVector.get(3); |
2949 | + fourthReviewLnk = new HLink(fourthRevStrng, reviewIcon, |
2950 | + reviewRolloverIcon, lastRevsGrp); |
2951 | + lastRevsGrp.addLink(fourthReviewLnk); |
2952 | + GUITools |
2953 | + .addComponent(this, gbl2, fourthReviewLnk, 2, 3, |
2954 | + 1, 1, 1.0, 0.0, 0, 40, 0, 0, |
2955 | + GridBagConstraints.HORIZONTAL, |
2956 | + GridBagConstraints.NORTHWEST); |
2957 | + |
2958 | + } catch (Exception e) { |
2959 | + |
2960 | + } |
2961 | + anotherReviewLnk = new HLink(anotherRevStrng, browseIcon, |
2962 | + browseRolloverIcon, null); |
2963 | + anotherReviewLnk.setUnderlined(true); |
2964 | + anotherReviewLnk.addActionListener(openAnotherRev); |
2965 | + GUITools.addComponent(this, gbl2, anotherReviewLnk, 2, 4, 1, |
2966 | + 1, 1.0, 1.0, 30, 40, 0, 0, GridBagConstraints.HORIZONTAL, |
2967 | + GridBagConstraints.SOUTHWEST); |
2968 | + |
2969 | + } |
2970 | + |
2971 | + /** |
2972 | + * Gets the last reviews. |
2973 | + * |
2974 | + * @return the last reviews |
2975 | + */ |
2976 | + private Vector<String> getLastReviews() { |
2977 | + Vector<String> vecLastReviews = new Vector<String>(); |
2978 | + |
2979 | + try { |
2980 | + for (String rev : Data.getInstance().getAppData().getLastReviews()) { |
2981 | + vecLastReviews.add(new File(rev).getName()); |
2982 | + } |
2983 | + } catch (DataException exc) { |
2984 | + JOptionPane.showMessageDialog(null, GUITools.getMessagePane(exc |
2985 | + .getMessage()), Data.getInstance().getLocaleStr("error"), |
2986 | + JOptionPane.ERROR_MESSAGE); |
2987 | + } |
2988 | + |
2989 | + return vecLastReviews; |
2990 | + } |
2991 | + |
2992 | +} |
2993 | |
2994 | === added file 'src/org/revager/gui/helpers/HLink.java' |
2995 | --- src/org/revager/gui/helpers/HLink.java 1970-01-01 00:00:00 +0000 |
2996 | +++ src/org/revager/gui/helpers/HLink.java 2010-05-26 20:44:25 +0000 |
2997 | @@ -0,0 +1,526 @@ |
2998 | +/* |
2999 | + * Copyright 2009 Davide Casciato, Sandra Reich, Johannes Wettinger |
3000 | + * |
3001 | + * This file is part of Resi. |
3002 | + * |
3003 | + * Resi is free software: you can redistribute it and/or modify |
3004 | + * it under the terms of the GNU General Public License as published by |
3005 | + * the Free Software Foundation, either version 3 of the License, or |
3006 | + * (at your option) any later version. |
3007 | + * |
3008 | + * Resi is distributed in the hope that it will be useful, |
3009 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3010 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3011 | + * GNU General Public License for more details. |
3012 | + * |
3013 | + * You should have received a copy of the GNU General Public License |
3014 | + * along with Resi. If not, see <http://www.gnu.org/licenses/>. |
3015 | + */ |
3016 | +package org.revager.gui.helpers; |
3017 | + |
3018 | +import java.awt.Color; |
3019 | +import java.awt.Cursor; |
3020 | +import java.awt.Dimension; |
3021 | +import java.awt.Font; |
3022 | +import java.awt.GridBagConstraints; |
3023 | +import java.awt.GridBagLayout; |
3024 | +import java.awt.event.ActionListener; |
3025 | +import java.awt.event.MouseEvent; |
3026 | +import java.awt.event.MouseListener; |
3027 | + |
3028 | +import javax.swing.ImageIcon; |
3029 | +import javax.swing.JButton; |
3030 | +import javax.swing.JLabel; |
3031 | +import javax.swing.JPanel; |
3032 | + |
3033 | +import org.revager.gui.AbstractDialogPanel; |
3034 | +import org.revager.tools.GUITools; |
3035 | + |
3036 | +/** |
3037 | + * The class HLink. |
3038 | + * |
3039 | + * @author D.Casciato |
3040 | + * |
3041 | + */ |
3042 | +@SuppressWarnings("serial") |
3043 | +public class HLink extends JPanel { |
3044 | + |
3045 | + private String localTextStrng; |
3046 | + private JLabel localLbl; |
3047 | + private ImageIcon localIcon; |
3048 | + private ImageIcon localSelIcon; |
3049 | + private ImageIcon localDisIcon; |
3050 | + private ImageIcon localRolloverIcon; |
3051 | + private JButton localBttn; |
3052 | + private GridBagLayout gbl = new GridBagLayout(); |
3053 | + private Font localFont = new Font(Font.DIALOG, Font.PLAIN, 11); |
3054 | + private JPanel localPnl = this; |
3055 | + private ActionListener localAction = null; |
3056 | + private LinkGroup localGroup; |
3057 | + private Boolean selected = false; |
3058 | + private AbstractDialogPanel father = null; |
3059 | + private String rollOverText = ""; |
3060 | + |
3061 | + /** |
3062 | + * Returns the father of the component. Father means the same as parent. |
3063 | + * |
3064 | + * @return |
3065 | + */ |
3066 | + public AbstractDialogPanel getFather() { |
3067 | + return father; |
3068 | + } |
3069 | + |
3070 | + /** |
3071 | + * Sets the father of the component. |
3072 | + * |
3073 | + * @return |
3074 | + */ |
3075 | + public void setFather(AbstractDialogPanel parent) { |
3076 | + this.father = parent; |
3077 | + } |
3078 | + |
3079 | + /** |
3080 | + * Returns if the link is selected or not. Important when using the link as |
3081 | + * RadioButton. |
3082 | + * |
3083 | + * @return |
3084 | + */ |
3085 | + public Boolean getSelected() { |
3086 | + return selected; |
3087 | + } |
3088 | + |
3089 | + /** |
3090 | + * Listener which selects the link by mouse click. |
3091 | + */ |
3092 | + private MouseListener selectionListener = new MouseListener() { |
3093 | + |
3094 | + @Override |
3095 | + public void mouseClicked(MouseEvent e) { |
3096 | + if (localGroup != null) |
3097 | + localGroup.deselectAllLinks(); |
3098 | + if (!selected) |
3099 | + selected = true; |
3100 | + } |
3101 | + |
3102 | + @Override |
3103 | + public void mouseEntered(MouseEvent e) { |
3104 | + // TODO Auto-generated method stub |
3105 | + |
3106 | + } |
3107 | + |
3108 | + @Override |
3109 | + public void mouseExited(MouseEvent e) { |
3110 | + // TODO Auto-generated method stub |
3111 | + |
3112 | + } |
3113 | + |
3114 | + @Override |
3115 | + public void mousePressed(MouseEvent e) { |
3116 | + // TODO Auto-generated method stub |
3117 | + |
3118 | + } |
3119 | + |
3120 | + @Override |
3121 | + public void mouseReleased(MouseEvent e) { |
3122 | + // TODO Auto-generated method stub |
3123 | + |
3124 | + }; |
3125 | + }; |
3126 | + |
3127 | + /** |
3128 | + * Listener which changes the design of the link depending on the use of the |
3129 | + * link. If a group exists the link is used as radio button. Else it's used |
3130 | + * only as link. |
3131 | + */ |
3132 | + private MouseListener localListener = new MouseListener() { |
3133 | + |
3134 | + @Override |
3135 | + public void mouseClicked(MouseEvent e) { |
3136 | + if (localGroup == null) { |
3137 | + localLbl.setForeground(Color.BLUE); |
3138 | + localBttn.setSelected(true); |
3139 | + setCursor(new Cursor(Cursor.HAND_CURSOR)); |
3140 | + // setBold(true); |
3141 | + } else { |
3142 | + localGroup.resetAllLinks(); |
3143 | + localBttn.setIcon(localSelIcon); |
3144 | + localBttn.setRolloverIcon(localSelIcon); |
3145 | + localLbl.setForeground(Color.BLUE); |
3146 | + setCursor(new Cursor(Cursor.HAND_CURSOR)); |
3147 | + setSelected(true); |
3148 | + // setBold(true); |
3149 | + } |
3150 | + |
3151 | + } |
3152 | + |
3153 | + @Override |
3154 | + public void mouseEntered(MouseEvent e) { |
3155 | + if (localGroup == null) { |
3156 | + localLbl.setForeground(Color.BLUE); |
3157 | + localBttn.setSelected(true); |
3158 | + setCursor(new Cursor(Cursor.HAND_CURSOR)); |
3159 | + // setBold(true); |
3160 | + } else { |
3161 | + setCursor(new Cursor(Cursor.HAND_CURSOR)); |
3162 | + setUnderlined(true); |
3163 | + } |
3164 | + } |
3165 | + |
3166 | + @Override |
3167 | + public void mouseExited(MouseEvent e) { |
3168 | + if (localGroup == null) { |
3169 | + localLbl.setForeground(Color.BLACK); |
3170 | + localBttn.setSelected(false); |
3171 | + setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); |
3172 | + // setBold(false); |
3173 | + } else { |
3174 | + setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); |
3175 | + setUnderlined(false); |
3176 | + } |
3177 | + } |
3178 | + |
3179 | + @Override |
3180 | + public void mousePressed(MouseEvent e) { |
3181 | + // TODO Auto-generated method stub |
3182 | + |
3183 | + } |
3184 | + |
3185 | + @Override |
3186 | + public void mouseReleased(MouseEvent e) { |
3187 | + // TODO Auto-generated method stub |
3188 | + |
3189 | + } |
3190 | + }; |
3191 | + |
3192 | + /** |
3193 | + * Returns the icon of the non-selected state. |
3194 | + * |
3195 | + * @return |
3196 | + */ |
3197 | + public ImageIcon getLocalDisIcon() { |
3198 | + return localDisIcon; |
3199 | + } |
3200 | + |
3201 | + /** |
3202 | + * Sets the icon of the non-selected state. |
3203 | + * |
3204 | + * @return |
3205 | + */ |
3206 | + public void setLocalDisIcon(ImageIcon localDisIcon) { |
3207 | + this.localDisIcon = localDisIcon; |
3208 | + } |
3209 | + |
3210 | + /** |
3211 | + * Returns the button of the link which contains the icon. |
3212 | + * |
3213 | + * @return |
3214 | + */ |
3215 | + public JButton getLocalBttn() { |
3216 | + return localBttn; |
3217 | + } |
3218 | + |
3219 | + /** |
3220 | + * Sets the text of the link. |
3221 | + * |
3222 | + * @param localTextStrng |
3223 | + */ |
3224 | + public void setLocalTextStrng(String localTextStrng) { |
3225 | + this.localTextStrng = localTextStrng; |
3226 | + } |
3227 | + |
3228 | + /** |
3229 | + * Sets the icon of the link. |
3230 | + * |
3231 | + * @param localIcon |
3232 | + */ |
3233 | + public void setLocalIcon(ImageIcon localIcon) { |
3234 | + this.localIcon = localIcon; |
3235 | + localBttn.setIcon(localIcon); |
3236 | + } |
3237 | + |
3238 | + /** |
3239 | + * Sets the rollover icon of the link. |
3240 | + * |
3241 | + * @param localRolloverIcon |
3242 | + */ |
3243 | + public void setLocalRolloverIcon(ImageIcon localRolloverIcon) { |
3244 | + this.localRolloverIcon = localRolloverIcon; |
3245 | + localBttn.setRolloverIcon(localRolloverIcon); |
3246 | + } |
3247 | + |
3248 | + /** |
3249 | + * Returns the icon of the link. |
3250 | + * |
3251 | + * @return |
3252 | + */ |
3253 | + public ImageIcon getLocalIcon() { |
3254 | + return localIcon; |
3255 | + } |
3256 | + |
3257 | + /** |
3258 | + * Returns the rollover icon of the link. |
3259 | + * |
3260 | + * @return |
3261 | + */ |
3262 | + public ImageIcon getLocalRolloverIcon() { |
3263 | + return localRolloverIcon; |
3264 | + } |
3265 | + |
3266 | + /** |
3267 | + * Sets the text underlined if isUnderlined is true. |
3268 | + * |
3269 | + * @param isUnderlined |
3270 | + */ |
3271 | + public void setUnderlined(Boolean isUnderlined) { |
3272 | + if (isUnderlined) |
3273 | + localLbl.setText("<html><u>" + localTextStrng + "</u></html>"); |
3274 | + else |
3275 | + localLbl.setText("<html>" + localTextStrng + "</html>"); |
3276 | + } |
3277 | + |
3278 | + /** |
3279 | + * Sets the text italic if isItalic is true. |
3280 | + * |
3281 | + * @param isItalic |
3282 | + */ |
3283 | + public void setItalic(Boolean isItalic) { |
3284 | + if (isItalic) |
3285 | + localFont = new Font(Font.DIALOG, Font.ITALIC, 11); |
3286 | + else |
3287 | + localFont = new Font(Font.DIALOG, Font.PLAIN, 11); |
3288 | + |
3289 | + } |
3290 | + |
3291 | + /** |
3292 | + * Sets the text bold if isBold is true. |
3293 | + * |
3294 | + * @param isBold |
3295 | + */ |
3296 | + public void setBold(Boolean isBold) { |
3297 | + if (isBold) { |
3298 | + localFont = new Font(Font.DIALOG, Font.BOLD, 11); |
3299 | + localLbl.setFont(localFont); |
3300 | + localLbl.validate(); |
3301 | + localLbl.repaint(); |
3302 | + this.validate(); |
3303 | + this.repaint(); |
3304 | + } else { |
3305 | + localFont = new Font(Font.DIALOG, Font.PLAIN, 11); |
3306 | + localLbl.setFont(localFont); |
3307 | + localLbl.validate(); |
3308 | + localLbl.repaint(); |
3309 | + this.validate(); |
3310 | + this.repaint(); |
3311 | + |
3312 | + } |
3313 | + } |
3314 | + |
3315 | + /** |
3316 | + * Sets the color of the text. |
3317 | + * |
3318 | + * @param color |
3319 | + */ |
3320 | + public void setColor(Color color) { |
3321 | + localLbl.setForeground(color); |
3322 | + } |
3323 | + |
3324 | + /** |
3325 | + * Constructor |
3326 | + * |
3327 | + * @param text |
3328 | + * @param icon |
3329 | + * @param rolloverIcon |
3330 | + */ |
3331 | + public HLink(String text, ImageIcon icon, ImageIcon rolloverIcon, |
3332 | + LinkGroup group) { |
3333 | + super(); |
3334 | + this.setLayout(gbl); |
3335 | + this.localGroup = group; |
3336 | + localIcon = icon; |
3337 | + localRolloverIcon = rolloverIcon; |
3338 | + localSelIcon = rolloverIcon; |
3339 | + localDisIcon = icon; |
3340 | + if (group == null) |
3341 | + localBttn = GUITools.newImageButton(localIcon, localRolloverIcon); |
3342 | + else |
3343 | + localBttn = GUITools.newImageButton(localIcon, localIcon); |
3344 | + |
3345 | + localTextStrng = text; |
3346 | + localLbl = new JLabel("<html>" + localTextStrng + "</html>"); |
3347 | + |
3348 | + this.addMouseListener(localListener); |
3349 | + localLbl.addMouseListener(localListener); |
3350 | + localBttn.addMouseListener(localListener); |
3351 | + localBttn.addMouseListener(selectionListener); |
3352 | + localLbl.addMouseListener(selectionListener); |
3353 | + |
3354 | + GUITools.addComponent(localPnl, gbl, localBttn, 0, 0, 1, 1, 0.0, 1.0, |
3355 | + 0, 0, 0, 0, GridBagConstraints.BOTH, |
3356 | + GridBagConstraints.NORTHWEST); |
3357 | + GUITools |
3358 | + .addComponent(localPnl, gbl, localLbl, 1, 0, 1, 1, 1.0, 1.0, 0, |
3359 | + 5, 0, 0, GridBagConstraints.BOTH, |
3360 | + GridBagConstraints.NORTHWEST); |
3361 | + |
3362 | + Dimension size = new Dimension(10, 50); |
3363 | + setMinimumSize(size); |
3364 | + setPreferredSize(size); |
3365 | + } |
3366 | + |
3367 | + /** |
3368 | + * Method for adding an action to the links subcomponents. |
3369 | + * |
3370 | + * @param action |
3371 | + */ |
3372 | + public void addActionListener(ActionListener action) { |
3373 | + localAction = action; |
3374 | + localBttn.addMouseListener(new MouseListener() { |
3375 | + |
3376 | + @Override |
3377 | + public void mouseClicked(MouseEvent e) { |
3378 | + localAction.actionPerformed(null); |
3379 | + } |
3380 | + |
3381 | + @Override |
3382 | + public void mouseEntered(MouseEvent e) { |
3383 | + // TODO Auto-generated method stub |
3384 | + |
3385 | + } |
3386 | + |
3387 | + @Override |
3388 | + public void mouseExited(MouseEvent e) { |
3389 | + // TODO Auto-generated method stub |
3390 | + |
3391 | + } |
3392 | + |
3393 | + @Override |
3394 | + public void mousePressed(MouseEvent e) { |
3395 | + // TODO Auto-generated method stub |
3396 | + |
3397 | + } |
3398 | + |
3399 | + @Override |
3400 | + public void mouseReleased(MouseEvent e) { |
3401 | + // TODO Auto-generated method stub |
3402 | + |
3403 | + } |
3404 | + }); |
3405 | + localLbl.addMouseListener(new MouseListener() { |
3406 | + |
3407 | + @Override |
3408 | + public void mouseClicked(MouseEvent e) { |
3409 | + localAction.actionPerformed(null); |
3410 | + |
3411 | + } |
3412 | + |
3413 | + @Override |
3414 | + public void mouseEntered(MouseEvent e) { |
3415 | + // TODO Auto-generated method stub |
3416 | + |
3417 | + } |
3418 | + |
3419 | + @Override |
3420 | + public void mouseExited(MouseEvent e) { |
3421 | + // TODO Auto-generated method stub |
3422 | + |
3423 | + } |
3424 | + |
3425 | + @Override |
3426 | + public void mousePressed(MouseEvent e) { |
3427 | + // TODO Auto-generated method stub |
3428 | + |
3429 | + } |
3430 | + |
3431 | + @Override |
3432 | + public void mouseReleased(MouseEvent e) { |
3433 | + // TODO Auto-generated method stub |
3434 | + |
3435 | + } |
3436 | + }); |
3437 | + } |
3438 | + |
3439 | + /** |
3440 | + * Sets the link selected or not. |
3441 | + * |
3442 | + * @param b |
3443 | + */ |
3444 | + public void setSelected(boolean b) { |
3445 | + selected = b; |
3446 | + } |
3447 | + |
3448 | + /** |
3449 | + * Returns the selection icon of the link. |
3450 | + * |
3451 | + * @return |
3452 | + */ |
3453 | + public ImageIcon getLocalSelIcon() { |
3454 | + // TODO Auto-generated method stub |
3455 | + return localSelIcon; |
3456 | + } |
3457 | + |
3458 | + /** |
3459 | + * Method which adds the rollover text for the messages in AbstractDialog |
3460 | + * extended classes. |
3461 | + * |
3462 | + * @param rolloverText |
3463 | + */ |
3464 | + public void addRolloverText(String rolloverText) { |
3465 | + if (father != null) { |
3466 | + this.rollOverText = rolloverText; |
3467 | + localLbl.removeMouseListener(rolloverListener); |
3468 | + localBttn.removeMouseListener(rolloverListener); |
3469 | + |
3470 | + localLbl.addMouseListener(rolloverListener); |
3471 | + localBttn.addMouseListener(rolloverListener); |
3472 | + } |
3473 | + } |
3474 | + |
3475 | + /** |
3476 | + * Listener which sets the message of the father component. |
3477 | + */ |
3478 | + private MouseListener rolloverListener = new MouseListener() { |
3479 | + |
3480 | + @Override |
3481 | + public void mouseClicked(MouseEvent e) { |
3482 | + // TODO Auto-generated method stub |
3483 | + |
3484 | + } |
3485 | + |
3486 | + @Override |
3487 | + public void mouseEntered(MouseEvent e) { |
3488 | + if (father != null) |
3489 | + father.setHint(rollOverText); |
3490 | + |
3491 | + } |
3492 | + |
3493 | + @Override |
3494 | + public void mouseExited(MouseEvent e) { |
3495 | + if (father != null) |
3496 | + father.setHint(null); |
3497 | + |
3498 | + } |
3499 | + |
3500 | + @Override |
3501 | + public void mousePressed(MouseEvent e) { |
3502 | + // TODO Auto-generated method stub |
3503 | + |
3504 | + } |
3505 | + |
3506 | + @Override |
3507 | + public void mouseReleased(MouseEvent e) { |
3508 | + // TODO Auto-generated method stub |
3509 | + |
3510 | + } |
3511 | + }; |
3512 | + |
3513 | + /** |
3514 | + * Returns the label of the link. |
3515 | + * |
3516 | + * @return |
3517 | + */ |
3518 | + public JLabel getLocalLbl() { |
3519 | + // TODO Auto-generated method stub |
3520 | + return localLbl; |
3521 | + } |
3522 | + |
3523 | +} |
3524 | \ No newline at end of file |
3525 | |
3526 | === added file 'src/org/revager/gui/helpers/LinkGroup.java' |
3527 | --- src/org/revager/gui/helpers/LinkGroup.java 1970-01-01 00:00:00 +0000 |
3528 | +++ src/org/revager/gui/helpers/LinkGroup.java 2010-05-26 20:44:25 +0000 |
3529 | @@ -0,0 +1,113 @@ |
3530 | +/* |
3531 | + * Copyright 2009 Davide Casciato, Sandra Reich, Johannes Wettinger |
3532 | + * |
3533 | + * This file is part of Resi. |
3534 | + * |
3535 | + * Resi is free software: you can redistribute it and/or modify |
3536 | + * it under the terms of the GNU General Public License as published by |
3537 | + * the Free Software Foundation, either version 3 of the License, or |
3538 | + * (at your option) any later version. |
3539 | + * |
3540 | + * Resi is distributed in the hope that it will be useful, |
3541 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3542 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3543 | + * GNU General Public License for more details. |
3544 | + * |
3545 | + * You should have received a copy of the GNU General Public License |
3546 | + * along with Resi. If not, see <http://www.gnu.org/licenses/>. |
3547 | + */ |
3548 | +package org.revager.gui.helpers; |
3549 | + |
3550 | +import java.awt.Color; |
3551 | +import java.util.ArrayList; |
3552 | +import java.util.List; |
3553 | +/** |
3554 | + * The class LinkGroup. |
3555 | + * |
3556 | + * @author D.Casciato |
3557 | + * |
3558 | + */ |
3559 | +public class LinkGroup { |
3560 | + |
3561 | + private List<HLink> hLinksList = new ArrayList<HLink>(); |
3562 | + |
3563 | + /** |
3564 | + * Method which adds an Link to the LinkGroup. |
3565 | + * @param link |
3566 | + */ |
3567 | + public void addLink(HLink link) { |
3568 | + hLinksList.add(link); |
3569 | + link.setLocalRolloverIcon(link.getLocalIcon()); |
3570 | + } |
3571 | + |
3572 | + /** |
3573 | + * Method which resets the look of the links. |
3574 | + */ |
3575 | + public void resetAllLinks() { |
3576 | + for (HLink link : hLinksList) { |
3577 | + //link.setBold(false); |
3578 | + link.setColor(Color.BLACK); |
3579 | + link.setLocalRolloverIcon(link.getLocalDisIcon()); |
3580 | + link.setLocalIcon(link.getLocalDisIcon()); |
3581 | + |
3582 | + } |
3583 | + } |
3584 | + |
3585 | + /** |
3586 | + * Method which selects the given link in the LinkGroup. |
3587 | + * |
3588 | + * @param selLink |
3589 | + */ |
3590 | + public void selectLink(HLink selLink) { |
3591 | + for (HLink link : hLinksList) { |
3592 | + if (link == selLink) { |
3593 | + //link.setBold(true); |
3594 | + link.setColor(Color.BLUE); |
3595 | + link.setLocalRolloverIcon(link.getLocalSelIcon()); |
3596 | + link.setLocalIcon(link.getLocalSelIcon()); |
3597 | + link.setSelected(true); |
3598 | + } else { |
3599 | + //link.setBold(false); |
3600 | + link.setColor(Color.BLACK); |
3601 | + link.setLocalRolloverIcon(link.getLocalDisIcon()); |
3602 | + link.setLocalIcon(link.getLocalDisIcon()); |
3603 | + link.setSelected(false); |
3604 | + } |
3605 | + } |
3606 | + } |
3607 | + |
3608 | + /** |
3609 | + * Returns the text of the selected Link. |
3610 | + * @return |
3611 | + */ |
3612 | + public String getSelectedLinkText() { |
3613 | + for (HLink link : hLinksList) { |
3614 | + if (link.getSelected()) |
3615 | + return link.getLocalLbl().getText(); |
3616 | + } |
3617 | + return null; |
3618 | + } |
3619 | + |
3620 | + /** |
3621 | + * Returns the index of the selected Link. |
3622 | + * @return |
3623 | + */ |
3624 | + public int getSelectedLinkIndex() { |
3625 | + for (int index = 0; index < hLinksList.size(); index++) { |
3626 | + if (hLinksList.get(index).getSelected()) |
3627 | + return index; |
3628 | + } |
3629 | + return -1; |
3630 | + } |
3631 | + |
3632 | + /** |
3633 | + * Method which deselects all Links. |
3634 | + */ |
3635 | + public void deselectAllLinks() { |
3636 | + for (HLink link : hLinksList) { |
3637 | + link.setSelected(false); |
3638 | + } |
3639 | + |
3640 | + } |
3641 | + |
3642 | +} |
3643 | |
3644 | === added file 'src/org/revager/gui/helpers/VLink.java' |
3645 | --- src/org/revager/gui/helpers/VLink.java 1970-01-01 00:00:00 +0000 |
3646 | +++ src/org/revager/gui/helpers/VLink.java 2010-05-26 20:44:25 +0000 |
3647 | @@ -0,0 +1,359 @@ |
3648 | +/* |
3649 | + * Copyright 2009 Davide Casciato, Sandra Reich, Johannes Wettinger |
3650 | + * |
3651 | + * This file is part of Resi. |
3652 | + * |
3653 | + * Resi is free software: you can redistribute it and/or modify |
3654 | + * it under the terms of the GNU General Public License as published by |
3655 | + * the Free Software Foundation, either version 3 of the License, or |
3656 | + * (at your option) any later version. |
3657 | + * |
3658 | + * Resi is distributed in the hope that it will be useful, |
3659 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
3660 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3661 | + * GNU General Public License for more details. |
3662 | + * |
3663 | + * You should have received a copy of the GNU General Public License |
3664 | + * along with Resi. If not, see <http://www.gnu.org/licenses/>. |
3665 | + */ |
3666 | +package org.revager.gui.helpers; |
3667 | + |
3668 | +import java.awt.Color; |
3669 | +import java.awt.Cursor; |
3670 | +import java.awt.Dimension; |
3671 | +import java.awt.Font; |
3672 | +import java.awt.GridBagConstraints; |
3673 | +import java.awt.GridBagLayout; |
3674 | +import java.awt.event.ActionListener; |
3675 | +import java.awt.event.MouseEvent; |
3676 | +import java.awt.event.MouseListener; |
3677 | + |
3678 | +import javax.swing.ImageIcon; |
3679 | +import javax.swing.JButton; |
3680 | +import javax.swing.JLabel; |
3681 | +import javax.swing.JPanel; |
3682 | + |
3683 | +import org.revager.gui.AbstractDialogPanel; |
3684 | +import org.revager.tools.GUITools; |
3685 | + |
3686 | +/** |
3687 | + * The class VLink. Temporarily not usable as radiobutton. |
3688 | + * |
3689 | + * @author D.Casciato |
3690 | + * |
3691 | + */ |
3692 | +@SuppressWarnings("serial") |
3693 | +public class VLink extends JPanel { |
3694 | + |
3695 | + private String localTextStrng; |
3696 | + private JLabel localLbl; |
3697 | + private ImageIcon localIcon; |
3698 | + private ImageIcon localRolloverIcon; |
3699 | + private JButton localBttn; |
3700 | + private GridBagLayout gbl = new GridBagLayout(); |
3701 | + private Font localFont = new Font(Font.DIALOG, Font.PLAIN, 12); |
3702 | + private Font boldFont = new Font(Font.DIALOG, Font.BOLD, 12); |
3703 | + private JPanel localPnl = this; |
3704 | + private ActionListener localAction = null; |
3705 | + private AbstractDialogPanel father = null; |
3706 | + private String rollOverText = ""; |
3707 | + |
3708 | + /** |
3709 | + * Returns the father of the component. Father means the same as parent. |
3710 | + * |
3711 | + * @return |
3712 | + */ |
3713 | + public AbstractDialogPanel getFather() { |
3714 | + return father; |
3715 | + } |
3716 | + |
3717 | + /** |
3718 | + * Sets the father of the component. |
3719 | + * |
3720 | + * @return |
3721 | + */ |
3722 | + public void setFather(AbstractDialogPanel parent) { |
3723 | + this.father = parent; |
3724 | + } |
3725 | + |
3726 | + /** |
3727 | + * Listener for the rollover effect. |
3728 | + */ |
3729 | + private MouseListener localListener = new MouseListener() { |
3730 | + |
3731 | + @Override |
3732 | + public void mouseClicked(MouseEvent e) { |
3733 | + localLbl.setForeground(Color.BLACK); |
3734 | + localBttn.setSelected(false); |
3735 | + setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); |
3736 | +// setBold(false); |
3737 | + } |
3738 | + |
3739 | + @Override |
3740 | + public void mouseEntered(MouseEvent e) { |
3741 | + localLbl.setForeground(Color.BLUE); |
3742 | + localBttn.setSelected(true); |
3743 | + setCursor(new Cursor(Cursor.HAND_CURSOR)); |
3744 | +// setBold(true); |
3745 | + localLbl.revalidate(); |
3746 | + } |
3747 | + |
3748 | + @Override |
3749 | + public void mouseExited(MouseEvent e) { |
3750 | + localLbl.setForeground(Color.BLACK); |
3751 | + localBttn.setSelected(false); |
3752 | + setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); |
3753 | +// setBold(false); |
3754 | + } |
3755 | + |
3756 | + @Override |
3757 | + public void mousePressed(MouseEvent e) { |
3758 | + // TODO Auto-generated method stub |
3759 | + |
3760 | + } |
3761 | + |
3762 | + @Override |
3763 | + public void mouseReleased(MouseEvent e) { |
3764 | + // TODO Auto-generated method stub |
3765 | + |
3766 | + } |
3767 | + }; |
3768 | + |
3769 | + /** |
3770 | + * Sets the text of the link. |
3771 | + * |
3772 | + * @param localTextStrng |
3773 | + */ |
3774 | + public void setLocalTextStrng(String localTextStrng) { |
3775 | + this.localTextStrng = localTextStrng; |
3776 | + } |
3777 | + |
3778 | + /** |
3779 | + * Sets the icon of the link. |
3780 | + * |
3781 | + * @param localIcon |
3782 | + */ |
3783 | + public void setLocalIcon(ImageIcon localIcon) { |
3784 | + this.localIcon = localIcon; |
3785 | + } |
3786 | + |
3787 | + /** |
3788 | + * Sets the rollover icon of the link. |
3789 | + * |
3790 | + * @param localRolloverIcon |
3791 | + */ |
3792 | + public void setLocalRolloverIcon(ImageIcon localRolloverIcon) { |
3793 | + this.localRolloverIcon = localRolloverIcon; |
3794 | + } |
3795 | + |
3796 | + /** |
3797 | + * Sets the link underlined if isUnderlined is true. |
3798 | + * |
3799 | + * @param isUnderlined |
3800 | + */ |
3801 | + public void setUnderlined(Boolean isUnderlined) { |
3802 | + if (isUnderlined) |
3803 | + localLbl.setText("<html><U>" + localTextStrng + "</html>"); |
3804 | + else |
3805 | + localLbl.setText(localTextStrng); |
3806 | + } |
3807 | + |
3808 | + /** |
3809 | + * Sets the text italic if isItalic is true. Else the text will be plain. |
3810 | + * |
3811 | + * @param isItalic |
3812 | + */ |
3813 | + public void setItalic(Boolean isItalic) { |
3814 | + if (isItalic) |
3815 | + localFont = new Font(Font.DIALOG, Font.ITALIC, 12); |
3816 | + else |
3817 | + localFont = new Font(Font.DIALOG, Font.PLAIN, 12); |
3818 | + |
3819 | + } |
3820 | + |
3821 | + /** |
3822 | + * Sets the text bold if isBold is true. |
3823 | + * |
3824 | + * @param isBold |
3825 | + */ |
3826 | + public void setBold(Boolean isBold) { |
3827 | + if (isBold) { |
3828 | + localFont = new Font(Font.DIALOG, Font.BOLD, 12); |
3829 | + localLbl.setFont(localFont); |
3830 | + this.validate(); |
3831 | + localLbl.repaint(); |
3832 | + } else { |
3833 | + localFont = new Font(Font.DIALOG, Font.PLAIN, 12); |
3834 | + localLbl.setFont(localFont); |
3835 | + this.validate(); |
3836 | + localLbl.repaint(); |
3837 | + } |
3838 | + } |
3839 | + |
3840 | + /** |
3841 | + * Sets the color of the text. |
3842 | + * |
3843 | + * @param color |
3844 | + */ |
3845 | + public void setColor(Color color) { |
3846 | + localLbl.setForeground(color); |
3847 | + } |
3848 | + |
3849 | + /** |
3850 | + * Constructor |
3851 | + * |
3852 | + * @param text |
3853 | + * @param icon |
3854 | + * @param rolloverIcon |
3855 | + */ |
3856 | + public VLink(String text, ImageIcon icon, ImageIcon rolloverIcon) { |
3857 | + super(); |
3858 | + this.setLayout(gbl); |
3859 | + localIcon = icon; |
3860 | + localRolloverIcon = rolloverIcon; |
3861 | + localBttn = GUITools.newImageButton(localIcon, localRolloverIcon); |
3862 | + localTextStrng = text; |
3863 | + localLbl = new JLabel("<html><U>" + localTextStrng + "</html>"); |
3864 | + localLbl.setFont(boldFont); |
3865 | + Dimension prefSize = localLbl.getPreferredSize(); |
3866 | + localLbl.setFont(localFont); |
3867 | + localLbl.setMinimumSize(prefSize); |
3868 | + |
3869 | + this.addMouseListener(localListener); |
3870 | + localLbl.addMouseListener(localListener); |
3871 | + localBttn.addMouseListener(localListener); |
3872 | + |
3873 | + GUITools.addComponent(localPnl, gbl, localBttn, 0, 0, 1, 1, 0.0, 0.0, |
3874 | + 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.NORTH); |
3875 | + GUITools.addComponent(localPnl, gbl, localLbl, 0, 1, 1, 1, 0.0, 0.0, 5, |
3876 | + 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.NORTH); |
3877 | + |
3878 | + } |
3879 | + |
3880 | + /** |
3881 | + * Method for adding an action to the links subcomponents. |
3882 | + * |
3883 | + * @param action |
3884 | + */ |
3885 | + public void addActionListener(ActionListener action) { |
3886 | + localAction = action; |
3887 | + localBttn.addMouseListener(new MouseListener() { |
3888 | + |
3889 | + @Override |
3890 | + public void mouseClicked(MouseEvent e) { |
3891 | + localAction.actionPerformed(null); |
3892 | + } |
3893 | + |
3894 | + @Override |
3895 | + public void mouseEntered(MouseEvent e) { |
3896 | + // TODO Auto-generated method stub |
3897 | + |
3898 | + } |
3899 | + |
3900 | + @Override |
3901 | + public void mouseExited(MouseEvent e) { |
3902 | + // TODO Auto-generated method stub |
3903 | + |
3904 | + } |
3905 | + |
3906 | + @Override |
3907 | + public void mousePressed(MouseEvent e) { |
3908 | + // TODO Auto-generated method stub |
3909 | + |
3910 | + } |
3911 | + |
3912 | + @Override |
3913 | + public void mouseReleased(MouseEvent e) { |
3914 | + // TODO Auto-generated method stub |
3915 | + |
3916 | + } |
3917 | + }); |
3918 | + localLbl.addMouseListener(new MouseListener() { |
3919 | + |
3920 | + @Override |
3921 | + public void mouseClicked(MouseEvent e) { |
3922 | + localAction.actionPerformed(null); |
3923 | + } |
3924 | + |
3925 | + @Override |
3926 | + public void mouseEntered(MouseEvent e) { |
3927 | + // TODO Auto-generated method stub |
3928 | + |
3929 | + } |
3930 | + |
3931 | + @Override |
3932 | + public void mouseExited(MouseEvent e) { |
3933 | + // TODO Auto-generated method stub |
3934 | + |
3935 | + } |
3936 | + |
3937 | + @Override |
3938 | + public void mousePressed(MouseEvent e) { |
3939 | + // TODO Auto-generated method stub |
3940 | + |
3941 | + } |
3942 | + |
3943 | + @Override |
3944 | + public void mouseReleased(MouseEvent e) { |
3945 | + // TODO Auto-generated method stub |
3946 | + |
3947 | + } |
3948 | + }); |
3949 | + } |
3950 | + |
3951 | + /** |
3952 | + * Method which adds the rollover text for the messages in AbstractDialog |
3953 | + * extended classes. |
3954 | + * |
3955 | + * @param rolloverText |
3956 | + */ |
3957 | + public void addRolloverText(String rolloverText) { |
3958 | + if (father != null) { |
3959 | + this.rollOverText = rolloverText; |
3960 | + this.removeMouseListener(rolloverListener); |
3961 | + localLbl.removeMouseListener(rolloverListener); |
3962 | + localBttn.removeMouseListener(rolloverListener); |
3963 | + this.addMouseListener(rolloverListener); |
3964 | + localLbl.addMouseListener(rolloverListener); |
3965 | + localBttn.addMouseListener(rolloverListener); |
3966 | + } |
3967 | + } |
3968 | + |
3969 | + /** |
3970 | + * Listener which sets the message of the father component. |
3971 | + */ |
3972 | + private MouseListener rolloverListener = new MouseListener() { |
3973 | + |
3974 | + @Override |
3975 | + public void mouseClicked(MouseEvent e) { |
3976 | + // TODO Auto-generated method stub |
3977 | + |
3978 | + } |
3979 | + |
3980 | + @Override |
3981 | + public void mouseEntered(MouseEvent e) { |
3982 | + if (father != null) |
3983 | + father.setHint(rollOverText); |
3984 | + |
3985 | + } |
3986 | + |
3987 | + @Override |
3988 | + public void mouseExited(MouseEvent e) { |
3989 | + if (father != null) |
3990 | + father.setHint(null); |
3991 | + } |
3992 | + |
3993 | + @Override |
3994 | + public void mousePressed(MouseEvent e) { |
3995 | + // TODO Auto-generated method stub |
3996 | + |
3997 | + } |
3998 | + |
3999 | + @Override |
4000 | + public void mouseReleased(MouseEvent e) { |
4001 | + // TODO Auto-generated method stub |
4002 | + |
4003 | + } |
4004 | + }; |
4005 | + |
4006 | +} |
4007 | |
4008 | === added file 'src/org/revager/gui/icons/aspectsManager_25x25.png' |
4009 | Binary files src/org/revager/gui/icons/aspectsManager_25x25.png 1970-01-01 00:00:00 +0000 and src/org/revager/gui/icons/aspectsManager_25x25.png 2010-05-26 20:44:25 +0000 differ |
4010 | === added file 'src/org/revager/gui/icons/aspectsManager_25x25_0.png' |
4011 | Binary files src/org/revager/gui/icons/aspectsManager_25x25_0.png 1970-01-01 00:00:00 +0000 and src/org/revager/gui/icons/aspectsManager_25x25_0.png 2010-05-26 20:44:25 +0000 differ |
4012 | === added file 'src/org/revager/gui/icons/english_31x20.png' |
4013 | Binary files src/org/revager/gui/icons/english_31x20.png 1970-01-01 00:00:00 +0000 and src/org/revager/gui/icons/english_31x20.png 2010-05-26 20:44:25 +0000 differ |
4014 | === added file 'src/org/revager/gui/icons/english_31x20_0.png' |
4015 | Binary files src/org/revager/gui/icons/english_31x20_0.png 1970-01-01 00:00:00 +0000 and src/org/revager/gui/icons/english_31x20_0.png 2010-05-26 20:44:25 +0000 differ |
4016 | === added file 'src/org/revager/gui/icons/german_31x20.png' |
4017 | Binary files src/org/revager/gui/icons/german_31x20.png 1970-01-01 00:00:00 +0000 and src/org/revager/gui/icons/german_31x20.png 2010-05-26 20:44:25 +0000 differ |
4018 | === added file 'src/org/revager/gui/icons/german_31x20_0.png' |
4019 | Binary files src/org/revager/gui/icons/german_31x20_0.png 1970-01-01 00:00:00 +0000 and src/org/revager/gui/icons/german_31x20_0.png 2010-05-26 20:44:25 +0000 differ |
4020 | === modified file 'src/org/revager/gui/icons/instantReview_128x128_0.png' |
4021 | Binary files src/org/revager/gui/icons/instantReview_128x128_0.png 2009-11-21 03:26:57 +0000 and src/org/revager/gui/icons/instantReview_128x128_0.png 2010-05-26 20:44:25 +0000 differ |
4022 | === added file 'src/org/revager/gui/icons/language_31x20.png' |
4023 | Binary files src/org/revager/gui/icons/language_31x20.png 1970-01-01 00:00:00 +0000 and src/org/revager/gui/icons/language_31x20.png 2010-05-26 20:44:25 +0000 differ |
4024 | === added file 'src/org/revager/gui/icons/language_31x20_0.png' |
4025 | Binary files src/org/revager/gui/icons/language_31x20_0.png 1970-01-01 00:00:00 +0000 and src/org/revager/gui/icons/language_31x20_0.png 2010-05-26 20:44:25 +0000 differ |
4026 | === modified file 'src/org/revager/gui/icons/moderator_128x128_0.png' |
4027 | Binary files src/org/revager/gui/icons/moderator_128x128_0.png 2009-11-21 03:26:57 +0000 and src/org/revager/gui/icons/moderator_128x128_0.png 2010-05-26 20:44:25 +0000 differ |
4028 | === added file 'src/org/revager/gui/icons/moderator_50x50.png' |
4029 | Binary files src/org/revager/gui/icons/moderator_50x50.png 1970-01-01 00:00:00 +0000 and src/org/revager/gui/icons/moderator_50x50.png 2010-05-26 20:44:25 +0000 differ |
4030 | === added file 'src/org/revager/gui/icons/moderator_50x50_0.png' |
4031 | Binary files src/org/revager/gui/icons/moderator_50x50_0.png 1970-01-01 00:00:00 +0000 and src/org/revager/gui/icons/moderator_50x50_0.png 2010-05-26 20:44:25 +0000 differ |
4032 | === added file 'src/org/revager/gui/icons/openBttn_16x16.png' |
4033 | Binary files src/org/revager/gui/icons/openBttn_16x16.png 1970-01-01 00:00:00 +0000 and src/org/revager/gui/icons/openBttn_16x16.png 2010-05-26 20:44:25 +0000 differ |
4034 | === added file 'src/org/revager/gui/icons/open_40x40.png' |
4035 | Binary files src/org/revager/gui/icons/open_40x40.png 1970-01-01 00:00:00 +0000 and src/org/revager/gui/icons/open_40x40.png 2010-05-26 20:44:25 +0000 differ |
4036 | === added file 'src/org/revager/gui/icons/open_40x40_0.png' |
4037 | Binary files src/org/revager/gui/icons/open_40x40_0.png 1970-01-01 00:00:00 +0000 and src/org/revager/gui/icons/open_40x40_0.png 2010-05-26 20:44:25 +0000 differ |
4038 | === added file 'src/org/revager/gui/icons/revager_50x50.png' |
4039 | Binary files src/org/revager/gui/icons/revager_50x50.png 1970-01-01 00:00:00 +0000 and src/org/revager/gui/icons/revager_50x50.png 2010-05-26 20:44:25 +0000 differ |
4040 | === added file 'src/org/revager/gui/icons/review_40x40.png' |
4041 | Binary files src/org/revager/gui/icons/review_40x40.png 1970-01-01 00:00:00 +0000 and src/org/revager/gui/icons/review_40x40.png 2010-05-26 20:44:25 +0000 differ |
4042 | === added file 'src/org/revager/gui/icons/review_40x40_0.png' |
4043 | Binary files src/org/revager/gui/icons/review_40x40_0.png 1970-01-01 00:00:00 +0000 and src/org/revager/gui/icons/review_40x40_0.png 2010-05-26 20:44:25 +0000 differ |
4044 | === modified file 'src/org/revager/gui/icons/scribe_128x128_0.png' |
4045 | Binary files src/org/revager/gui/icons/scribe_128x128_0.png 2009-11-21 03:26:57 +0000 and src/org/revager/gui/icons/scribe_128x128_0.png 2010-05-26 20:44:25 +0000 differ |
4046 | === added file 'src/org/revager/gui/icons/scribe_50x50.png' |
4047 | Binary files src/org/revager/gui/icons/scribe_50x50.png 1970-01-01 00:00:00 +0000 and src/org/revager/gui/icons/scribe_50x50.png 2010-05-26 20:44:25 +0000 differ |
4048 | === added file 'src/org/revager/gui/icons/scribe_50x50_0.png' |
4049 | Binary files src/org/revager/gui/icons/scribe_50x50_0.png 1970-01-01 00:00:00 +0000 and src/org/revager/gui/icons/scribe_50x50_0.png 2010-05-26 20:44:25 +0000 differ |
4050 | === modified file 'src/org/revager/gui/models/StrengthTableModel.java' |
4051 | --- src/org/revager/gui/models/StrengthTableModel.java 2010-01-31 17:32:35 +0000 |
4052 | +++ src/org/revager/gui/models/StrengthTableModel.java 2010-05-26 20:44:25 +0000 |
4053 | @@ -22,7 +22,6 @@ |
4054 | |
4055 | import org.revager.gui.UI; |
4056 | |
4057 | - |
4058 | /** |
4059 | * The Class StrengthTableModel. |
4060 | */ |
4061 | @@ -46,10 +45,7 @@ |
4062 | */ |
4063 | @Override |
4064 | public int getRowCount() { |
4065 | - if(UI.getInstance().getAttendeeDialog().isVisible()) |
4066 | - return UI.getInstance().getAttendeeDialog().getStrengthList().size(); |
4067 | - else |
4068 | - return UI.getInstance().getAssistantDialog().getStrengthList().size(); |
4069 | + return UI.getInstance().getAttendeeDialog().getStrengthList().size(); |
4070 | } |
4071 | |
4072 | /* |
4073 | @@ -59,11 +55,8 @@ |
4074 | */ |
4075 | @Override |
4076 | public Object getValueAt(int rowIndex, int columnIndex) { |
4077 | - if(UI.getInstance().getAttendeeDialog().isVisible()) |
4078 | - return UI.getInstance().getAttendeeDialog().getStrengthList().get(rowIndex); |
4079 | - else |
4080 | - return UI.getInstance().getAssistantDialog().getStrengthList().get(rowIndex); |
4081 | - |
4082 | + return UI.getInstance().getAttendeeDialog().getStrengthList().get( |
4083 | + rowIndex); |
4084 | } |
4085 | |
4086 | /* |
4087 | @@ -73,17 +66,10 @@ |
4088 | * int, int) |
4089 | */ |
4090 | public void setValueAt(Object insertion, int row, int column) { |
4091 | - if(UI.getInstance().getAttendeeDialog().isVisible()){ |
4092 | - UI.getInstance().getAttendeeDialog().getStrengthList().set(row, |
4093 | - (String) insertion); |
4094 | - |
4095 | - }else{ |
4096 | - UI.getInstance().getAssistantDialog().getStrengthList().set(row, |
4097 | - (String) insertion); |
4098 | - |
4099 | - } |
4100 | + UI.getInstance().getAttendeeDialog().getStrengthList().set(row, |
4101 | + (String) insertion); |
4102 | + |
4103 | fireTableDataChanged(); |
4104 | - |
4105 | } |
4106 | |
4107 | /* |
4108 | |
4109 | === modified file 'src/org/revager/resources/localeStrings_de.properties' |
4110 | --- src/org/revager/resources/localeStrings_de.properties 2010-01-31 17:32:35 +0000 |
4111 | +++ src/org/revager/resources/localeStrings_de.properties 2010-05-26 20:44:25 +0000 |
4112 | @@ -27,6 +27,7 @@ |
4113 | mode.moderator=Moderator |
4114 | mode.scribe=Notar |
4115 | mode.instant=Sofortiges Review |
4116 | +mode.scribeOrSingle=Notar oder Single Reviewer |
4117 | |
4118 | |
4119 | |
4120 | @@ -166,14 +167,26 @@ |
4121 | ## Assistant Dialog ## |
4122 | ###################### |
4123 | assistantDialog.title=RevAger Assistent |
4124 | +assistantDialog.openDesc=Sie können einen Modus und Review aus den jeweiligen Listen wählen. Hierzu selektieren Sie einfach die gewünschten Links. Sofern Ihr gewünschtes Review nicht in der Liste vorhanden ist können Sie es über "Ein anderes Review wählen..." öffnen. |
4125 | +assistantDialog.firstDesc=Willkomen in RevAger! |
4126 | +assistantDialog.quickRev.rollover=Wählen Sie diese Option um sofort selbst in der Rolle des Einzelreviewers mit einem Review zu beginnen. Ideal für schnelle Webseiten-, Code oder sogar Autoinspektionen. |
4127 | +assistantDialog.newRev.rollover=Wählen Sie diese Option um ein neues Review als Moderator zu organisieren. |
4128 | +assistantDialog.openRev.rollover=Wählen Sie diese Option um ein existierendes Review zu öffnen. |
4129 | +assistantDialog.selectLanguage.rollover=Wählen Sie diese Option um die Applikations-Sprache zu ändern. |
4130 | +assistantDialog.openAspectsMngr.rollover=Wählen Sie diese Option um Fragencataloge und Prüfaspekte im Prüfaspekte-Manager zu verwalten. |
4131 | assistantDialog.selectReviewDescription=Sie können ein gespeichertes Review laden oder ein neues Review anlegen. |
4132 | assistantDialog.selectModeDescription=Bitte wählen Sie den Modus aus, in dem Sie arbeiten möchten. |
4133 | assistantDialog.selectReview=Review-Datei |
4134 | assistantDialog.lastReviews=Letzte Reviews |
4135 | assistantDialog.manageCatalogs=Fragenkataloge verwalten |
4136 | assistantDialog.browseToolTip=Review aus Verzeichnis wählen |
4137 | - |
4138 | - |
4139 | +assistantDialog.newReview=Neues Review anlegen |
4140 | +assistantDialog.quickstart=Sofortiges Review |
4141 | +assistantDialog.openReview=Bestehendes Review öffnen |
4142 | +assistantDialog.selectLanguage=Sprache wählen |
4143 | +assistantDialog.aspectsManager=Prüfaspekte-Manager öffnen |
4144 | +assistantDialog.selectAnotherRev=Ein anderes Review wählen... |
4145 | +assistantDialog.noRevs=Keine Reviews vorhanden |
4146 | |
4147 | ##################### |
4148 | ## Settings Dialog ## |
4149 | @@ -613,6 +626,8 @@ |
4150 | popup.editAspect.description=Beschreibung: |
4151 | popup.editAspect.askForCategoryName=Bitte geben Sie eine Bezeichnung für die Kategorie ein. |
4152 | |
4153 | +popup.language.german=Deutsch |
4154 | +popup.language.english=English |
4155 | |
4156 | |
4157 | ############## |
4158 | |
4159 | === modified file 'src/org/revager/resources/localeStrings_en.properties' |
4160 | --- src/org/revager/resources/localeStrings_en.properties 2010-01-31 17:32:35 +0000 |
4161 | +++ src/org/revager/resources/localeStrings_en.properties 2010-05-26 20:44:25 +0000 |
4162 | @@ -26,6 +26,7 @@ |
4163 | mode.moderator=Moderator |
4164 | mode.scribe=Scribe |
4165 | mode.instant=Instant Review |
4166 | +mode.scribeOrSingle=Scribe or Single Reviewer |
4167 | |
4168 | |
4169 | |
4170 | @@ -165,12 +166,26 @@ |
4171 | ## Assistant Dialog ## |
4172 | ###################### |
4173 | assistantDialog.title=RevAger assistant |
4174 | +assistantDialog.openDesc=You can select a mode and review from the respective link lists. To do this, simply select the desired links. If your desired review does not exist in these list, you can load it by using the "Select another review..."-link. |
4175 | +assistantDialog.firstDesc=Welcome to RevAger! |
4176 | +assistantDialog.quickRev.rollover=Choose this if you want to start a Review immediately, with you as the single Reviewer. Ideal for quick website, Code or even car inspections. |
4177 | +assistantDialog.newRev.rollover=Choose this if you want to organize a Review as moderator. |
4178 | +assistantDialog.openRev.rollover=Choose this if you want to open an existing Review. |
4179 | +assistantDialog.selectLanguage.rollover=Choose this if you want to change the application language. |
4180 | +assistantDialog.openAspectsMngr.rollover=Choose this if you want to manage catalogs and aspects in the aspects-manager. |
4181 | assistantDialog.selectReviewDescription=In this window you are able to load a saved review or create a new one. Also you can manage the catalogs you want to work with. |
4182 | assistantDialog.selectModeDescription=Please choose one mode you want to work in. |
4183 | assistantDialog.selectReview=Review file |
4184 | assistantDialog.lastReviews=Last reviews |
4185 | assistantDialog.manageCatalogs=Manage catalogs |
4186 | assistantDialog.browseToolTip=Choose review from directory |
4187 | +assistantDialog.newReview=Schedule new review |
4188 | +assistantDialog.quickstart=Quickstart |
4189 | +assistantDialog.openReview=Open existing review |
4190 | +assistantDialog.selectLanguage=Select language |
4191 | +assistantDialog.aspectsManager=Open aspects manager |
4192 | +assistantDialog.selectAnotherRev=Select another review... |
4193 | +assistantDialog.noRevs=No Reviews available |
4194 | |
4195 | |
4196 | |
4197 | @@ -607,6 +622,8 @@ |
4198 | popup.editAspect.description=Description: |
4199 | popup.editAspect.askForCategoryName=Please enter a name for the category. |
4200 | |
4201 | +popup.language.german=Deutsch |
4202 | +popup.language.english=English |
4203 | |
4204 | |
4205 | ############## |
4206 | |
4207 | === modified file 'src/org/revager/tools/GUITools.java' |
4208 | --- src/org/revager/tools/GUITools.java 2010-01-31 17:32:35 +0000 |
4209 | +++ src/org/revager/tools/GUITools.java 2010-05-26 20:44:25 +0000 |
4210 | @@ -69,7 +69,6 @@ |
4211 | import org.revager.app.model.Data; |
4212 | import org.revager.gui.UI; |
4213 | |
4214 | - |
4215 | /** |
4216 | * The Class GUITools. |
4217 | */ |
4218 | @@ -683,5 +682,4 @@ |
4219 | } |
4220 | }); |
4221 | } |
4222 | - |
4223 | } |