Merge lp:~revager-developers/revager/assistant_redesign into lp:revager

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
Reviewer Review Type Date Requested Status
Team NEOS Pending
Review via email: mp+20957@code.launchpad.net

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
=== modified file '.project'
--- .project 2009-11-24 15:10:55 +0000
+++ .project 2010-05-26 20:44:25 +0000
@@ -1,17 +1,17 @@
1<?xml version="1.0" encoding="UTF-8"?>1<?xml version="1.0" encoding="UTF-8"?>
2<projectDescription>2<projectDescription>
3 <name>RevAger</name>3 <name>assistant_redesign</name>
4 <comment></comment>4 <comment></comment>
5 <projects>5 <projects>
6 </projects>6 </projects>
7 <buildSpec>7 <buildSpec>
8 <buildCommand>8 <buildCommand>
9 <name>org.eclipse.jdt.core.javabuilder</name>9 <name>org.eclipse.jdt.core.javabuilder</name>
10 <arguments>10 <arguments>
11 </arguments>11 </arguments>
12 </buildCommand>12 </buildCommand>
13 </buildSpec>13 </buildSpec>
14 <natures>14 <natures>
15 <nature>org.eclipse.jdt.core.javanature</nature>15 <nature>org.eclipse.jdt.core.javanature</nature>
16 </natures>16 </natures>
17</projectDescription>17</projectDescription>
1818
=== modified file 'src/org/revager/app/model/ApplicationData.java'
--- src/org/revager/app/model/ApplicationData.java 2010-01-31 17:32:35 +0000
+++ src/org/revager/app/model/ApplicationData.java 2010-05-26 20:44:25 +0000
@@ -41,7 +41,6 @@
41import org.revager.app.model.appdata.AppSettingValue;41import org.revager.app.model.appdata.AppSettingValue;
42import org.revager.tools.FileTools;42import org.revager.tools.FileTools;
4343
44
45/**44/**
46 * This class is a sub-class of Data an handles the application data, internally45 * This class is a sub-class of Data an handles the application data, internally
47 * stored in a JavaDB.46 * stored in a JavaDB.
4847
=== modified file 'src/org/revager/gui/AbstractDialog.java'
--- src/org/revager/gui/AbstractDialog.java 2010-01-31 17:32:35 +0000
+++ src/org/revager/gui/AbstractDialog.java 2010-05-26 20:44:25 +0000
@@ -51,7 +51,6 @@
51import org.revager.gui.workers.LoadEmbeddedHelpWorker;51import org.revager.gui.workers.LoadEmbeddedHelpWorker;
52import org.revager.tools.GUITools;52import org.revager.tools.GUITools;
5353
54
55/**54/**
56 * This class is the superclass for all dialogs in Resi.55 * This class is the superclass for all dialogs in Resi.
57 */56 */
@@ -248,10 +247,10 @@
248 */247 */
249 public void setTopPanel(JPanel panel) {248 public void setTopPanel(JPanel panel) {
250 panel.setBackground(Color.WHITE);249 panel.setBackground(Color.WHITE);
251 250
252 panelTop.remove(panelGridTop);251 panelTop.remove(panelGridTop);
253 panelTop.add(panel, BorderLayout.CENTER);252 panelTop.add(panel, BorderLayout.CENTER);
254 253
255 panelTop.revalidate();254 panelTop.revalidate();
256 }255 }
257256
258257
=== added file 'src/org/revager/gui/AbstractDialogPanel.java'
--- src/org/revager/gui/AbstractDialogPanel.java 1970-01-01 00:00:00 +0000
+++ src/org/revager/gui/AbstractDialogPanel.java 2010-05-26 20:44:25 +0000
@@ -0,0 +1,63 @@
1/*
2 * Copyright 2009 Davide Casciato, Sandra Reich, Johannes Wettinger
3 *
4 * This file is part of Resi.
5 *
6 * Resi is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * Resi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with Resi. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20package org.revager.gui;
21
22import javax.swing.JPanel;
23
24/**
25 * This class is the superclass for the assistant panels.
26 */
27@SuppressWarnings("serial")
28public abstract class AbstractDialogPanel extends JPanel {
29
30 private AbstractDialog parent;
31
32 /**
33 * Returns the parent of this component.
34 */
35 public AbstractDialog getParent() {
36 return parent;
37 }
38
39 /**
40 * Sets the hint message in the parent.
41 *
42 * @param hintText
43 */
44 public void setHint(String hintText) {
45
46 parent.setMessage(hintText);
47
48 }
49
50 /**
51 * Constructor with it's parent as parameter
52 *
53 * @param parent
54 */
55 public AbstractDialogPanel(AbstractDialog parent) {
56
57 super();
58
59 this.parent = parent;
60
61 }
62
63}
064
=== modified file 'src/org/revager/gui/MainFrame.java'
--- src/org/revager/gui/MainFrame.java 2010-01-31 17:32:35 +0000
+++ src/org/revager/gui/MainFrame.java 2010-05-26 20:44:25 +0000
@@ -96,7 +96,7 @@
96import org.revager.gui.actions.OpenProtocolFrameAction;96import org.revager.gui.actions.OpenProtocolFrameAction;
97import org.revager.gui.actions.SaveReviewAction;97import org.revager.gui.actions.SaveReviewAction;
98import org.revager.gui.actions.SaveReviewAsAction;98import org.revager.gui.actions.SaveReviewAsAction;
99import org.revager.gui.actions.SelectModeAction;99import org.revager.gui.actions.assistant.OpenAssistantAction;
100import org.revager.gui.actions.attendee.AddAttendeeAction;100import org.revager.gui.actions.attendee.AddAttendeeAction;
101import org.revager.gui.actions.attendee.EditAttendeeAction;101import org.revager.gui.actions.attendee.EditAttendeeAction;
102import org.revager.gui.actions.attendee.RemoveAttendeeAction;102import org.revager.gui.actions.attendee.RemoveAttendeeAction;
@@ -113,7 +113,6 @@
113import org.revager.tools.GUITools;113import org.revager.tools.GUITools;
114import org.revager.tools.TreeTools;114import org.revager.tools.TreeTools;
115115
116
117/**116/**
118 * This class represents the main frame.117 * This class represents the main frame.
119 */118 */
@@ -221,7 +220,6 @@
221 private JButton commentMeeting;220 private JButton commentMeeting;
222 private JButton removeMeeting;221 private JButton removeMeeting;
223222
224
225 /*223 /*
226 * Hint items224 * Hint items
227 */225 */
@@ -605,7 +603,7 @@
605603
606 meetingsTree.getSelectionModel().setSelectionMode(604 meetingsTree.getSelectionModel().setSelectionMode(
607 TreeSelectionModel.SINGLE_TREE_SELECTION);605 TreeSelectionModel.SINGLE_TREE_SELECTION);
608 606
609 treeScrollPane = new JScrollPane(meetingsTree);607 treeScrollPane = new JScrollPane(meetingsTree);
610608
611 /*609 /*
@@ -638,7 +636,7 @@
638 "meeting.edit"));636 "meeting.edit"));
639 editMeeting.addActionListener(ActionRegistry.getInstance().get(637 editMeeting.addActionListener(ActionRegistry.getInstance().get(
640 EditMeetingAction.class.getName()));638 EditMeetingAction.class.getName()));
641 639
642 meetingButtons.add(editMeeting);640 meetingButtons.add(editMeeting);
643641
644 commentMeeting = GUITools.newImageButton();642 commentMeeting = GUITools.newImageButton();
@@ -653,21 +651,22 @@
653 meetingButtons.add(commentMeeting);651 meetingButtons.add(commentMeeting);
654652
655 editProtocol = GUITools.newImageButton();653 editProtocol = GUITools.newImageButton();
656 editProtocol.setIcon(Data.getInstance().getIcon("protocolFrame_25x25_0.png"));654 editProtocol.setIcon(Data.getInstance().getIcon(
657 editProtocol.setRolloverIcon(Data.getInstance()655 "protocolFrame_25x25_0.png"));
658 .getIcon("protocolFrame_25x25.png"));656 editProtocol.setRolloverIcon(Data.getInstance().getIcon(
657 "protocolFrame_25x25.png"));
659 editProtocol.setToolTipText(Data.getInstance().getLocaleStr(658 editProtocol.setToolTipText(Data.getInstance().getLocaleStr(
660 "mainFrame.protocolMode"));659 "mainFrame.protocolMode"));
661 editProtocol.addActionListener(ActionRegistry.getInstance().get(660 editProtocol.addActionListener(ActionRegistry.getInstance().get(
662 OpenProtocolFrameAction.class.getName()));661 OpenProtocolFrameAction.class.getName()));
663 662
664 meetingButtons.add(editProtocol);663 meetingButtons.add(editProtocol);
665 664
666 commentMeeting.setEnabled(false);665 commentMeeting.setEnabled(false);
667 editMeeting.setEnabled(false);666 editMeeting.setEnabled(false);
668 removeMeeting.setEnabled(false);667 removeMeeting.setEnabled(false);
669 editProtocol.setEnabled(false);668 editProtocol.setEnabled(false);
670 669
671 attendees = new JLabel(Data.getInstance().getLocaleStr(670 attendees = new JLabel(Data.getInstance().getLocaleStr(
672 "mainFrame.meetings.attendees"));671 "mainFrame.meetings.attendees"));
673 attendees.setBorder(labelBorder);672 attendees.setBorder(labelBorder);
@@ -964,7 +963,7 @@
964 tbShowAssistant.setToolTipText(Data.getInstance().getLocaleStr(963 tbShowAssistant.setToolTipText(Data.getInstance().getLocaleStr(
965 "menu.showAssistant"));964 "menu.showAssistant"));
966 tbShowAssistant.addActionListener(ActionRegistry.getInstance().get(965 tbShowAssistant.addActionListener(ActionRegistry.getInstance().get(
967 SelectModeAction.class.getName()));966 OpenAssistantAction.class.getName()));
968967
969 addTopComponent(tbShowAssistant);968 addTopComponent(tbShowAssistant);
970969
@@ -1007,11 +1006,11 @@
1007 AddAttendeeAction.class.getName()));1006 AddAttendeeAction.class.getName()));
10081007
1009 addTopComponent(tbNewAttendee);1008 addTopComponent(tbNewAttendee);
1010 1009
1011 tbNewMeeting = GUITools.newImageButton(Data.getInstance().getIcon(1010 tbNewMeeting = GUITools.newImageButton(Data.getInstance().getIcon(
1012 "addMeeting_50x50_0.png"), Data.getInstance().getIcon(1011 "addMeeting_50x50_0.png"), Data.getInstance().getIcon(
1013 "addMeeting_50x50.png"), ActionRegistry.getInstance().get(1012 "addMeeting_50x50.png"), ActionRegistry.getInstance().get(
1014 AddMeetingAction.class.getName()));1013 AddMeetingAction.class.getName()));
10151014
1016 addTopComponent(tbNewMeeting);1015 addTopComponent(tbNewMeeting);
10171016
@@ -1110,7 +1109,7 @@
1110 menuFile.setText(Data.getInstance().getLocaleStr("menu.file"));1109 menuFile.setText(Data.getInstance().getLocaleStr("menu.file"));
11111110
1112 fileSelectModeItem = new JMenuItem(ActionRegistry.getInstance().get(1111 fileSelectModeItem = new JMenuItem(ActionRegistry.getInstance().get(
1113 SelectModeAction.class.getName()));1112 OpenAssistantAction.class.getName()));
11141113
1115 menuFile.add(fileSelectModeItem);1114 menuFile.add(fileSelectModeItem);
11161115
@@ -2002,21 +2001,22 @@
2002 editAttendee.setEnabled(false);2001 editAttendee.setEnabled(false);
2003 }2002 }
20042003
2005 if(Data.getInstance().getMode().equals("instant")){2004 if (Data.getInstance().getMode().equals("instant")) {
2006 List<Meeting> meetingsList=Application.getInstance().getMeetingMgmt().getMeetings();2005 List<Meeting> meetingsList = Application.getInstance()
2007 for(Meeting meet:meetingsList){2006 .getMeetingMgmt().getMeetings();
2008 if(meet.isSetProtocol()==false && meetingsList.size()!=0){2007 for (Meeting meet : meetingsList) {
2008 if (meet.isSetProtocol() == false && meetingsList.size() != 0) {
2009 addMeeting.setEnabled(false);2009 addMeeting.setEnabled(false);
2010 tbNewMeeting.setEnabled(false);2010 tbNewMeeting.setEnabled(false);
2011 newMeetingItem.setEnabled(false);2011 newMeetingItem.setEnabled(false);
2012 }else{2012 } else {
2013 addMeeting.setEnabled(true);2013 addMeeting.setEnabled(true);
2014 tbNewMeeting.setEnabled(true);2014 tbNewMeeting.setEnabled(true);
2015 newMeetingItem.setEnabled(true);2015 newMeetingItem.setEnabled(true);
2016 }2016 }
2017 }2017 }
2018 }2018 }
2019 2019
2020 if (getSelectedMeeting() != null) {2020 if (getSelectedMeeting() != null) {
2021 commentMeeting.setEnabled(true);2021 commentMeeting.setEnabled(true);
2022 editMeeting.setEnabled(true);2022 editMeeting.setEnabled(true);
@@ -2181,7 +2181,7 @@
2181 addAttendee.setEnabled(enabled);2181 addAttendee.setEnabled(enabled);
2182 attendeesTable.setEnabled(enabled);2182 attendeesTable.setEnabled(enabled);
2183 editAspects.setEnabled(enabled);2183 editAspects.setEnabled(enabled);
2184 2184
2185 tbNewMeeting.setEnabled(enabled);2185 tbNewMeeting.setEnabled(enabled);
2186 tbNewAttendee.setEnabled(enabled);2186 tbNewAttendee.setEnabled(enabled);
2187 tbManageSeverities.setEnabled(enabled);2187 tbManageSeverities.setEnabled(enabled);
21882188
=== modified file 'src/org/revager/gui/UI.java'
--- src/org/revager/gui/UI.java 2010-01-31 17:32:35 +0000
+++ src/org/revager/gui/UI.java 2010-05-26 20:44:25 +0000
@@ -36,7 +36,7 @@
36import org.revager.app.model.Data;36import org.revager.app.model.Data;
37import org.revager.gui.aspects_manager.AspectsManagerFrame;37import org.revager.gui.aspects_manager.AspectsManagerFrame;
38import org.revager.gui.dialogs.AboutDialog;38import org.revager.gui.dialogs.AboutDialog;
39import org.revager.gui.dialogs.AssistantDialog;39import org.revager.gui.dialogs.assistant.AssistantDialog;
40import org.revager.gui.dialogs.AttendeeDialog;40import org.revager.gui.dialogs.AttendeeDialog;
41import org.revager.gui.dialogs.CSVProfilesDialog;41import org.revager.gui.dialogs.CSVProfilesDialog;
42import org.revager.gui.dialogs.CreateInvitationsDialog;42import org.revager.gui.dialogs.CreateInvitationsDialog;
4343
=== modified file 'src/org/revager/gui/actions/ActionRegistry.java'
--- src/org/revager/gui/actions/ActionRegistry.java 2010-01-31 17:32:35 +0000
+++ src/org/revager/gui/actions/ActionRegistry.java 2010-05-26 20:44:25 +0000
@@ -23,6 +23,11 @@
2323
24import javax.swing.Action;24import javax.swing.Action;
2525
26import org.revager.gui.actions.assistant.GoToAddAttPnlAction;
27import org.revager.gui.actions.assistant.GoToFirstScreenPnlAction;
28import org.revager.gui.actions.assistant.GoToOpenRevPnlAction;
29import org.revager.gui.actions.assistant.OpenAssistantAction;
30import org.revager.gui.actions.assistant.SelectLanguageAction;
26import org.revager.gui.actions.attendee.AddAttToProtAction;31import org.revager.gui.actions.attendee.AddAttToProtAction;
27import org.revager.gui.actions.attendee.AddAttendeeAction;32import org.revager.gui.actions.attendee.AddAttendeeAction;
28import org.revager.gui.actions.attendee.AddResiAttToProtAction;33import org.revager.gui.actions.attendee.AddResiAttToProtAction;
@@ -48,7 +53,6 @@
48import org.revager.gui.actions.severities.PushSeverityUpAction;53import org.revager.gui.actions.severities.PushSeverityUpAction;
49import org.revager.gui.actions.severities.RemoveSeverityAction;54import org.revager.gui.actions.severities.RemoveSeverityAction;
5055
51
52/**56/**
53 * The action registry contains all actions of this application, so they can57 * The action registry contains all actions of this application, so they can
54 * accessed easily.58 * accessed easily.
@@ -125,9 +129,9 @@
125129
126 register(new SaveReviewAsAction());130 register(new SaveReviewAsAction());
127 register(new SaveReviewAction());131 register(new SaveReviewAction());
128 register(new OpenScribeModeAction());132 register(new GoToAddAttPnlAction());
129 register(new OpenModeratorModeAction());133 register(new GoToOpenRevPnlAction());
130 register(new InitializeMainFrameAction());134 register(new InitializeNewReviewAction());
131135
132 register(new ManageSeveritiesAction());136 register(new ManageSeveritiesAction());
133 register(new EditMeetingAction());137 register(new EditMeetingAction());
@@ -154,7 +158,7 @@
154 register(new OpenAspectsManagerAction());158 register(new OpenAspectsManagerAction());
155159
156 register(new CommentMeetingAction());160 register(new CommentMeetingAction());
157 register(new SelectModeAction());161 register(new GoToFirstScreenPnlAction());
158 register(new SelectAttOutOfDirAction());162 register(new SelectAttOutOfDirAction());
159 register(new OpenProtocolFrameAction());163 register(new OpenProtocolFrameAction());
160 register(new AddResiAttToProtAction());164 register(new AddResiAttToProtAction());
@@ -164,5 +168,7 @@
164 register(new EditAttFromProtAction());168 register(new EditAttFromProtAction());
165 register(new OpenExpPDFDialogAction());169 register(new OpenExpPDFDialogAction());
166 register(new OpenExpCSVDialogAction());170 register(new OpenExpCSVDialogAction());
171 register(new SelectLanguageAction());
172 register(new OpenAssistantAction());
167 }173 }
168}174}
169175
=== renamed file 'src/org/revager/gui/actions/InitializeMainFrameAction.java' => 'src/org/revager/gui/actions/InitializeNewReviewAction.java'
--- src/org/revager/gui/actions/InitializeMainFrameAction.java 2010-01-31 17:32:35 +0000
+++ src/org/revager/gui/actions/InitializeNewReviewAction.java 2010-05-26 20:44:25 +0000
@@ -22,17 +22,18 @@
2222
23import javax.swing.AbstractAction;23import javax.swing.AbstractAction;
2424
25import org.revager.app.model.Data;
25import org.revager.gui.UI;26import org.revager.gui.UI;
26import org.revager.gui.dialogs.AssistantDialog;27import org.revager.gui.actions.attendee.ConfirmAttendeeAction;
27import org.revager.gui.workers.LoadReviewWorker;28import org.revager.gui.dialogs.AttendeeDialog;
29import org.revager.gui.dialogs.assistant.AssistantDialog;
28import org.revager.gui.workers.NewReviewWorker;30import org.revager.gui.workers.NewReviewWorker;
2931
30
31/**32/**
32 * The Class InitializeMainFrameAction.33 * The Class InitializeMainFrameAction.
33 */34 */
34@SuppressWarnings("serial")35@SuppressWarnings("serial")
35public class InitializeMainFrameAction extends AbstractAction {36public class InitializeNewReviewAction extends AbstractAction {
3637
37 /*38 /*
38 * (non-Javadoc)39 * (non-Javadoc)
@@ -42,19 +43,32 @@
42 */43 */
43 @Override44 @Override
44 public void actionPerformed(ActionEvent e) {45 public void actionPerformed(ActionEvent e) {
45 AssistantDialog.Selection sel = UI.getInstance().getAssistantDialog()46 if (Data.getInstance().getMode().equals("moderator")) {
46 .getSelected();
47
48 if (sel == AssistantDialog.Selection.NEW_REVIEW) {
49 new NewReviewWorker().execute();47 new NewReviewWorker().execute();
50 } else if (sel == AssistantDialog.Selection.LOAD_REVIEW) {48
51 new LoadReviewWorker(UI.getInstance().getAssistantDialog()
52 .getPath()).execute();
53 } else if (sel == AssistantDialog.Selection.MANAGE_ASPECTS) {
54 UI.getInstance().setStatus(UI.Status.NO_FILE_LOADED);
55
56 UI.getInstance().getAssistantDialog().setVisible(false);49 UI.getInstance().getAssistantDialog().setVisible(false);
57 UI.getInstance().getAspectsManagerFrame().setVisible(true);50 } else if (Data.getInstance().getMode().equals("instant")) {
51 AssistantDialog assistant = UI.getInstance().getAssistantDialog();
52 AttendeeDialog attDiag = UI.getInstance().getAttendeeDialog();
53
54 if (!attDiag.getNameTxtFld().getText().trim().equals("")) {
55 UI.getInstance().getAssistantDialog().setVisible(false);
56
57 ActionRegistry.getInstance().get(
58 ConfirmAttendeeAction.class.getName()).actionPerformed(
59 null);
60
61 new NewReviewWorker().execute();
62 } else {
63 String message = "";
64
65 message = Data.getInstance().getLocaleStr(
66 "attendeeDialog.message.noName");
67
68 assistant.setMessage(message);
69
70 attDiag.getNameTxtFld().setBorder(UI.MARKED_BORDER_INLINE);
71 }
58 }72 }
59 }73 }
6074
6175
=== modified file 'src/org/revager/gui/actions/OpenAspectsManagerAction.java'
--- src/org/revager/gui/actions/OpenAspectsManagerAction.java 2010-01-31 17:32:35 +0000
+++ src/org/revager/gui/actions/OpenAspectsManagerAction.java 2010-05-26 20:44:25 +0000
@@ -28,7 +28,6 @@
28import org.revager.app.model.Data;28import org.revager.app.model.Data;
29import org.revager.gui.UI;29import org.revager.gui.UI;
3030
31
32/**31/**
33 * The Class OpenAspectsManagerAction.32 * The Class OpenAspectsManagerAction.
34 */33 */
@@ -57,7 +56,7 @@
57 public void actionPerformed(ActionEvent e) {56 public void actionPerformed(ActionEvent e) {
58 UI.getInstance().getAspectsManagerFrame().setSelectedReviewer(57 UI.getInstance().getAspectsManagerFrame().setSelectedReviewer(
59 UI.getInstance().getMainFrame().getSelectedAttendee());58 UI.getInstance().getMainFrame().getSelectedAttendee());
6059 UI.getInstance().getAssistantDialog().setVisible(false);
61 UI.getInstance().getAspectsManagerFrame().setVisible(true);60 UI.getInstance().getAspectsManagerFrame().setVisible(true);
62 }61 }
6362
6463
=== added directory 'src/org/revager/gui/actions/assistant'
=== renamed file 'src/org/revager/gui/actions/OpenScribeModeAction.java' => 'src/org/revager/gui/actions/assistant/GoToAddAttPnlAction.java'
--- src/org/revager/gui/actions/OpenScribeModeAction.java 2010-01-31 17:32:35 +0000
+++ src/org/revager/gui/actions/assistant/GoToAddAttPnlAction.java 2010-05-26 20:44:25 +0000
@@ -16,21 +16,23 @@
16 * You should have received a copy of the GNU General Public License16 * You should have received a copy of the GNU General Public License
17 * along with Resi. If not, see <http://www.gnu.org/licenses/>.17 * along with Resi. If not, see <http://www.gnu.org/licenses/>.
18 */18 */
19package org.revager.gui.actions;19package org.revager.gui.actions.assistant;
2020
21import java.awt.event.ActionEvent;21import java.awt.event.ActionEvent;
2222
23import javax.swing.AbstractAction;23import javax.swing.AbstractAction;
2424
25import org.revager.app.model.Data;
26import org.revager.gui.UI;25import org.revager.gui.UI;
2726
28
29/**27/**
30 * The Class OpenScribeModeAction.28 * The Class GoToAddAttPnlAction. Calling this action will set the assistant to
29 * the AddAttendeePanel.
30 *
31 * @author D.Casciato
32 *
31 */33 */
32@SuppressWarnings("serial")34@SuppressWarnings("serial")
33public class OpenScribeModeAction extends AbstractAction {35public class GoToAddAttPnlAction extends AbstractAction {
3436
35 /*37 /*
36 * (non-Javadoc)38 * (non-Javadoc)
@@ -40,8 +42,11 @@
40 */42 */
41 @Override43 @Override
42 public void actionPerformed(ActionEvent e) {44 public void actionPerformed(ActionEvent e) {
43 Data.getInstance().setMode("scribe");45 UI.getInstance().getAssistantDialog().setCurrentPnl(
44 UI.getInstance().getAssistantDialog().setSelectReview();46 UI.getInstance().getAssistantDialog().getAddAttendeePanel());
47 UI.getInstance().getAssistantDialog().updateMessage();
48 UI.getInstance().getAssistantDialog().updateContents();
49 UI.getInstance().getAssistantDialog().updateWizardBttns();
45 }50 }
4651
47}52}
4853
=== renamed file 'src/org/revager/gui/actions/SelectModeAction.java' => 'src/org/revager/gui/actions/assistant/GoToFirstScreenPnlAction.java'
--- src/org/revager/gui/actions/SelectModeAction.java 2010-01-31 17:32:35 +0000
+++ src/org/revager/gui/actions/assistant/GoToFirstScreenPnlAction.java 2010-05-26 20:44:25 +0000
@@ -16,39 +16,23 @@
16 * You should have received a copy of the GNU General Public License16 * You should have received a copy of the GNU General Public License
17 * along with Resi. If not, see <http://www.gnu.org/licenses/>.17 * along with Resi. If not, see <http://www.gnu.org/licenses/>.
18 */18 */
19package org.revager.gui.actions;19package org.revager.gui.actions.assistant;
2020
21import java.awt.Toolkit;
22import java.awt.event.ActionEvent;21import java.awt.event.ActionEvent;
23import java.awt.event.KeyEvent;
2422
25import javax.swing.AbstractAction;23import javax.swing.AbstractAction;
26import javax.swing.Action;
27import javax.swing.KeyStroke;
2824
29import org.revager.app.model.Data;
30import org.revager.gui.UI;25import org.revager.gui.UI;
3126
32
33/**27/**
34 * The Class SelectModeAction.28 * The Class GoToFirstScreenPnlAction. Calling this action will set the assistant to
29 * the FirstScreenPanel.
30 *
31 * @author D.Casciato
32 *
35 */33 */
36@SuppressWarnings("serial")34@SuppressWarnings("serial")
37public class SelectModeAction extends AbstractAction {35public class GoToFirstScreenPnlAction extends AbstractAction {
38
39 /**
40 * Instantiates a new select mode action.
41 */
42 public SelectModeAction() {
43 super();
44
45 putValue(Action.SMALL_ICON, Data.getInstance().getIcon(
46 "menuAssistant_16x16.png"));
47 putValue(Action.NAME, Data.getInstance().getLocaleStr(
48 "menu.showAssistant"));
49 putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_M, Toolkit
50 .getDefaultToolkit().getMenuShortcutKeyMask()));
51 }
5236
53 /*37 /*
54 * (non-Javadoc)38 * (non-Javadoc)
@@ -58,8 +42,11 @@
58 */42 */
59 @Override43 @Override
60 public void actionPerformed(ActionEvent e) {44 public void actionPerformed(ActionEvent e) {
61 UI.getInstance().getAssistantDialog().setSelectMode();45 UI.getInstance().getAssistantDialog().setCurrentPnl(
62 UI.getInstance().getAssistantDialog().setVisible(true);46 UI.getInstance().getAssistantDialog().getFirstScreenPanel());
47 UI.getInstance().getAssistantDialog().updateMessage();
48 UI.getInstance().getAssistantDialog().updateContents();
49 UI.getInstance().getAssistantDialog().updateWizardBttns();
63 }50 }
6451
65}52}
6653
=== renamed file 'src/org/revager/gui/actions/OpenModeratorModeAction.java' => 'src/org/revager/gui/actions/assistant/GoToOpenRevPnlAction.java'
--- src/org/revager/gui/actions/OpenModeratorModeAction.java 2010-01-31 17:32:35 +0000
+++ src/org/revager/gui/actions/assistant/GoToOpenRevPnlAction.java 2010-05-26 20:44:25 +0000
@@ -16,21 +16,23 @@
16 * You should have received a copy of the GNU General Public License16 * You should have received a copy of the GNU General Public License
17 * along with Resi. If not, see <http://www.gnu.org/licenses/>.17 * along with Resi. If not, see <http://www.gnu.org/licenses/>.
18 */18 */
19package org.revager.gui.actions;19package org.revager.gui.actions.assistant;
2020
21import java.awt.event.ActionEvent;21import java.awt.event.ActionEvent;
2222
23import javax.swing.AbstractAction;23import javax.swing.AbstractAction;
2424
25import org.revager.app.model.Data;
26import org.revager.gui.UI;25import org.revager.gui.UI;
2726
28
29/**27/**
30 * The Class OpenModeratorModeAction.28 * The Class GoToOpenReviewPanel. Calling this action will set the assistant to
29 * the OpenReviewPanel.
30 *
31 * @author D.Casciato
32 *
31 */33 */
32@SuppressWarnings("serial")34@SuppressWarnings("serial")
33public class OpenModeratorModeAction extends AbstractAction {35public class GoToOpenRevPnlAction extends AbstractAction {
3436
35 /*37 /*
36 * (non-Javadoc)38 * (non-Javadoc)
@@ -40,8 +42,13 @@
40 */42 */
41 @Override43 @Override
42 public void actionPerformed(ActionEvent e) {44 public void actionPerformed(ActionEvent e) {
43 Data.getInstance().setMode("moderator");45
44 UI.getInstance().getAssistantDialog().setSelectReview();46 UI.getInstance().getAssistantDialog().setCurrentPnl(
47 UI.getInstance().getAssistantDialog().getOpenReviewPanel());
48 UI.getInstance().getAssistantDialog().updateMessage();
49 UI.getInstance().getAssistantDialog().updateContents();
50 UI.getInstance().getAssistantDialog().updateWizardBttns();
51
45 }52 }
4653
47}54}
4855
=== added file 'src/org/revager/gui/actions/assistant/OpenAssistantAction.java'
--- src/org/revager/gui/actions/assistant/OpenAssistantAction.java 1970-01-01 00:00:00 +0000
+++ src/org/revager/gui/actions/assistant/OpenAssistantAction.java 2010-05-26 20:44:25 +0000
@@ -0,0 +1,70 @@
1/*
2 * Copyright 2009 Davide Casciato, Sandra Reich, Johannes Wettinger
3 *
4 * This file is part of Resi.
5 *
6 * Resi is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * Resi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with Resi. If not, see <http://www.gnu.org/licenses/>.
18 */
19package org.revager.gui.actions.assistant;
20
21import java.awt.Toolkit;
22import java.awt.event.ActionEvent;
23import java.awt.event.KeyEvent;
24
25import javax.swing.AbstractAction;
26import javax.swing.Action;
27import javax.swing.KeyStroke;
28
29import org.revager.app.model.Data;
30import org.revager.gui.UI;
31
32
33@SuppressWarnings("serial")
34/**
35 * The class OpenAssistantAction.
36 *
37 */
38public class OpenAssistantAction extends AbstractAction{
39
40 /**
41 * Opens the AssistantDialog.
42 */
43 public OpenAssistantAction() {
44 super();
45
46 putValue(Action.SMALL_ICON, Data.getInstance().getIcon(
47 "menuAssistant_16x16.png"));
48 putValue(Action.NAME, Data.getInstance().getLocaleStr(
49 "menu.showAssistant"));
50 putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_M, Toolkit
51 .getDefaultToolkit().getMenuShortcutKeyMask()));
52 }
53
54 /*
55 * (non-Javadoc)
56 *
57 * @see
58 * java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
59 */
60 @Override
61 public void actionPerformed(ActionEvent e) {
62 UI.getInstance().getAssistantDialog().setCurrentPnl(
63 UI.getInstance().getAssistantDialog().getFirstScreenPanel());
64 UI.getInstance().getAssistantDialog().updateMessage();
65 UI.getInstance().getAssistantDialog().updateContents();
66 UI.getInstance().getAssistantDialog().updateWizardBttns();
67 UI.getInstance().getAssistantDialog().setVisible(true);
68 }
69
70}
0\ No newline at end of file71\ No newline at end of file
172
=== added file 'src/org/revager/gui/actions/assistant/SelectLanguageAction.java'
--- src/org/revager/gui/actions/assistant/SelectLanguageAction.java 1970-01-01 00:00:00 +0000
+++ src/org/revager/gui/actions/assistant/SelectLanguageAction.java 2010-05-26 20:44:25 +0000
@@ -0,0 +1,73 @@
1/*
2 * Copyright 2009 Davide Casciato, Sandra Reich, Johannes Wettinger
3 *
4 * This file is part of Resi.
5 *
6 * Resi is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * Resi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with Resi. If not, see <http://www.gnu.org/licenses/>.
18 */
19package org.revager.gui.actions.assistant;
20
21import java.awt.event.ActionEvent;
22
23import javax.swing.AbstractAction;
24
25import org.revager.app.model.ApplicationData;
26import org.revager.app.model.Data;
27import org.revager.app.model.DataException;
28import org.revager.app.model.appdata.AppSettingKey;
29import org.revager.gui.UI;
30import org.revager.gui.dialogs.assistant.LanguagePopupWindow;
31
32/**
33 * The Class GoToAddAttPnlAction. Calling this action will open a pop-up to
34 * select a language. After confirming you'll need to restart the application to
35 * activate the language changes.
36 *
37 * @author D.Casciato
38 *
39 */
40@SuppressWarnings("serial")
41public class SelectLanguageAction extends AbstractAction {
42
43 private LanguagePopupWindow popup;
44 private ApplicationData appData = Data.getInstance().getAppData();
45
46 /*
47 * (non-Javadoc)
48 *
49 * @see
50 * java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
51 */
52 @Override
53 public void actionPerformed(ActionEvent arg0) {
54
55 if (UI.getInstance().getAssistantDialog().isVisible())
56 popup = new LanguagePopupWindow(UI.getInstance()
57 .getAssistantDialog(), Data.getInstance().getLocaleStr(
58 "assistantDialog.selectLanguage"));
59 popup.setVisible(true);
60
61 if (popup.getButtonClicked() == LanguagePopupWindow.ButtonClicked.OK) {
62 try {
63 appData.setSetting(AppSettingKey.APP_LANGUAGE, popup
64 .getSelectedLanguage());
65 UI.getInstance().getAssistantDialog().setMessage(
66 Data.getInstance().getLocaleStr(
67 "settingsDialog.general.langHintRestart"));
68 } catch (DataException e) {
69 e.printStackTrace();
70 }
71 }
72 }
73}
074
=== modified file 'src/org/revager/gui/actions/attendee/AddResiAttToProtAction.java'
--- src/org/revager/gui/actions/attendee/AddResiAttToProtAction.java 2010-01-31 17:32:35 +0000
+++ src/org/revager/gui/actions/attendee/AddResiAttToProtAction.java 2010-05-26 20:44:25 +0000
@@ -29,7 +29,6 @@
29import org.revager.gui.UI;29import org.revager.gui.UI;
30import org.revager.gui.protocol.AddResiAttToProtPopupWindow;30import org.revager.gui.protocol.AddResiAttToProtPopupWindow;
3131
32
33/**32/**
34 * The Class AddResiAttToProtAction.33 * The Class AddResiAttToProtAction.
35 */34 */
@@ -59,7 +58,7 @@
5958
60 localAtt = Application.getInstance().getAttendeeMgmt().getAttendee(59 localAtt = Application.getInstance().getAttendeeMgmt().getAttendee(
61 Integer.parseInt(attId));60 Integer.parseInt(attId));
62 61
63 Application.getInstance().getProtocolMgmt().addAttendee(localAtt,62 Application.getInstance().getProtocolMgmt().addAttendee(localAtt,
64 prep, prot);63 prep, prot);
65 UI.getInstance().getProtocolFrame().getPatm().setProtocol(prot);64 UI.getInstance().getProtocolFrame().getPatm().setProtocol(prot);
6665
=== modified file 'src/org/revager/gui/actions/attendee/SelectAttOutOfDirAction.java'
--- src/org/revager/gui/actions/attendee/SelectAttOutOfDirAction.java 2010-01-31 17:32:35 +0000
+++ src/org/revager/gui/actions/attendee/SelectAttOutOfDirAction.java 2010-05-26 20:44:25 +0000
@@ -27,13 +27,13 @@
27import org.revager.gui.DirectoryPopupWindow;27import org.revager.gui.DirectoryPopupWindow;
28import org.revager.gui.UI;28import org.revager.gui.UI;
2929
30
31/**30/**
32 * The Class SelectAttOutOfDirAction.31 * The Class SelectAttOutOfDirAction.
33 */32 */
34@SuppressWarnings("serial")33@SuppressWarnings("serial")
35public class SelectAttOutOfDirAction extends AbstractAction {34public class SelectAttOutOfDirAction extends AbstractAction {
36 private DirectoryPopupWindow popup;35 private DirectoryPopupWindow popup;
36
37 /*37 /*
38 * (non-Javadoc)38 * (non-Javadoc)
39 * 39 *
@@ -42,11 +42,11 @@
42 */42 */
43 @Override43 @Override
44 public void actionPerformed(ActionEvent ev) {44 public void actionPerformed(ActionEvent ev) {
45 if(UI.getInstance().getAttendeeDialog().isVisible())45 if (UI.getInstance().getAttendeeDialog().isVisible())
46 popup = new DirectoryPopupWindow(UI.getInstance()46 popup = new DirectoryPopupWindow(UI.getInstance()
47 .getAttendeeDialog(), Data.getInstance().getLocaleStr(47 .getAttendeeDialog(), Data.getInstance().getLocaleStr(
48 "popup.directory.title"));48 "popup.directory.title"));
49 else if(UI.getInstance().getAssistantDialog().isVisible())49 else if (UI.getInstance().getAssistantDialog().isVisible())
50 popup = new DirectoryPopupWindow(UI.getInstance()50 popup = new DirectoryPopupWindow(UI.getInstance()
51 .getAssistantDialog(), Data.getInstance().getLocaleStr(51 .getAssistantDialog(), Data.getInstance().getLocaleStr(
52 "popup.directory.title"));52 "popup.directory.title"));
@@ -56,12 +56,9 @@
56 if (popup.getAttendeeBx().getSelectedItem() != null) {56 if (popup.getAttendeeBx().getSelectedItem() != null) {
57 AppAttendee appAtt = ((AppAttendee) popup.getAttendeeBx()57 AppAttendee appAtt = ((AppAttendee) popup.getAttendeeBx()
58 .getSelectedItem());58 .getSelectedItem());
59 59
60 if(UI.getInstance().getAttendeeDialog().isVisible())
61 UI.getInstance().getAttendeeDialog().setCurrentAppAttendee(60 UI.getInstance().getAttendeeDialog().setCurrentAppAttendee(
62 appAtt);61 appAtt);
63 else if(UI.getInstance().getAssistantDialog().isVisible())
64 UI.getInstance().getAssistantDialog().setCurrentAppAttendee(appAtt);
65 }62 }
66 }63 }
67 }64 }
6865
=== added file 'src/org/revager/gui/actions/popup/LanguagePopupWindowAction.java'
--- src/org/revager/gui/actions/popup/LanguagePopupWindowAction.java 1970-01-01 00:00:00 +0000
+++ src/org/revager/gui/actions/popup/LanguagePopupWindowAction.java 2010-05-26 20:44:25 +0000
@@ -0,0 +1,35 @@
1package org.revager.gui.actions.popup;
2
3import java.awt.event.ActionEvent;
4
5import javax.swing.AbstractAction;
6
7import org.revager.gui.dialogs.assistant.LanguagePopupWindow;
8import org.revager.gui.dialogs.assistant.LanguagePopupWindow.ButtonClicked;
9
10@SuppressWarnings("serial")
11public class LanguagePopupWindowAction extends AbstractAction {
12
13 private LanguagePopupWindow popupWindow = null;
14
15 private ButtonClicked buttonClick = null;
16
17 public LanguagePopupWindowAction(LanguagePopupWindow popupWin,
18 ButtonClicked buttonClk) {
19 this.popupWindow = popupWin;
20 this.buttonClick = buttonClk;
21 }
22
23 /*
24 * (non-Javadoc)
25 *
26 * @see
27 * java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
28 */
29 @Override
30 public void actionPerformed(ActionEvent e) {
31 popupWindow.setButtonClicked(buttonClick);
32 popupWindow.setVisible(false);
33 }
34
35}
036
=== removed file 'src/org/revager/gui/dialogs/AssistantDialog.java'
--- src/org/revager/gui/dialogs/AssistantDialog.java 2010-01-31 17:32:35 +0000
+++ src/org/revager/gui/dialogs/AssistantDialog.java 1970-01-01 00:00:00 +0000
@@ -1,1042 +0,0 @@
1/*
2 * Copyright 2009 Davide Casciato, Sandra Reich, Johannes Wettinger
3 *
4 * This file is part of Resi.
5 *
6 * Resi is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * Resi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with Resi. If not, see <http://www.gnu.org/licenses/>.
18 */
19package org.revager.gui.dialogs;
20
21import java.awt.BorderLayout;
22import java.awt.Color;
23import java.awt.Dimension;
24import java.awt.Font;
25import java.awt.Frame;
26import java.awt.GridBagConstraints;
27import java.awt.GridBagLayout;
28import java.awt.GridLayout;
29import java.awt.event.ActionEvent;
30import java.awt.event.ActionListener;
31import java.awt.event.FocusEvent;
32import java.awt.event.FocusListener;
33import java.awt.event.ItemEvent;
34import java.awt.event.ItemListener;
35import java.awt.event.KeyEvent;
36import java.awt.event.KeyListener;
37import java.awt.event.MouseEvent;
38import java.awt.event.MouseListener;
39import java.io.File;
40import java.util.ArrayList;
41import java.util.List;
42import java.util.Vector;
43
44import javax.swing.BorderFactory;
45import javax.swing.ButtonGroup;
46import javax.swing.ImageIcon;
47import javax.swing.JButton;
48import javax.swing.JComboBox;
49import javax.swing.JDialog;
50import javax.swing.JLabel;
51import javax.swing.JList;
52import javax.swing.JOptionPane;
53import javax.swing.JPanel;
54import javax.swing.JRadioButton;
55import javax.swing.JScrollPane;
56import javax.swing.JTable;
57import javax.swing.JTextArea;
58import javax.swing.JTextField;
59import javax.swing.ListSelectionModel;
60import javax.swing.SwingWorker;
61import javax.swing.border.MatteBorder;
62import javax.swing.event.ChangeEvent;
63import javax.swing.event.ChangeListener;
64import javax.swing.event.ListSelectionEvent;
65import javax.swing.event.ListSelectionListener;
66
67import org.revager.app.Application;
68import org.revager.app.ResiFileFilter;
69import org.revager.app.model.Data;
70import org.revager.app.model.DataException;
71import org.revager.app.model.appdata.AppAttendee;
72import org.revager.app.model.schema.Attendee;
73import org.revager.app.model.schema.Role;
74import org.revager.gui.AbstractDialog;
75import org.revager.gui.StrengthPopupWindow;
76import org.revager.gui.UI;
77import org.revager.gui.StrengthPopupWindow.ButtonClicked;
78import org.revager.gui.actions.ActionRegistry;
79import org.revager.gui.actions.ExitAction;
80import org.revager.gui.actions.InitializeMainFrameAction;
81import org.revager.gui.actions.OpenModeratorModeAction;
82import org.revager.gui.actions.OpenScribeModeAction;
83import org.revager.gui.actions.attendee.SelectAttOutOfDirAction;
84import org.revager.gui.helpers.FileChooser;
85import org.revager.gui.models.StrengthTableModel;
86import org.revager.gui.workers.LoadStdCatalogsWorker;
87import org.revager.tools.GUITools;
88
89
90/**
91 * The Class AssistantDialog.
92 */
93@SuppressWarnings("serial")
94public class AssistantDialog extends AbstractDialog {
95
96 /**
97 * The Enum Selection.
98 */
99 public enum Selection {
100 NEW_REVIEW, LOAD_REVIEW, MANAGE_ASPECTS;
101 }
102
103 private Selection selected = Selection.NEW_REVIEW;
104
105 /**
106 * Gets the selected.
107 *
108 * @return the selected
109 */
110 public Selection getSelected() {
111 return selected;
112 }
113
114 private GridBagLayout gbl = new GridBagLayout();
115 private JPanel basePanel = new JPanel(gbl);
116
117 private JButton buttonExit = new JButton(Data.getInstance().getLocaleStr(
118 "closeApplication"));
119 private JButton buttonBack = new JButton(Data.getInstance().getLocaleStr(
120 "back"));
121 private JButton buttonConfirm = new JButton(Data.getInstance()
122 .getLocaleStr("confirm"));
123
124 private JList listLastRevs;
125
126 private JTextField pathTxtFld = new JTextField();
127
128 private final ImageIcon ICON_BROWSE = Data.getInstance().getIcon(
129 "buttonBrowse_22x22_0.png");
130 private final ImageIcon ICON_BROWSE_ROLLOVER = Data.getInstance().getIcon(
131 "buttonBrowse_22x22.png");
132 private JButton buttonBrowse = GUITools.newImageButton(ICON_BROWSE,
133 ICON_BROWSE_ROLLOVER);
134 private Level dialogLevel;
135 private JLabel nameLabel;
136 private JLabel contactLabel;
137 private JLabel roleLabel;
138 private JLabel strengthLabel;
139 private JTextField nameTxtFld;
140 private JTextArea contactTxtArea;
141 private JComboBox roleCmbBx;
142 private JTable strengthTbl;
143
144 private JButton directoryBttn;
145 private JButton addStrength = null;
146 private JButton removeStrength = null;
147
148 private StrengthTableModel stm = null;
149 private List<String> strengthList = null;
150 private JScrollPane contactScrllPn;
151 private JPanel buttonPanel = null;
152
153 private AppAttendee currentAppAttendee;
154 //private Attendee currentAttendee;
155
156 public enum Level {
157 LEVEL1, LEVEL2, LEVEL3
158 };
159
160 private boolean nameMissing;
161
162 /**
163 * Returns if name is missing or not
164 *
165 * @return missing
166 */
167 public boolean isNameMissing() {
168 return nameMissing;
169 }
170
171 /**
172 * Gets the path.
173 *
174 * @return the path
175 */
176 public String getPath() {
177 return pathTxtFld.getText();
178 }
179
180 /**
181 * Sets the path.
182 *
183 * @param path
184 * the new path
185 */
186 public void setPath(String path) {
187 pathTxtFld.setText(path);
188 }
189
190 /**
191 * Sets the select mode.
192 */
193 public void setSelectMode() {
194 dialogLevel = Level.LEVEL1;
195
196 setDescription(Data.getInstance().getLocaleStr(
197 "assistantDialog.selectModeDescription"));
198
199 basePanel.removeAll();
200
201 basePanel.setLayout(gbl);
202
203 buttonConfirm.setEnabled(false);
204 buttonConfirm.setIcon(Data.getInstance().getIcon("buttonOk_16x16.png"));
205 buttonConfirm.setText(Data.getInstance().getLocaleStr("confirm"));
206
207 buttonBack.setEnabled(false);
208
209 JButton moderator = GUITools.newImageButton();
210 moderator
211 .setIcon(Data.getInstance().getIcon("moderator_128x128_0.png"));
212 moderator.setRolloverIcon(Data.getInstance().getIcon(
213 "moderator_128x128.png"));
214 moderator.addActionListener(ActionRegistry.getInstance().get(
215 OpenModeratorModeAction.class.getName()));
216
217 JButton scribe = GUITools.newImageButton();
218 scribe.setIcon(Data.getInstance().getIcon("scribe_128x128_0.png"));
219 scribe
220 .setRolloverIcon(Data.getInstance().getIcon(
221 "scribe_128x128.png"));
222 scribe.addActionListener(ActionRegistry.getInstance().get(
223 OpenScribeModeAction.class.getName()));
224
225 JButton instantReview = GUITools.newImageButton(Data.getInstance()
226 .getIcon("instantReview_128x128_0.png"), Data.getInstance()
227 .getIcon("instantReview_128x128.png"));
228 instantReview.addActionListener(new ActionListener() {
229
230 @Override
231 public void actionPerformed(ActionEvent e) {
232 Data.getInstance().setMode("instant");
233 UI.getInstance().getAssistantDialog().setSelectReview();
234 }
235 });
236 instantReview.setEnabled(true);
237
238 JLabel scribeLabel = new JLabel(Data.getInstance().getLocaleStr(
239 "mode.scribe"));
240 JLabel moderatorLabel = new JLabel(Data.getInstance().getLocaleStr(
241 "mode.moderator"));
242 JLabel instantRevLabel = new JLabel(Data.getInstance().getLocaleStr(
243 "mode.instant"));
244
245 buttonExit.addActionListener(ActionRegistry.getInstance().get(
246 ExitAction.class.getName()));
247
248 GUITools
249 .addComponent(basePanel, gbl, moderator, 0, 0, 1, 1, 1.0, 1.0,
250 0, 20, 0, 20, GridBagConstraints.NONE,
251 GridBagConstraints.SOUTH);
252 GUITools.addComponent(basePanel, gbl, moderatorLabel, 0, 1, 1, 1, 1.0,
253 1.0, 0, 20, 0, 20, GridBagConstraints.NONE,
254 GridBagConstraints.NORTH);
255 GUITools.addComponent(basePanel, gbl, instantReview, 1, 0, 1, 1, 1.0,
256 1.0, 0, 20, 0, 20, GridBagConstraints.NONE,
257 GridBagConstraints.SOUTH);
258 GUITools.addComponent(basePanel, gbl, instantRevLabel, 1, 1, 1, 1, 1.0,
259 1.0, 0, 20, 0, 20, GridBagConstraints.NONE,
260 GridBagConstraints.NORTH);
261 GUITools.addComponent(basePanel, gbl, scribe, 2, 0, 1, 1, 1.0, 1.0, 0,
262 20, 0, 20, GridBagConstraints.NONE, GridBagConstraints.SOUTH);
263 GUITools.addComponent(basePanel, gbl, scribeLabel, 2, 1, 1, 1, 1.0,
264 1.0, 0, 20, 0, 20, GridBagConstraints.NONE,
265 GridBagConstraints.NORTH);
266
267 buttonConfirm.requestFocusInWindow();
268
269 basePanel.repaint();
270
271 pack();
272 }
273
274 /**
275 * Sets the select review.
276 */
277 public void setSelectReview() {
278
279 dialogLevel = Level.LEVEL2;
280
281 setDescription(Data.getInstance().getLocaleStr(
282 "assistantDialog.selectReviewDescription"));
283
284 basePanel.removeAll();
285
286 buttonBack.setEnabled(true);
287 buttonConfirm.setEnabled(true);
288
289 final JLabel labelSelectReview = new JLabel(Data.getInstance()
290 .getLocaleStr("assistantDialog.selectReview")
291 + ":");
292 final JLabel labelLastReviews = new JLabel(Data.getInstance()
293 .getLocaleStr("assistantDialog.lastReviews")
294 + ":");
295
296 pathTxtFld.setBorder(UI.STANDARD_BORDER_INLINE);
297
298 /*
299 * List of last reviews
300 */
301 listLastRevs = new JList();
302 listLastRevs.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
303 listLastRevs.setSelectedIndex(0);
304 listLastRevs.setListData(getLastReviews());
305 listLastRevs.setBorder(UI.STANDARD_BORDER);
306 listLastRevs.setFont(listLastRevs.getFont().deriveFont(Font.PLAIN));
307 listLastRevs.addListSelectionListener(new ListSelectionListener() {
308 @Override
309 public void valueChanged(ListSelectionEvent e) {
310 List<String> lastRevs;
311 try {
312 lastRevs = Data.getInstance().getAppData().getLastReviews();
313 if (listLastRevs.getSelectedIndex() > -1) {
314 String selectedReview = lastRevs.get(listLastRevs
315 .getSelectedIndex());
316
317 if (!pathTxtFld.getText().equals(selectedReview)) {
318 pathTxtFld.setText(selectedReview);
319 }
320 }
321 } catch (DataException exc) {
322 JOptionPane.showMessageDialog(null, GUITools
323 .getMessagePane(exc.getMessage()), Data
324 .getInstance().getLocaleStr("error"),
325 JOptionPane.ERROR_MESSAGE);
326 }
327 }
328 });
329
330 ButtonGroup choice = new ButtonGroup();
331
332 final JRadioButton newReview = new JRadioButton(Data.getInstance()
333 .getLocaleStr("menu.file.newReview"), true);
334 choice.add(newReview);
335
336 final JRadioButton openReview = new JRadioButton(Data.getInstance()
337 .getLocaleStr("menu.file.openReview"));
338 choice.add(openReview);
339
340 final JRadioButton manageAspects = new JRadioButton(Data.getInstance()
341 .getLocaleStr("assistantDialog.manageCatalogs"));
342 choice.add(manageAspects);
343
344 openReview.setEnabled(Data.getInstance().getModeParam(
345 "ableToOpenReview"));
346 openReview.addChangeListener(new ChangeListener() {
347 @Override
348 public void stateChanged(ChangeEvent e) {
349 if (openReview.isSelected()) {
350 pathTxtFld.setEnabled(true);
351 buttonBrowse.setEnabled(true);
352 listLastRevs.setEnabled(true);
353 selected = Selection.LOAD_REVIEW;
354 labelSelectReview.setEnabled(true);
355 labelLastReviews.setEnabled(true);
356 }
357 }
358 });
359
360 newReview.setEnabled(Data.getInstance().getModeParam(
361 "ableToCreateNewReview"));
362 newReview.addChangeListener(new ChangeListener() {
363 @Override
364 public void stateChanged(ChangeEvent e) {
365 if (newReview.isSelected()) {
366 pathTxtFld.setEnabled(false);
367 buttonBrowse.setEnabled(false);
368 listLastRevs.setEnabled(false);
369 selected = Selection.NEW_REVIEW;
370 labelSelectReview.setEnabled(false);
371 labelLastReviews.setEnabled(false);
372 }
373 }
374 });
375
376 manageAspects.setEnabled(Data.getInstance().getModeParam(
377 "ableToUseAspectsManager"));
378 manageAspects.addChangeListener(new ChangeListener() {
379 @Override
380 public void stateChanged(ChangeEvent e) {
381 if (manageAspects.isSelected()) {
382 pathTxtFld.setEnabled(false);
383 buttonBrowse.setEnabled(false);
384 listLastRevs.setEnabled(false);
385 selected = Selection.MANAGE_ASPECTS;
386 labelSelectReview.setEnabled(false);
387 labelLastReviews.setEnabled(false);
388 }
389 }
390 });
391
392 /*
393 * Set start selection
394 */
395 if (Data.getInstance().getModeParam("ableToCreateNewReview")) {
396 newReview.setSelected(true);
397 selected = Selection.NEW_REVIEW;
398 } else if (Data.getInstance().getModeParam("ableToOpenReview")) {
399 openReview.setSelected(true);
400 selected = Selection.LOAD_REVIEW;
401 }
402
403 pathTxtFld.setEnabled(openReview.isSelected());
404 buttonBrowse.setEnabled(openReview.isSelected());
405 listLastRevs.setEnabled(openReview.isSelected());
406 labelSelectReview.setEnabled(openReview.isSelected());
407 labelLastReviews.setEnabled(openReview.isSelected());
408
409 // container,layout, component,gx,gy,gwidth,gheight,weightx,weighty, t,
410 // l, b, r, a, i
411 GUITools.addComponent(basePanel, gbl, manageAspects, 0, 0, 1, 1, 0, 0,
412 0, 0, 0, 0, GridBagConstraints.NONE,
413 GridBagConstraints.NORTHWEST);
414 GUITools.addComponent(basePanel, gbl, newReview, 0, 1, 1, 1, 0, 0, 10,
415 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.NORTHWEST);
416 GUITools.addComponent(basePanel, gbl, openReview, 0, 2, 1, 1, 0, 0, 10,
417 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.NORTHWEST);
418 GUITools.addComponent(basePanel, gbl, labelSelectReview, 0, 3, 1, 1, 0,
419 0, 0, 20, 0, 0, GridBagConstraints.NONE,
420 GridBagConstraints.WEST);
421 GUITools.addComponent(basePanel, gbl, pathTxtFld, 1, 3, 2, 1, 1.0, 0.3,
422 20, 0, 20, 0, GridBagConstraints.HORIZONTAL,
423 GridBagConstraints.WEST);
424 GUITools.addComponent(basePanel, gbl, buttonBrowse, 3, 3, 1, 1, 0, 0,
425 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
426 GUITools.addComponent(basePanel, gbl, labelLastReviews, 0, 4, 1, 1,
427 0.0, 0.0, 0, 20, 0, 0, GridBagConstraints.NONE,
428 GridBagConstraints.WEST);
429 GUITools.addComponent(basePanel, gbl, listLastRevs, 2, 4, 2, 2, 1.0,
430 1.0, 0, 0, 0, 0, GridBagConstraints.BOTH,
431 GridBagConstraints.NORTHWEST);
432
433 buttonConfirm.requestFocusInWindow();
434
435 basePanel.repaint();
436
437 pack();
438 }
439
440 /**
441 * Changes to level3 view of the dialog
442 */
443 public void setAddAttToInstRev() {
444 dialogLevel = Level.LEVEL3;
445
446 setDescription(Data.getInstance().getLocaleStr(
447 "addYourself.description"));
448
449 basePanel.removeAll();
450
451 buttonBack.setEnabled(true);
452 buttonConfirm.setEnabled(true);
453
454 nameLabel = new JLabel(Data.getInstance().getLocaleStr("attendee.name"));
455 contactLabel = new JLabel(Data.getInstance().getLocaleStr(
456 "attendee.contact"));
457 roleLabel = new JLabel(Data.getInstance().getLocaleStr("attendee.role"));
458 strengthLabel = new JLabel(Data.getInstance().getLocaleStr(
459 "attendee.priorities"));
460
461 nameTxtFld = new JTextField();
462 contactTxtArea = new JTextArea();
463 contactTxtArea.addFocusListener(focusListener);
464 contactScrllPn = GUITools.setIntoScrllPn(contactTxtArea);
465 roleCmbBx = new JComboBox();
466 roleCmbBx.addFocusListener(focusListener);
467
468 for (Role x : Role.values()) {
469 String roleString = "role.".concat(x.value());
470 roleCmbBx.addItem(Data.getInstance().getLocaleStr(roleString));
471 }
472
473 roleCmbBx.addItemListener(new ItemListener() {
474 @Override
475 public void itemStateChanged(ItemEvent ev) {
476 updateStrengthTable();
477 }
478 });
479
480 // roleCmbBx.setSelectedItem(Data.getInstance().getLocaleStr(
481 // "role." + Role.REVIEWER.toString().toLowerCase()));
482
483 strengthTbl = GUITools.newStandardTable(null, false);
484
485 directoryBttn = GUITools.newImageButton(Data.getInstance().getIcon(
486 "directory_25x25_0.png"), Data.getInstance().getIcon(
487 "directory_25x25.png"));
488 directoryBttn.setToolTipText(Data.getInstance().getLocaleStr(
489 "attendee.directory"));
490 directoryBttn.addActionListener(ActionRegistry.getInstance().get(
491 SelectAttOutOfDirAction.class.getName()));
492 buttonPanel = new JPanel(new GridLayout(3, 1));
493
494 strengthTbl.addFocusListener(focusListener);
495 strengthTbl.addMouseListener(new MouseListener() {
496 @Override
497 public void mouseClicked(MouseEvent e) {
498 updateStrengthButtons();
499 }
500
501 @Override
502 public void mouseEntered(MouseEvent e) {
503 }
504
505 @Override
506 public void mouseExited(MouseEvent e) {
507 }
508
509 @Override
510 public void mousePressed(MouseEvent e) {
511 }
512
513 @Override
514 public void mouseReleased(MouseEvent e) {
515 }
516 });
517
518 addStrength = GUITools.newImageButton();
519 addStrength.setIcon(Data.getInstance().getIcon("add_25x25_0.png"));
520 addStrength
521 .setRolloverIcon(Data.getInstance().getIcon("add_25x25.png"));
522 addStrength.setToolTipText(Data.getInstance().getLocaleStr(
523 "attendeeDialog.addStrength"));
524
525 addStrength.addActionListener(new ActionListener() {
526 @Override
527 public void actionPerformed(ActionEvent ev) {
528 final String title = Data.getInstance().getLocaleStr(
529 "popup.addStrength.title");
530
531 SwingWorker<Void, Void> showPopupWorker = new SwingWorker<Void, Void>() {
532 @Override
533 protected Void doInBackground() throws Exception {
534 StrengthPopupWindow popup = new StrengthPopupWindow(UI
535 .getInstance().getAssistantDialog(), title);
536
537 /*
538 * Import the standard catalogs, if no catalogs exist in
539 * the database
540 */
541 try {
542 if (Data.getInstance().getAppData()
543 .getNumberOfCatalogs() == 0) {
544 switchToProgressMode(Data
545 .getInstance()
546 .getLocaleStr("status.importingCatalog"));
547
548 LoadStdCatalogsWorker catalogWorker = new LoadStdCatalogsWorker();
549
550 catalogWorker.execute();
551
552 while (!catalogWorker.isDone()
553 && !catalogWorker.isCancelled()) {
554 Thread.sleep(500);
555 }
556
557 switchToEditMode();
558 }
559 } catch (Exception exc) {
560 /*
561 * do nothing
562 */
563 }
564
565 /*
566 * Show the popup
567 */
568 popup.setVisible(true);
569
570 if (popup.getButtonClicked() == ButtonClicked.OK) {
571 for (String cat : popup.getSelCateList()) {
572 if (!strengthList.contains(cat)) {
573 strengthList.add(cat);
574 }
575 }
576
577 stm.fireTableDataChanged();
578
579 updateStrengthButtons();
580 }
581
582 return null;
583 }
584 };
585
586 showPopupWorker.execute();
587 }
588 });
589
590 buttonPanel.add(addStrength);
591
592 removeStrength = GUITools.newImageButton();
593 removeStrength
594 .setIcon(Data.getInstance().getIcon("remove_25x25_0.png"));
595 removeStrength.setRolloverIcon(Data.getInstance().getIcon(
596 "remove_25x25.png"));
597 removeStrength.setToolTipText(Data.getInstance().getLocaleStr(
598 "attendeeDialog.remStrength"));
599 removeStrength.addActionListener(new ActionListener() {
600 @Override
601 public void actionPerformed(ActionEvent ev) {
602 int selRow = strengthTbl.getSelectedRow();
603
604 String str = (String) stm.getValueAt(selRow, 1);
605
606 strengthList.remove(str);
607
608 stm.fireTableDataChanged();
609
610 updateStrengthButtons();
611 }
612 });
613
614 buttonPanel.add(removeStrength);
615
616 JScrollPane strScrllPn = GUITools.setIntoScrollPane(strengthTbl);
617
618 GUITools.addComponent(basePanel, gbl, nameLabel, 0, 0, 1, 1, 0, 0, 0,
619 20, 0, 20, GridBagConstraints.NONE,
620 GridBagConstraints.NORTHWEST);
621 GUITools.addComponent(basePanel, gbl, nameTxtFld, 1, 0, 3, 1, 1.0, 0,
622 0, 20, 0, 0, GridBagConstraints.HORIZONTAL,
623 GridBagConstraints.NORTHWEST);
624 GUITools.addComponent(basePanel, gbl, directoryBttn, 4, 0, 1, 1, 0, 0,
625 0, 5, 0, 20, GridBagConstraints.NONE,
626 GridBagConstraints.NORTHWEST);
627 GUITools.addComponent(basePanel, gbl, contactLabel, 0, 1, 1, 1, 0, 0,
628 5, 20, 0, 20, GridBagConstraints.NONE,
629 GridBagConstraints.NORTHWEST);
630 GUITools.addComponent(basePanel, gbl, contactScrllPn, 1, 1, 3, 3, 1.0,
631 0.5, 5, 20, 0, 0, GridBagConstraints.BOTH,
632 GridBagConstraints.NORTHWEST);
633 GUITools.addComponent(basePanel, gbl, roleLabel, 0, 4, 1, 1, 0, 0, 10,
634 20, 0, 20, GridBagConstraints.NONE,
635 GridBagConstraints.NORTHWEST);
636 GUITools.addComponent(basePanel, gbl, roleCmbBx, 1, 4, 3, 1, 1.0, 0,
637 10, 20, 0, 0, GridBagConstraints.HORIZONTAL,
638 GridBagConstraints.NORTHWEST);
639 GUITools.addComponent(basePanel, gbl, strengthLabel, 0, 5, 1, 1, 0, 0,
640 17, 20, 0, 20, GridBagConstraints.NONE,
641 GridBagConstraints.NORTHWEST);
642 GUITools.addComponent(basePanel, gbl, strScrllPn, 1, 5, 3, 2, 1.0, 0.5,
643 15, 20, 0, 0, GridBagConstraints.BOTH,
644 GridBagConstraints.NORTHWEST);
645 GUITools.addComponent(basePanel, gbl, buttonPanel, 4, 5, 1, 2, 0, 0,
646 17, 5, 0, 0, GridBagConstraints.NONE,
647 GridBagConstraints.NORTHWEST);
648
649 setCurrentAttendee(null);
650
651 basePanel.repaint();
652
653 pack();
654 }
655
656 /**
657 * Instantiates a new assistant dialog.
658 *
659 * @param parent
660 * the parent
661 */
662 public AssistantDialog(Frame parent) {
663 super(parent);
664
665 dialogLevel = Level.LEVEL1;
666 setTitle(Data.getInstance().getLocaleStr("assistantDialog.title"));
667 setIcon(Data.getInstance().getIcon("assistantDialog_64x64.png"));
668
669 addButton(buttonExit);
670 addButton(buttonBack);
671 addButton(buttonConfirm);
672
673 getContentPane().setLayout(new BorderLayout());
674 add(basePanel, BorderLayout.CENTER);
675
676 pathTxtFld.setColumns(13);
677 pathTxtFld.setText("");
678 pathTxtFld.setBorder(BorderFactory.createLineBorder(Color.GRAY));
679 pathTxtFld.addKeyListener(new KeyListener() {
680 @Override
681 public void keyPressed(KeyEvent arg0) {
682 }
683
684 @Override
685 public void keyReleased(KeyEvent e) {
686 listLastRevs.setListData(getLastReviews());
687 }
688
689 @Override
690 public void keyTyped(KeyEvent e) {
691 }
692 });
693
694 MatteBorder padding = new MatteBorder(0, 10, 0, 0, getContentPane()
695 .getBackground());
696 buttonBrowse.setBorder(padding);
697
698 buttonExit.setIcon(Data.getInstance().getIcon("buttonExit_16x16.png"));
699 buttonBack.setIcon(Data.getInstance().getIcon("buttonBack_16x16.png"));
700 buttonConfirm.setIcon(Data.getInstance().getIcon("buttonOk_16x16.png"));
701
702 buttonBrowse.setToolTipText(Data.getInstance().getLocaleStr(
703 "assistantDialog.browseToolTip"));
704 buttonBrowse.addActionListener(new ActionListener() {
705 @Override
706 public void actionPerformed(ActionEvent e) {
707 FileChooser fileChooser = UI.getInstance().getFileChooser();
708
709 if (fileChooser.showDialog(UI.getInstance()
710 .getAssistantDialog(), FileChooser.MODE_OPEN_FILE,
711 ResiFileFilter.TYPE_REVIEW) == FileChooser.SELECTED_APPROVE) {
712 String reviewPath = fileChooser.getFile().getAbsolutePath();
713
714 UI.getInstance().getAssistantDialog().setPath(reviewPath);
715
716 listLastRevs.setListData(getLastReviews());
717 }
718 }
719 });
720
721 buttonBack.addActionListener(new ActionListener() {
722 @Override
723 public void actionPerformed(ActionEvent arg0) {
724 if (dialogLevel == Level.LEVEL2) {
725 UI.getInstance().getAssistantDialog().setSelectMode();
726 dialogLevel = Level.LEVEL1;
727 } else if (dialogLevel == Level.LEVEL3) {
728 UI.getInstance().getAssistantDialog().setSelectReview();
729 dialogLevel = Level.LEVEL2;
730 }
731 }
732 });
733
734 buttonConfirm.addActionListener(new ActionListener() {
735 @Override
736 public void actionPerformed(ActionEvent e) {
737 // No review path
738 if (UI.getInstance().getAssistantDialog().getSelected() == AssistantDialog.Selection.LOAD_REVIEW
739 && UI.getInstance().getAssistantDialog().getPath()
740 .equals("")) {
741 JOptionPane.showMessageDialog(UI.getInstance()
742 .getAssistantDialog(), GUITools.getMessagePane(Data
743 .getInstance().getLocaleStr(
744 "message.selectReviewToLoad")), Data
745 .getInstance().getLocaleStr("error"),
746 JOptionPane.ERROR_MESSAGE);
747
748 return;
749 }
750
751 // Set AddAttendee screen
752 if (UI.getInstance().getAssistantDialog().getSelected() == AssistantDialog.Selection.NEW_REVIEW
753 && Data.getInstance().getMode().equals("instant")
754 && dialogLevel == Level.LEVEL2) {
755 setAddAttToInstRev();
756
757 dialogLevel = Level.LEVEL3;
758
759 return;
760 }
761
762 // Do some checks and updates on level 3
763 if (dialogLevel == Level.LEVEL3) {
764
765
766 if (!nameTxtFld.getText().trim().equals("")) {
767 ActionRegistry.getInstance().get(
768 InitializeMainFrameAction.class.getName())
769 .actionPerformed(e);
770 updateInstantAtt();
771 }else{
772 String message="";
773 message = Data.getInstance().getLocaleStr(
774 "attendeeDialog.message.noName");
775
776 setMessage(message);
777 nameTxtFld.setBorder(UI.MARKED_BORDER_INLINE);
778 }
779
780 return;
781 }
782
783 ActionRegistry.getInstance().get(
784 InitializeMainFrameAction.class.getName())
785 .actionPerformed(e);
786 }
787 });
788
789 setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
790
791 setSelectMode();
792
793 setMinimumSize(new Dimension(550, 500));
794
795 pack();
796 }
797
798 /*
799 * (non-Javadoc)
800 *
801 * @see org.revager.gui.AbstractDialog#setVisible(boolean)
802 */
803 @Override
804 public void setVisible(boolean vis) {
805 if (vis) {
806 setLocationToCenter();
807
808 }
809
810 super.setVisible(vis);
811 }
812
813 /**
814 * Gets the last reviews.
815 *
816 * @return the last reviews
817 */
818 private Vector<String> getLastReviews() {
819 Vector<String> vecLastReviews = new Vector<String>();
820
821 try {
822 for (String rev : Data.getInstance().getAppData().getLastReviews()) {
823 vecLastReviews.add(new File(rev).getName());
824 }
825 } catch (DataException exc) {
826 JOptionPane.showMessageDialog(null, GUITools.getMessagePane(exc
827 .getMessage()), Data.getInstance().getLocaleStr("error"),
828 JOptionPane.ERROR_MESSAGE);
829 }
830
831 return vecLastReviews;
832 }
833
834 private FocusListener focusListener = new FocusListener() {
835 @Override
836 public void focusGained(FocusEvent e) {
837 if (e.getSource() != strengthTbl) {
838 if (strengthTbl.getRowCount() > 0) {
839 strengthTbl.removeRowSelectionInterval(0, strengthTbl
840 .getRowCount() - 1);
841
842 updateStrengthButtons();
843 }
844 }
845 }
846
847 @Override
848 public void focusLost(FocusEvent e) {
849 }
850 };
851
852 /**
853 * Update strength buttons.
854 */
855 private void updateStrengthButtons() {
856 if (strengthTbl.getSelectedRow() != -1 && strengthTbl.isEnabled()) {
857 removeStrength.setEnabled(true);
858 } else {
859 removeStrength.setEnabled(false);
860 }
861 }
862
863 /**
864 * Sets the current app attendee.
865 *
866 * @param appAtt
867 * the new current app attendee
868 */
869 public void setCurrentAppAttendee(AppAttendee appAtt) {
870 this.currentAppAttendee = appAtt;
871
872 nameTxtFld.setBorder(UI.STANDARD_BORDER_INLINE);
873 contactScrllPn.setBorder(UI.STANDARD_BORDER);
874
875 nameTxtFld.setText(currentAppAttendee.getName());
876
877 try {
878 contactTxtArea.setText(currentAppAttendee.getContact());
879 } catch (DataException e) {
880 JOptionPane.showMessageDialog(this, GUITools.getMessagePane(e
881 .getMessage()), Data.getInstance().getLocaleStr("error"),
882 JOptionPane.ERROR_MESSAGE);
883 }
884
885 updateStrengthTable();
886 }
887
888 /**
889 * Sets the current attendee.
890 *
891 * @param att
892 * the new current attendee
893 */
894 public void setCurrentAttendee(Attendee att) {
895 //currentAttendee = att;
896 currentAppAttendee = null;
897
898 nameTxtFld.setText(null);
899 contactTxtArea.setText(null);
900 roleCmbBx.setSelectedItem(Data.getInstance().getLocaleStr(
901 "role." + Role.REVIEWER.toString().toLowerCase()));
902
903 updateStrengthTable();
904 }
905
906 /**
907 * Update strength table.
908 */
909 private void updateStrengthTable() {
910
911 try {
912 strengthList = currentAppAttendee.getStrengths();
913 } catch (Exception e) {
914 strengthList = new ArrayList<String>();
915 }
916
917 if (stm == null) {
918 stm = new StrengthTableModel();
919 strengthTbl.setModel(stm);
920 }
921
922 stm.fireTableDataChanged();
923
924 /*
925 * View of strengths
926 */
927 boolean enable = false;
928
929 if (((String) roleCmbBx.getSelectedItem()).equals(Data.getInstance()
930 .getLocaleStr("role.reviewer"))) {
931 enable = true;
932 }
933
934 addStrength.setEnabled(enable);
935 removeStrength.setEnabled(false);
936 strengthTbl.setEnabled(enable);
937 strengthLabel.setEnabled(enable);
938
939 if (enable) {
940 strengthTbl.setForeground(Color.BLACK);
941 } else {
942 strengthTbl.setForeground(Color.GRAY);
943 }
944 }
945
946 /**
947 * Gets the strength list.
948 *
949 * @return the strengthList
950 */
951 public List<String> getStrengthList() {
952 if (strengthList == null) {
953 strengthList = new ArrayList<String>();
954 }
955
956 return strengthList;
957 }
958
959 /**
960 * Adds instant reviewer
961 *
962 */
963 public void updateInstantAtt() {
964
965 Role[] roles = Role.values();
966 String attContact;
967
968 nameTxtFld.setBorder(UI.STANDARD_BORDER_INLINE);
969 contactScrllPn.setBorder(UI.STANDARD_BORDER);
970
971 String attName = nameTxtFld.getText();
972 if (contactTxtArea.getText() != null)
973 attContact = contactTxtArea.getText();
974 else
975 attContact = "";
976
977 Role attRole = roles[roleCmbBx.getSelectedIndex()];
978
979 nameMissing = false;
980
981
982
983 /*
984 * Update the app attendee in the database
985 */
986 try {
987 if (currentAppAttendee == null) {
988 currentAppAttendee = Data.getInstance().getAppData()
989 .getAttendee(attName, attContact);
990
991 if (currentAppAttendee == null) {
992 currentAppAttendee = Data.getInstance().getAppData()
993 .newAttendee(attName, attContact);
994 }
995 } else {
996 currentAppAttendee.setNameAndContact(attName, attContact);
997 }
998
999 for (String str : currentAppAttendee.getStrengths()) {
1000 currentAppAttendee.removeStrength(str);
1001 }
1002
1003 for (String str : strengthList) {
1004 currentAppAttendee.addStrength(str);
1005 }
1006 } catch (DataException e1) {
1007 JOptionPane.showMessageDialog(UI.getInstance()
1008 .getAssistantDialog(), GUITools.getMessagePane(e1
1009 .getMessage()), Data.getInstance()
1010 .getLocaleStr("error"), JOptionPane.ERROR_MESSAGE);
1011 }
1012
1013 /*
1014 * update the review attendee
1015 */
1016 Attendee newAtt = new Attendee();
1017
1018 newAtt.setName(attName);
1019 newAtt.setContact(attContact);
1020 newAtt.setRole(attRole);
1021
1022 Application.getInstance().getAttendeeMgmt().addAttendee(attName,
1023 attContact, attRole, null);
1024
1025 setVisible(false);
1026
1027 UI.getInstance().getAspectsManagerFrame().updateViews();
1028
1029
1030 }
1031
1032 /**
1033 * Gets the dialog level
1034 *
1035 * @return dialogLevel
1036 */
1037 public Level getLevel() {
1038
1039 return dialogLevel;
1040 }
1041
1042}
10430
=== modified file 'src/org/revager/gui/dialogs/EditProductDialog.java'
--- src/org/revager/gui/dialogs/EditProductDialog.java 2010-01-31 17:32:35 +0000
+++ src/org/revager/gui/dialogs/EditProductDialog.java 2010-05-26 20:44:25 +0000
@@ -55,7 +55,6 @@
55import org.revager.gui.models.ReferenceTableModel;55import org.revager.gui.models.ReferenceTableModel;
56import org.revager.tools.GUITools;56import org.revager.tools.GUITools;
5757
58
59/**58/**
60 * The Class EditProductDialog.59 * The Class EditProductDialog.
61 */60 */
6261
=== modified file 'src/org/revager/gui/dialogs/SettingsDialog.java'
--- src/org/revager/gui/dialogs/SettingsDialog.java 2010-01-31 17:32:35 +0000
+++ src/org/revager/gui/dialogs/SettingsDialog.java 2010-05-26 20:44:25 +0000
@@ -63,7 +63,6 @@
63import org.revager.tools.FileTools;63import org.revager.tools.FileTools;
64import org.revager.tools.GUITools;64import org.revager.tools.GUITools;
6565
66
67/**66/**
68 * The Class SettingsDialog.67 * The Class SettingsDialog.
69 */68 */
@@ -314,8 +313,8 @@
314 if (currentLang.equals(selectedLang)) {313 if (currentLang.equals(selectedLang)) {
315 setMessage(null);314 setMessage(null);
316 } else {315 } else {
317 setMessage(Data.getInstance()316 setMessage(Data.getInstance().getLocaleStr(
318 .getLocaleStr("settingsDialog.general.langHintRestart"));317 "settingsDialog.general.langHintRestart"));
319 }318 }
320 }319 }
321 });320 });
322321
=== added directory 'src/org/revager/gui/dialogs/assistant'
=== added file 'src/org/revager/gui/dialogs/assistant/AssistantDialog.java'
--- src/org/revager/gui/dialogs/assistant/AssistantDialog.java 1970-01-01 00:00:00 +0000
+++ src/org/revager/gui/dialogs/assistant/AssistantDialog.java 2010-05-26 20:44:25 +0000
@@ -0,0 +1,283 @@
1/*
2 * Copyright 2009 Davide Casciato, Sandra Reich, Johannes Wettinger
3 *
4 * This file is part of Resi.
5 *
6 * Resi is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * Resi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with Resi. If not, see <http://www.gnu.org/licenses/>.
18 */
19package org.revager.gui.dialogs.assistant;
20
21import java.awt.BorderLayout;
22import java.awt.Container;
23import java.awt.Dimension;
24import java.awt.Frame;
25import java.awt.event.ActionEvent;
26import java.awt.event.ActionListener;
27
28import javax.swing.ImageIcon;
29import javax.swing.JButton;
30import javax.swing.JDialog;
31
32import org.revager.app.model.Data;
33import org.revager.gui.AbstractDialog;
34import org.revager.gui.UI;
35import org.revager.gui.actions.ActionRegistry;
36import org.revager.gui.actions.InitializeNewReviewAction;
37import org.revager.gui.actions.assistant.GoToFirstScreenPnlAction;
38
39/**
40 * The class AssistantDialog.
41 *
42 * @author D.Casciato
43 *
44 */
45@SuppressWarnings("serial")
46public class AssistantDialog extends AbstractDialog {
47
48 private Container currentPnl;
49 private FirstScreenPanel firstScreenPanel = new FirstScreenPanel(this);
50 private OpenReviewPanel openReviewPanel = new OpenReviewPanel(this);
51 private Container addAttendeePanel = UI.getInstance().getAttendeeDialog()
52 .getContentPane();
53
54 private ImageIcon revagerIcon = Data.getInstance().getIcon(
55 "revager_50x50.png");
56
57 /**
58 * Action to shut down the application.
59 */
60 private ActionListener exitApp = new ActionListener() {
61
62 @Override
63 public void actionPerformed(ActionEvent e) {
64 System.exit(0);
65 }
66
67 };
68
69 /**
70 * Action to initialize a new review.
71 */
72 private ActionListener initQuickRev = ActionRegistry.getInstance().get(
73 InitializeNewReviewAction.class.getName());
74
75 /*
76 * Strings
77 */
78 private String firstScreenDescStrng = Data.getInstance().getLocaleStr(
79 "assistantDialog.firstDesc");
80
81 private String openRevDescStrng = Data.getInstance().getLocaleStr(
82 "assistantDialog.openDesc");
83
84 private String addAttDescStrng = Data.getInstance().getLocaleStr(
85 "addYourself.description");
86 private String localMode = "moderator";
87
88 /*
89 *
90 * Wizard buttons
91 */
92 private JButton backBttn = new JButton();
93 private JButton finishBttn = new JButton();
94 private ImageIcon confirmIcon = Data.getInstance().getIcon(
95 "buttonOk_16x16.png");
96 private String confirmString = Data.getInstance().getLocaleStr("confirm");
97
98 /**
99 * Sets the localMode parameter
100 *
101 * @param string
102 */
103 public void setLocalMode(String string) {
104 this.localMode = string;
105
106 }
107
108 /**
109 * Returns the currentPanel.
110 *
111 * @return
112 */
113 public Container getCurrentPnl() {
114 return currentPnl;
115 }
116
117 /**
118 * Sets the currentPanel.
119 *
120 * @param currentPnl
121 */
122 public void setCurrentPnl(Container currentPnl) {
123
124 this.currentPnl = currentPnl;
125
126 }
127
128 /**
129 * Returns the FirstScreenPanel.
130 *
131 * @return
132 */
133 public FirstScreenPanel getFirstScreenPanel() {
134 return firstScreenPanel;
135 }
136
137 /**
138 * Returns the OpenReviewPanel.
139 *
140 * @return
141 */
142 public OpenReviewPanel getOpenReviewPanel() {
143 return openReviewPanel;
144 }
145
146 /**
147 * Returns the AddAttendeePanel.
148 *
149 * @return
150 */
151 public Container getAddAttendeePanel() {
152 return addAttendeePanel;
153 }
154
155 /**
156 * Returns the BackButton.
157 *
158 * @return
159 */
160 public JButton getBackBttn() {
161 return backBttn;
162 }
163
164 /**
165 * constructor
166 *
167 * @param parent
168 */
169 public AssistantDialog(Frame parent) {
170 super(parent);
171
172 defineWizardBttns();
173 Data.getInstance().setMode("moderator");
174 setIcon(revagerIcon);
175 setCurrentPnl(firstScreenPanel);
176 getContentPane().setLayout(new BorderLayout());
177 backBttn.addActionListener(ActionRegistry.getInstance().get(
178 GoToFirstScreenPnlAction.class.getName()));
179
180 updateContents();
181
182 setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
183
184 setMinimumSize(new Dimension(650, 500));
185
186 pack();
187 }
188
189 /**
190 * Defines the wizard buttons ; should be invoked in the constructor once.
191 */
192 private void defineWizardBttns() {
193
194 backBttn.setText(Data.getInstance().getLocaleStr("back"));
195 backBttn.setIcon(Data.getInstance().getIcon("buttonBack_16x16.png"));
196
197 finishBttn.setText(confirmString);
198 finishBttn.setIcon(confirmIcon);
199
200 this.addButton(backBttn);
201 this.addButton(finishBttn);
202
203 backBttn.setEnabled(false);
204 finishBttn.setEnabled(false);
205 }
206
207 /**
208 * Updates the wizard buttons and should be invoked after the content has
209 * changed.
210 */
211 public void updateWizardBttns() {
212 finishBttn.removeActionListener(exitApp);
213 finishBttn.removeActionListener(openReviewPanel.openExistRev);
214 finishBttn.removeActionListener(initQuickRev);
215
216 if (currentPnl == firstScreenPanel) {
217
218 backBttn.setEnabled(false);
219 finishBttn.setEnabled(false);
220
221 } else if (currentPnl == addAttendeePanel) {
222
223 backBttn.setEnabled(true);
224 finishBttn.setEnabled(true);
225 finishBttn.addActionListener(initQuickRev);
226
227 } else if (currentPnl == openReviewPanel) {
228
229 backBttn.setEnabled(true);
230 finishBttn.setEnabled(true);
231 finishBttn.addActionListener(openReviewPanel.openExistRev);
232 if (openReviewPanel.getLastRevsVector().size() == 0)
233 finishBttn.setEnabled(false);
234
235 }
236 }
237
238 /**
239 * Updates the content area.
240 */
241 public void updateContents() {
242
243 this.getContentPane().removeAll();
244
245 updateMessage();
246
247 if (currentPnl == firstScreenPanel) {
248 this.getContentPane().add(firstScreenPanel, BorderLayout.CENTER);
249 Data.getInstance().setMode("moderator");
250 } else if (currentPnl == addAttendeePanel) {
251 this.getContentPane().add(addAttendeePanel, BorderLayout.CENTER);
252 Data.getInstance().setMode("instant");
253
254 UI.getInstance().getAttendeeDialog().setCurrentAttendee(null);
255 UI.getInstance().getAttendeeDialog().getNameTxtFld().setText(
256 System.getProperty("user.name"));
257 } else if (currentPnl == openReviewPanel) {
258 this.getContentPane().add(openReviewPanel, BorderLayout.CENTER);
259 Data.getInstance().setMode(localMode);
260 }
261
262 this.getContentPane().validate();
263 this.getContentPane().repaint();
264
265 }
266
267 /**
268 * Updates the description of the assistant, depending from the
269 * currentPanel.
270 */
271 public void updateMessage() {
272
273 if (currentPnl == firstScreenPanel) {
274 setDescription(firstScreenDescStrng);
275 } else if (currentPnl == addAttendeePanel) {
276 setDescription(addAttDescStrng);
277 } else if (currentPnl == openReviewPanel) {
278 setDescription(openRevDescStrng);
279 }
280
281 }
282
283}
0284
=== added file 'src/org/revager/gui/dialogs/assistant/FirstScreenPanel.java'
--- src/org/revager/gui/dialogs/assistant/FirstScreenPanel.java 1970-01-01 00:00:00 +0000
+++ src/org/revager/gui/dialogs/assistant/FirstScreenPanel.java 2010-05-26 20:44:25 +0000
@@ -0,0 +1,193 @@
1/*
2 * Copyright 2009 Davide Casciato, Sandra Reich, Johannes Wettinger
3 *
4 * This file is part of Resi.
5 *
6 * Resi is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * Resi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with Resi. If not, see <http://www.gnu.org/licenses/>.
18 */
19package org.revager.gui.dialogs.assistant;
20
21import java.awt.GridBagConstraints;
22import java.awt.GridBagLayout;
23import java.awt.event.ActionListener;
24
25import javax.swing.ImageIcon;
26import javax.swing.JSeparator;
27import javax.swing.SwingConstants;
28
29import org.revager.app.model.Data;
30import org.revager.gui.AbstractDialog;
31import org.revager.gui.AbstractDialogPanel;
32import org.revager.gui.actions.ActionRegistry;
33import org.revager.gui.actions.InitializeNewReviewAction;
34import org.revager.gui.actions.OpenAspectsManagerAction;
35import org.revager.gui.actions.assistant.GoToAddAttPnlAction;
36import org.revager.gui.actions.assistant.GoToOpenRevPnlAction;
37import org.revager.gui.actions.assistant.SelectLanguageAction;
38import org.revager.gui.helpers.HLink;
39import org.revager.gui.helpers.VLink;
40import org.revager.tools.GUITools;
41
42/**
43 * The class FirstScreenPanel.
44 *
45 * @author D.Casciato
46 *
47 */
48
49@SuppressWarnings("serial")
50public class FirstScreenPanel extends AbstractDialogPanel {
51
52 private JSeparator dottedSprtr = new JSeparator(SwingConstants.HORIZONTAL);
53
54 private GridBagLayout gbl1 = new GridBagLayout();
55
56
57 /**
58 * Action to select a language.
59 */
60 private ActionListener selectLanguageAction = ActionRegistry.getInstance()
61 .get(SelectLanguageAction.class.getName());
62 /**
63 * Action to open up the Aspects-Manager.
64 */
65 private ActionListener openAspMngrAction = ActionRegistry.getInstance()
66 .get(OpenAspectsManagerAction.class.getName());
67
68 /*
69 * Strings
70 */
71 private String quickRevTooltipStrng = Data.getInstance().getLocaleStr(
72 "assistantDialog.quickRev.rollover");
73 private String newRevTooltipStrng = Data.getInstance().getLocaleStr(
74 "assistantDialog.newRev.rollover");
75 private String openRevTooltipStrng = Data.getInstance().getLocaleStr(
76 "assistantDialog.openRev.rollover");
77 private String selectLanguageTooltipStrng = Data.getInstance()
78 .getLocaleStr("assistantDialog.selectLanguage.rollover");
79 private String openAspectsMngrTooltipStrng = Data.getInstance()
80 .getLocaleStr("assistantDialog.openAspectsMngr.rollover");
81
82 private String openRevStrng = Data.getInstance().getLocaleStr(
83 "assistantDialog.openReview");
84
85 private String languageStrng = Data.getInstance().getLocaleStr(
86 "assistantDialog.selectLanguage");
87 private String aspectsManagerStrng = Data.getInstance().getLocaleStr(
88 "assistantDialog.aspectsManager");
89 private String newReviewStrng = Data.getInstance().getLocaleStr(
90 "assistantDialog.newReview");
91 private String quickstartStrng = Data.getInstance().getLocaleStr(
92 "assistantDialog.quickstart");
93
94 /*
95 *ImageIcons
96 */
97 private ImageIcon moderatorIcon = Data.getInstance().getIcon(
98 "moderator_128x128_0.png");
99 private ImageIcon moderatorRolloverIcon = Data.getInstance().getIcon(
100 "moderator_128x128.png");
101 private ImageIcon openRevIcon = Data.getInstance().getIcon(
102 "scribe_128x128_0.png");
103 private ImageIcon openRevRolloverIcon = Data.getInstance().getIcon(
104 "scribe_128x128.png");
105 private ImageIcon quickstartIcon = Data.getInstance().getIcon(
106 "instantReview_128x128_0.png");
107 private ImageIcon quickstartRolloverIcon = Data.getInstance().getIcon(
108 "instantReview_128x128.png");
109 private ImageIcon languageIcon = Data.getInstance().getIcon(
110 "language_31x20_0.png");
111 private ImageIcon languageRolloverIcon = Data.getInstance().getIcon(
112 "language_31x20.png");
113 private ImageIcon aspectsManagerIcon = Data.getInstance().getIcon(
114 "aspectsManager_25x25_0.png");
115 private ImageIcon aspectsManagerRolloverIcon = Data.getInstance().getIcon(
116 "aspectsManager_25x25.png");
117
118 /*
119 * Links
120 */
121 private VLink newReviewLnk = new VLink(newReviewStrng, moderatorIcon,
122 moderatorRolloverIcon);
123 private VLink quickstartLnk = new VLink(quickstartStrng, quickstartIcon,
124 quickstartRolloverIcon);
125 private VLink openReviewLnk = new VLink(openRevStrng, openRevIcon,
126 openRevRolloverIcon);
127 private HLink selectLanguageLnk = new HLink(languageStrng, languageIcon,
128 languageRolloverIcon, null);
129 private HLink openAspManagerLnk = new HLink(aspectsManagerStrng,
130 aspectsManagerIcon, aspectsManagerRolloverIcon, null);
131
132 /**
133 * Constructor
134 *
135 * @param parent
136 */
137 public FirstScreenPanel(AbstractDialog parent) {
138 super(parent);
139 createFirstScreenPnl();
140 }
141
142 /**
143 * Method which creates and locates the components of the panel.
144 */
145 private void createFirstScreenPnl() {
146
147 quickstartLnk.setFather(this);
148 newReviewLnk.setFather(this);
149 openReviewLnk.setFather(this);
150 selectLanguageLnk.setFather(this);
151 openAspManagerLnk.setFather(this);
152
153 newReviewLnk.addActionListener(ActionRegistry.getInstance().get(
154 InitializeNewReviewAction.class.getName()));
155
156 openReviewLnk.addActionListener(ActionRegistry.getInstance().get(GoToOpenRevPnlAction.class.getName()));
157 quickstartLnk.addActionListener(ActionRegistry.getInstance().get(GoToAddAttPnlAction.class.getName()));
158 selectLanguageLnk.addActionListener(selectLanguageAction);
159 openAspManagerLnk.addActionListener(openAspMngrAction);
160
161 selectLanguageLnk.setUnderlined(true);
162 openAspManagerLnk.setUnderlined(true);
163
164 quickstartLnk.addRolloverText(quickRevTooltipStrng);
165
166 openReviewLnk.addRolloverText(openRevTooltipStrng);
167 newReviewLnk.addRolloverText(newRevTooltipStrng);
168 selectLanguageLnk.addRolloverText(selectLanguageTooltipStrng);
169 openAspManagerLnk.addRolloverText(openAspectsMngrTooltipStrng);
170
171 this.setLayout(gbl1);
172 GUITools.addComponent(this, gbl1, newReviewLnk, 0, 0, 1, 1,
173 1.0, 1.0, 0, 20, 0, 20, GridBagConstraints.BOTH,
174 GridBagConstraints.NORTHWEST);
175 GUITools.addComponent(this, gbl1, quickstartLnk, 1, 0, 1,
176 1, 1.0, 1.0, 0, 20, 0, 20, GridBagConstraints.BOTH,
177 GridBagConstraints.NORTHWEST);
178 GUITools.addComponent(this, gbl1, openReviewLnk, 2, 0, 1,
179 1, 1.0, 1.0, 0, 20, 0, 20, GridBagConstraints.BOTH,
180 GridBagConstraints.NORTHWEST);
181 GUITools.addComponent(this, gbl1, dottedSprtr, 0, 1, 3, 1,
182 1.0, 0.0, 20, 20, 0, 0, GridBagConstraints.HORIZONTAL,
183 GridBagConstraints.CENTER);
184 GUITools.addComponent(this, gbl1, selectLanguageLnk, 0, 2,
185 1, 1, 1.0, 0.0, 20, 20, 0, 0, GridBagConstraints.HORIZONTAL,
186 GridBagConstraints.CENTER);
187 GUITools.addComponent(this, gbl1, openAspManagerLnk, 2, 2,
188 1, 1, 1.0, 0.0, 20, 0, 0, 0, GridBagConstraints.HORIZONTAL,
189 GridBagConstraints.CENTER);
190
191 }
192
193}
0194
=== added file 'src/org/revager/gui/dialogs/assistant/LanguagePopupWindow.java'
--- src/org/revager/gui/dialogs/assistant/LanguagePopupWindow.java 1970-01-01 00:00:00 +0000
+++ src/org/revager/gui/dialogs/assistant/LanguagePopupWindow.java 2010-05-26 20:44:25 +0000
@@ -0,0 +1,227 @@
1/*
2 * Copyright 2009 Davide Casciato, Sandra Reich, Johannes Wettinger
3 *
4 * This file is part of Resi.
5 *
6 * Resi is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * Resi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with Resi. If not, see <http://www.gnu.org/licenses/>.
18 */
19package org.revager.gui.dialogs.assistant;
20
21import java.awt.BorderLayout;
22import java.awt.Dimension;
23import java.awt.GridBagConstraints;
24import java.awt.GridBagLayout;
25import java.awt.Window;
26
27import javax.swing.BorderFactory;
28import javax.swing.ImageIcon;
29import javax.swing.JButton;
30import javax.swing.JDialog;
31import javax.swing.JPanel;
32import javax.swing.JTextArea;
33
34import org.revager.app.model.ApplicationData;
35import org.revager.app.model.Data;
36import org.revager.app.model.DataException;
37import org.revager.app.model.appdata.AppSettingKey;
38import org.revager.gui.UI;
39import org.revager.gui.actions.popup.LanguagePopupWindowAction;
40import org.revager.gui.helpers.HLink;
41import org.revager.gui.helpers.LinkGroup;
42import org.revager.tools.GUITools;
43
44/**
45 * The Class LanguagePopupWindow.
46 *
47 * @author D.Casciato
48 *
49 */
50@SuppressWarnings("serial")
51public class LanguagePopupWindow extends JDialog {
52
53 /**
54 * The Enum ButtonClicked.
55 */
56 public static enum ButtonClicked {
57 OK, ABORT;
58 };
59
60 private ApplicationData appData = Data.getInstance().getAppData();
61
62 private ButtonClicked buttonClicked = null;
63
64 private GridBagLayout gbl = new GridBagLayout();
65 /*
66 * Panels
67 */
68 private JPanel inputPnl = new JPanel(gbl);
69 private JPanel panelBase = GUITools.newPopupBasePanel();
70
71 /*
72 * Strings
73 */
74 private String germanStrng = Data.getInstance().getLocaleStr(
75 "popup.language.german");
76 private String englishStrng = Data.getInstance().getLocaleStr(
77 "popup.language.english");
78
79 /*
80 * ImageIcons
81 */
82 private ImageIcon germanIcon = Data.getInstance().getIcon(
83 "german_31x20_0.png");
84 private ImageIcon germanRolloverIcon = Data.getInstance().getIcon(
85 "german_31x20.png");
86 private ImageIcon englishIcon = Data.getInstance().getIcon(
87 "english_31x20_0.png");
88 private ImageIcon englishRolloverIcon = Data.getInstance().getIcon(
89 "english_31x20.png");
90 private String currentLang;
91
92 /*
93 * Links and LinkGroup
94 */
95 private LinkGroup languageGrp = new LinkGroup();
96 private HLink germanHLnk = new HLink(germanStrng, germanIcon,
97 germanRolloverIcon, languageGrp);
98 private HLink englishHLnk = new HLink(englishStrng, englishIcon,
99 englishRolloverIcon, languageGrp);
100
101 /**
102 * Returns the selected language.
103 *
104 * @return
105 */
106 public String getSelectedLanguage() {
107 if (languageGrp.getSelectedLinkText().contains(
108 Data.getInstance().getLocaleStr("popup.language.german")))
109 return "de";
110 else
111 return "en";
112 }
113
114 /**
115 * Constructor
116 *
117 * @param parent
118 * @param titleText
119 */
120 public LanguagePopupWindow(Window parent, String titleText) {
121 super(parent);
122
123 setLayout(new BorderLayout());
124
125 setUndecorated(true);
126
127 setModal(true);
128
129 JTextArea textTitle = GUITools.newPopupTitleArea(titleText);
130
131 panelBase.add(textTitle, BorderLayout.NORTH);
132
133 try {
134 currentLang = appData.getSetting(AppSettingKey.APP_LANGUAGE);
135 } catch (DataException e) {
136 currentLang = null;
137 }
138 languageGrp.addLink(germanHLnk);
139 languageGrp.addLink(englishHLnk);
140
141 if (currentLang.equals("de"))
142 languageGrp.selectLink(germanHLnk);
143 else if (currentLang.equals("en"))
144 languageGrp.selectLink(englishHLnk);
145
146 GUITools.addComponent(inputPnl, gbl, germanHLnk, 0, 0, 1, 1, 1.0, 1.0,
147 10, 10, 0, 10, GridBagConstraints.BOTH,
148 GridBagConstraints.CENTER);
149 GUITools.addComponent(inputPnl, gbl, englishHLnk, 0, 1, 1, 1, 1.0, 1.0,
150 10, 10, 10, 10, GridBagConstraints.BOTH,
151 GridBagConstraints.CENTER);
152
153 panelBase.add(inputPnl, BorderLayout.CENTER);
154
155 /*
156 * The buttons to abort and confirm the input
157 */
158 JButton buttonAbort = GUITools.newImageButton();
159 buttonAbort.setIcon(Data.getInstance().getIcon(
160 "buttonCancel_24x24_0.png"));
161 buttonAbort.setRolloverIcon(Data.getInstance().getIcon(
162 "buttonCancel_24x24.png"));
163 buttonAbort.setToolTipText(Data.getInstance().getLocaleStr("abort"));
164 buttonAbort.addActionListener(new LanguagePopupWindowAction(this,
165 ButtonClicked.ABORT));
166
167 JButton buttonConfirm = GUITools.newImageButton();
168 buttonConfirm.setIcon(Data.getInstance()
169 .getIcon("buttonOk_24x24_0.png"));
170 buttonConfirm.setRolloverIcon(Data.getInstance().getIcon(
171 "buttonOk_24x24.png"));
172 buttonConfirm
173 .setToolTipText(Data.getInstance().getLocaleStr("confirm"));
174 buttonConfirm.addActionListener(new LanguagePopupWindowAction(this,
175 ButtonClicked.OK));
176
177 JPanel panelButtons = new JPanel(new BorderLayout());
178 panelButtons.setBackground(UI.POPUP_BACKGROUND);
179 panelButtons.setBorder(BorderFactory.createLineBorder(panelButtons
180 .getBackground(), 3));
181 panelButtons.add(buttonAbort, BorderLayout.WEST);
182 panelButtons.add(buttonConfirm, BorderLayout.EAST);
183
184 /*
185 * Base panel
186 */
187 panelBase.add(panelButtons, BorderLayout.SOUTH);
188
189 add(panelBase, BorderLayout.CENTER);
190
191 /*
192 * Set size and location
193 */
194 Dimension popupSize = new Dimension(130, 170);
195
196 setMinimumSize(popupSize);
197 setSize(popupSize);
198 setPreferredSize(popupSize);
199
200 pack();
201
202 setAlwaysOnTop(true);
203 toFront();
204
205 GUITools.setLocationToCursorPos(this);
206 }
207
208 /**
209 * Gets the button clicked.
210 *
211 * @return the buttonClicked
212 */
213 public ButtonClicked getButtonClicked() {
214 return buttonClicked;
215 }
216
217 /**
218 * Sets the button clicked.
219 *
220 * @param buttonClicked
221 * the buttonClicked to set
222 */
223 public void setButtonClicked(ButtonClicked buttonClicked) {
224 this.buttonClicked = buttonClicked;
225 }
226
227}
0228
=== added file 'src/org/revager/gui/dialogs/assistant/OpenReviewPanel.java'
--- src/org/revager/gui/dialogs/assistant/OpenReviewPanel.java 1970-01-01 00:00:00 +0000
+++ src/org/revager/gui/dialogs/assistant/OpenReviewPanel.java 2010-05-26 20:44:25 +0000
@@ -0,0 +1,310 @@
1/*
2 * Copyright 2009 Davide Casciato, Sandra Reich, Johannes Wettinger
3 *
4 * This file is part of Resi.
5 *
6 * Resi is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * Resi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with Resi. If not, see <http://www.gnu.org/licenses/>.
18 */
19package org.revager.gui.dialogs.assistant;
20
21import java.awt.Font;
22import java.awt.GridBagConstraints;
23import java.awt.GridBagLayout;
24import java.awt.event.ActionEvent;
25import java.awt.event.ActionListener;
26import java.io.File;
27import java.util.List;
28import java.util.Vector;
29
30import javax.swing.ImageIcon;
31import javax.swing.JLabel;
32import javax.swing.JOptionPane;
33import javax.swing.JSeparator;
34import javax.swing.SwingConstants;
35
36import org.revager.app.ResiFileFilter;
37import org.revager.app.model.Data;
38import org.revager.app.model.DataException;
39import org.revager.gui.AbstractDialog;
40import org.revager.gui.AbstractDialogPanel;
41import org.revager.gui.UI;
42import org.revager.gui.helpers.FileChooser;
43import org.revager.gui.helpers.HLink;
44import org.revager.gui.helpers.LinkGroup;
45import org.revager.gui.workers.LoadReviewWorker;
46import org.revager.tools.GUITools;
47
48/**
49 * The class OpenReviewPanel.
50 *
51 * @author D.Casciato
52 *
53 */
54@SuppressWarnings("serial")
55public class OpenReviewPanel extends AbstractDialogPanel{
56
57 private GridBagLayout gbl2 = new GridBagLayout();
58
59
60 /*
61 * Strings
62 */
63 private String moderatorStrng = Data.getInstance().getLocaleStr(
64 "mode.moderator");
65 private String scribeStrng = Data.getInstance().getLocaleStr(
66 "mode.scribeOrSingle");
67 private String anotherRevStrng = Data.getInstance().getLocaleStr(
68 "assistantDialog.selectAnotherRev");
69 private String noRevsStrng = Data.getInstance().getLocaleStr(
70 "assistantDialog.noRevs");;
71 private String firstRevStrng;
72 private String secondRevStrng;
73 private String thirdRevStrng;
74 private String fourthRevStrng;
75
76 /*
77 * ImageIcons
78 */
79 private ImageIcon smallModeratorIcon = Data.getInstance().getIcon(
80 "moderator_50x50_0.png");
81 private ImageIcon smallModeratorRolloverIcon = Data.getInstance().getIcon(
82 "moderator_50x50.png");
83 private ImageIcon scribeIcon = Data.getInstance().getIcon(
84 "scribe_50x50_0.png");
85 private ImageIcon scribeRolloverIcon = Data.getInstance().getIcon(
86 "scribe_50x50.png");
87 private ImageIcon reviewIcon = Data.getInstance().getIcon(
88 "review_40x40_0.png");
89 private ImageIcon reviewRolloverIcon = Data.getInstance().getIcon(
90 "review_40x40.png");
91 private ImageIcon browseIcon = Data.getInstance().getIcon(
92 "open_40x40_0.png");
93 private ImageIcon browseRolloverIcon = Data.getInstance().getIcon(
94 "open_40x40.png");
95
96 /*
97 * links and LinkGroups
98 */
99 private LinkGroup modeGrp = new LinkGroup();
100 private HLink moderatorLnk = new HLink(moderatorStrng, smallModeratorIcon,
101 smallModeratorRolloverIcon, modeGrp);
102 private HLink scribeSingleRevLnk = new HLink(scribeStrng, scribeIcon,
103 scribeRolloverIcon, modeGrp);
104
105 private LinkGroup lastRevsGrp = new LinkGroup();
106 private HLink firstReviewLnk;
107 private HLink secondReviewLnk;
108 private HLink thirdReviewLnk;
109 private HLink fourthReviewLnk;
110 private HLink anotherReviewLnk;
111
112 /*
113 * Others
114 */
115 private JLabel noRevsLbl = new JLabel(noRevsStrng);
116
117 private Vector<String> lastRevsVector = getLastReviews();
118
119 /**
120 * Action to open an existing review.
121 */
122 public ActionListener openExistRev = new ActionListener() {
123
124 @Override
125 public void actionPerformed(ActionEvent e) {
126
127 try {
128 List<String> lastRevs = Data.getInstance().getAppData()
129 .getLastReviews();
130 int index = lastRevsGrp.getSelectedLinkIndex();
131 String revPath = lastRevs.get(index);
132 new LoadReviewWorker(revPath).execute();
133 } catch (DataException e1) {
134 // TODO Auto-generated catch block
135 e1.printStackTrace();
136 }
137
138 }
139
140 };
141
142 /**
143 * Action to open another review.
144 */
145 private ActionListener openAnotherRev = new ActionListener() {
146
147 @Override
148 public void actionPerformed(ActionEvent arg0) {
149 FileChooser fileChooser = UI.getInstance().getFileChooser();
150
151 if (fileChooser.showDialog(UI.getInstance().getAssistantDialog(),
152 FileChooser.MODE_OPEN_FILE, ResiFileFilter.TYPE_REVIEW) == FileChooser.SELECTED_APPROVE) {
153 String reviewPath = fileChooser.getFile().getAbsolutePath();
154 new LoadReviewWorker(reviewPath).execute();
155 }
156 }
157 };
158
159 /**
160 * Returns the group of the recent reviews.
161 * @return
162 */
163 public LinkGroup getLastRevsGrp() {
164 return lastRevsGrp;
165 }
166
167 /**
168 * Returns the vector of the recent reviews.
169 * @return
170 */
171 public Vector<String> getLastRevsVector() {
172 return lastRevsVector;
173 }
174
175 /**
176 * Constructor
177 *
178 * @param parent
179 */
180 public OpenReviewPanel(AbstractDialog parent) {
181 super(parent);
182 createOpenReviewPnl();
183 }
184
185 /**
186 * Method which creates and locates the component of this panel.
187 */
188 private void createOpenReviewPnl() {
189
190 this.setLayout(gbl2);
191
192 moderatorLnk.addActionListener(new ActionListener() {
193
194 @Override
195 public void actionPerformed(ActionEvent e) {
196 UI.getInstance().getAssistantDialog().setLocalMode("moderator");
197 Data.getInstance().setMode("moderator");
198 }
199 });
200
201 scribeSingleRevLnk.addActionListener(new ActionListener() {
202
203 @Override
204 public void actionPerformed(ActionEvent e) {
205 UI.getInstance().getAssistantDialog().setLocalMode("scribe");
206 Data.getInstance().setMode("scribe");
207 }
208 });
209
210 modeGrp.addLink(moderatorLnk);
211 modeGrp.addLink(scribeSingleRevLnk);
212 modeGrp.selectLink(moderatorLnk);
213
214 GUITools.addComponent(this, gbl2, moderatorLnk, 0, 0, 1, 1,
215 0.5, 0.0, 0, 20, 0, 20, GridBagConstraints.HORIZONTAL,
216 GridBagConstraints.NORTHWEST);
217 GUITools.addComponent(this, gbl2, scribeSingleRevLnk, 0, 1,
218 1, 2, 0.5, 0.0, 20, 20, 0, 20, GridBagConstraints.HORIZONTAL,
219 GridBagConstraints.NORTHWEST);
220 GUITools.addComponent(this, gbl2, new JSeparator(
221 SwingConstants.VERTICAL), 1, 0, 1, 6, 0.0, 1.0, 0, 0, 0, 0,
222 GridBagConstraints.VERTICAL, GridBagConstraints.NORTHWEST);
223
224 try {
225 firstRevStrng = lastRevsVector.get(0);
226 firstReviewLnk = new HLink(firstRevStrng, reviewIcon,
227 reviewRolloverIcon, lastRevsGrp);
228 lastRevsGrp.addLink(firstReviewLnk);
229 lastRevsGrp.selectLink(firstReviewLnk);
230 GUITools.addComponent(this, gbl2, firstReviewLnk, 2, 0,
231 1, 1, 1.0, 0.0, 0, 40, 0, 0, GridBagConstraints.HORIZONTAL,
232 GridBagConstraints.NORTHWEST);
233
234 } catch (Exception e) {
235 noRevsLbl.setFont(new Font(Font.SANS_SERIF, Font.ITALIC, 12));
236 GUITools.addComponent(this, gbl2, noRevsLbl, 2, 0, 1, 1,
237 1.0, 0.0, 15, 80, 0, 0, GridBagConstraints.HORIZONTAL,
238 GridBagConstraints.NORTHWEST);
239 }
240 try {
241 secondRevStrng = lastRevsVector.get(1);
242 secondReviewLnk = new HLink(secondRevStrng, reviewIcon,
243 reviewRolloverIcon, lastRevsGrp);
244 lastRevsGrp.addLink(secondReviewLnk);
245 GUITools.addComponent(this, gbl2, secondReviewLnk, 2, 1,
246 1, 1, 1.0, 0.0, 0, 40, 0, 0, GridBagConstraints.HORIZONTAL,
247 GridBagConstraints.NORTHWEST);
248
249 } catch (Exception e) {
250
251 }
252 try {
253 thirdRevStrng = lastRevsVector.get(2);
254 thirdReviewLnk = new HLink(thirdRevStrng, reviewIcon,
255 reviewRolloverIcon, lastRevsGrp);
256 lastRevsGrp.addLink(thirdReviewLnk);
257 GUITools.addComponent(this, gbl2, thirdReviewLnk, 2, 2,
258 1, 1, 1.0, 0.0, 0, 40, 0, 0, GridBagConstraints.HORIZONTAL,
259 GridBagConstraints.NORTHWEST);
260
261 } catch (Exception e) {
262
263 }
264
265 try {
266 fourthRevStrng = lastRevsVector.get(3);
267 fourthReviewLnk = new HLink(fourthRevStrng, reviewIcon,
268 reviewRolloverIcon, lastRevsGrp);
269 lastRevsGrp.addLink(fourthReviewLnk);
270 GUITools
271 .addComponent(this, gbl2, fourthReviewLnk, 2, 3,
272 1, 1, 1.0, 0.0, 0, 40, 0, 0,
273 GridBagConstraints.HORIZONTAL,
274 GridBagConstraints.NORTHWEST);
275
276 } catch (Exception e) {
277
278 }
279 anotherReviewLnk = new HLink(anotherRevStrng, browseIcon,
280 browseRolloverIcon, null);
281 anotherReviewLnk.setUnderlined(true);
282 anotherReviewLnk.addActionListener(openAnotherRev);
283 GUITools.addComponent(this, gbl2, anotherReviewLnk, 2, 4, 1,
284 1, 1.0, 1.0, 30, 40, 0, 0, GridBagConstraints.HORIZONTAL,
285 GridBagConstraints.SOUTHWEST);
286
287 }
288
289 /**
290 * Gets the last reviews.
291 *
292 * @return the last reviews
293 */
294 private Vector<String> getLastReviews() {
295 Vector<String> vecLastReviews = new Vector<String>();
296
297 try {
298 for (String rev : Data.getInstance().getAppData().getLastReviews()) {
299 vecLastReviews.add(new File(rev).getName());
300 }
301 } catch (DataException exc) {
302 JOptionPane.showMessageDialog(null, GUITools.getMessagePane(exc
303 .getMessage()), Data.getInstance().getLocaleStr("error"),
304 JOptionPane.ERROR_MESSAGE);
305 }
306
307 return vecLastReviews;
308 }
309
310}
0311
=== added file 'src/org/revager/gui/helpers/HLink.java'
--- src/org/revager/gui/helpers/HLink.java 1970-01-01 00:00:00 +0000
+++ src/org/revager/gui/helpers/HLink.java 2010-05-26 20:44:25 +0000
@@ -0,0 +1,526 @@
1/*
2 * Copyright 2009 Davide Casciato, Sandra Reich, Johannes Wettinger
3 *
4 * This file is part of Resi.
5 *
6 * Resi is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * Resi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with Resi. If not, see <http://www.gnu.org/licenses/>.
18 */
19package org.revager.gui.helpers;
20
21import java.awt.Color;
22import java.awt.Cursor;
23import java.awt.Dimension;
24import java.awt.Font;
25import java.awt.GridBagConstraints;
26import java.awt.GridBagLayout;
27import java.awt.event.ActionListener;
28import java.awt.event.MouseEvent;
29import java.awt.event.MouseListener;
30
31import javax.swing.ImageIcon;
32import javax.swing.JButton;
33import javax.swing.JLabel;
34import javax.swing.JPanel;
35
36import org.revager.gui.AbstractDialogPanel;
37import org.revager.tools.GUITools;
38
39/**
40 * The class HLink.
41 *
42 * @author D.Casciato
43 *
44 */
45@SuppressWarnings("serial")
46public class HLink extends JPanel {
47
48 private String localTextStrng;
49 private JLabel localLbl;
50 private ImageIcon localIcon;
51 private ImageIcon localSelIcon;
52 private ImageIcon localDisIcon;
53 private ImageIcon localRolloverIcon;
54 private JButton localBttn;
55 private GridBagLayout gbl = new GridBagLayout();
56 private Font localFont = new Font(Font.DIALOG, Font.PLAIN, 11);
57 private JPanel localPnl = this;
58 private ActionListener localAction = null;
59 private LinkGroup localGroup;
60 private Boolean selected = false;
61 private AbstractDialogPanel father = null;
62 private String rollOverText = "";
63
64 /**
65 * Returns the father of the component. Father means the same as parent.
66 *
67 * @return
68 */
69 public AbstractDialogPanel getFather() {
70 return father;
71 }
72
73 /**
74 * Sets the father of the component.
75 *
76 * @return
77 */
78 public void setFather(AbstractDialogPanel parent) {
79 this.father = parent;
80 }
81
82 /**
83 * Returns if the link is selected or not. Important when using the link as
84 * RadioButton.
85 *
86 * @return
87 */
88 public Boolean getSelected() {
89 return selected;
90 }
91
92 /**
93 * Listener which selects the link by mouse click.
94 */
95 private MouseListener selectionListener = new MouseListener() {
96
97 @Override
98 public void mouseClicked(MouseEvent e) {
99 if (localGroup != null)
100 localGroup.deselectAllLinks();
101 if (!selected)
102 selected = true;
103 }
104
105 @Override
106 public void mouseEntered(MouseEvent e) {
107 // TODO Auto-generated method stub
108
109 }
110
111 @Override
112 public void mouseExited(MouseEvent e) {
113 // TODO Auto-generated method stub
114
115 }
116
117 @Override
118 public void mousePressed(MouseEvent e) {
119 // TODO Auto-generated method stub
120
121 }
122
123 @Override
124 public void mouseReleased(MouseEvent e) {
125 // TODO Auto-generated method stub
126
127 };
128 };
129
130 /**
131 * Listener which changes the design of the link depending on the use of the
132 * link. If a group exists the link is used as radio button. Else it's used
133 * only as link.
134 */
135 private MouseListener localListener = new MouseListener() {
136
137 @Override
138 public void mouseClicked(MouseEvent e) {
139 if (localGroup == null) {
140 localLbl.setForeground(Color.BLUE);
141 localBttn.setSelected(true);
142 setCursor(new Cursor(Cursor.HAND_CURSOR));
143 // setBold(true);
144 } else {
145 localGroup.resetAllLinks();
146 localBttn.setIcon(localSelIcon);
147 localBttn.setRolloverIcon(localSelIcon);
148 localLbl.setForeground(Color.BLUE);
149 setCursor(new Cursor(Cursor.HAND_CURSOR));
150 setSelected(true);
151 // setBold(true);
152 }
153
154 }
155
156 @Override
157 public void mouseEntered(MouseEvent e) {
158 if (localGroup == null) {
159 localLbl.setForeground(Color.BLUE);
160 localBttn.setSelected(true);
161 setCursor(new Cursor(Cursor.HAND_CURSOR));
162 // setBold(true);
163 } else {
164 setCursor(new Cursor(Cursor.HAND_CURSOR));
165 setUnderlined(true);
166 }
167 }
168
169 @Override
170 public void mouseExited(MouseEvent e) {
171 if (localGroup == null) {
172 localLbl.setForeground(Color.BLACK);
173 localBttn.setSelected(false);
174 setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
175 // setBold(false);
176 } else {
177 setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
178 setUnderlined(false);
179 }
180 }
181
182 @Override
183 public void mousePressed(MouseEvent e) {
184 // TODO Auto-generated method stub
185
186 }
187
188 @Override
189 public void mouseReleased(MouseEvent e) {
190 // TODO Auto-generated method stub
191
192 }
193 };
194
195 /**
196 * Returns the icon of the non-selected state.
197 *
198 * @return
199 */
200 public ImageIcon getLocalDisIcon() {
201 return localDisIcon;
202 }
203
204 /**
205 * Sets the icon of the non-selected state.
206 *
207 * @return
208 */
209 public void setLocalDisIcon(ImageIcon localDisIcon) {
210 this.localDisIcon = localDisIcon;
211 }
212
213 /**
214 * Returns the button of the link which contains the icon.
215 *
216 * @return
217 */
218 public JButton getLocalBttn() {
219 return localBttn;
220 }
221
222 /**
223 * Sets the text of the link.
224 *
225 * @param localTextStrng
226 */
227 public void setLocalTextStrng(String localTextStrng) {
228 this.localTextStrng = localTextStrng;
229 }
230
231 /**
232 * Sets the icon of the link.
233 *
234 * @param localIcon
235 */
236 public void setLocalIcon(ImageIcon localIcon) {
237 this.localIcon = localIcon;
238 localBttn.setIcon(localIcon);
239 }
240
241 /**
242 * Sets the rollover icon of the link.
243 *
244 * @param localRolloverIcon
245 */
246 public void setLocalRolloverIcon(ImageIcon localRolloverIcon) {
247 this.localRolloverIcon = localRolloverIcon;
248 localBttn.setRolloverIcon(localRolloverIcon);
249 }
250
251 /**
252 * Returns the icon of the link.
253 *
254 * @return
255 */
256 public ImageIcon getLocalIcon() {
257 return localIcon;
258 }
259
260 /**
261 * Returns the rollover icon of the link.
262 *
263 * @return
264 */
265 public ImageIcon getLocalRolloverIcon() {
266 return localRolloverIcon;
267 }
268
269 /**
270 * Sets the text underlined if isUnderlined is true.
271 *
272 * @param isUnderlined
273 */
274 public void setUnderlined(Boolean isUnderlined) {
275 if (isUnderlined)
276 localLbl.setText("<html><u>" + localTextStrng + "</u></html>");
277 else
278 localLbl.setText("<html>" + localTextStrng + "</html>");
279 }
280
281 /**
282 * Sets the text italic if isItalic is true.
283 *
284 * @param isItalic
285 */
286 public void setItalic(Boolean isItalic) {
287 if (isItalic)
288 localFont = new Font(Font.DIALOG, Font.ITALIC, 11);
289 else
290 localFont = new Font(Font.DIALOG, Font.PLAIN, 11);
291
292 }
293
294 /**
295 * Sets the text bold if isBold is true.
296 *
297 * @param isBold
298 */
299 public void setBold(Boolean isBold) {
300 if (isBold) {
301 localFont = new Font(Font.DIALOG, Font.BOLD, 11);
302 localLbl.setFont(localFont);
303 localLbl.validate();
304 localLbl.repaint();
305 this.validate();
306 this.repaint();
307 } else {
308 localFont = new Font(Font.DIALOG, Font.PLAIN, 11);
309 localLbl.setFont(localFont);
310 localLbl.validate();
311 localLbl.repaint();
312 this.validate();
313 this.repaint();
314
315 }
316 }
317
318 /**
319 * Sets the color of the text.
320 *
321 * @param color
322 */
323 public void setColor(Color color) {
324 localLbl.setForeground(color);
325 }
326
327 /**
328 * Constructor
329 *
330 * @param text
331 * @param icon
332 * @param rolloverIcon
333 */
334 public HLink(String text, ImageIcon icon, ImageIcon rolloverIcon,
335 LinkGroup group) {
336 super();
337 this.setLayout(gbl);
338 this.localGroup = group;
339 localIcon = icon;
340 localRolloverIcon = rolloverIcon;
341 localSelIcon = rolloverIcon;
342 localDisIcon = icon;
343 if (group == null)
344 localBttn = GUITools.newImageButton(localIcon, localRolloverIcon);
345 else
346 localBttn = GUITools.newImageButton(localIcon, localIcon);
347
348 localTextStrng = text;
349 localLbl = new JLabel("<html>" + localTextStrng + "</html>");
350
351 this.addMouseListener(localListener);
352 localLbl.addMouseListener(localListener);
353 localBttn.addMouseListener(localListener);
354 localBttn.addMouseListener(selectionListener);
355 localLbl.addMouseListener(selectionListener);
356
357 GUITools.addComponent(localPnl, gbl, localBttn, 0, 0, 1, 1, 0.0, 1.0,
358 0, 0, 0, 0, GridBagConstraints.BOTH,
359 GridBagConstraints.NORTHWEST);
360 GUITools
361 .addComponent(localPnl, gbl, localLbl, 1, 0, 1, 1, 1.0, 1.0, 0,
362 5, 0, 0, GridBagConstraints.BOTH,
363 GridBagConstraints.NORTHWEST);
364
365 Dimension size = new Dimension(10, 50);
366 setMinimumSize(size);
367 setPreferredSize(size);
368 }
369
370 /**
371 * Method for adding an action to the links subcomponents.
372 *
373 * @param action
374 */
375 public void addActionListener(ActionListener action) {
376 localAction = action;
377 localBttn.addMouseListener(new MouseListener() {
378
379 @Override
380 public void mouseClicked(MouseEvent e) {
381 localAction.actionPerformed(null);
382 }
383
384 @Override
385 public void mouseEntered(MouseEvent e) {
386 // TODO Auto-generated method stub
387
388 }
389
390 @Override
391 public void mouseExited(MouseEvent e) {
392 // TODO Auto-generated method stub
393
394 }
395
396 @Override
397 public void mousePressed(MouseEvent e) {
398 // TODO Auto-generated method stub
399
400 }
401
402 @Override
403 public void mouseReleased(MouseEvent e) {
404 // TODO Auto-generated method stub
405
406 }
407 });
408 localLbl.addMouseListener(new MouseListener() {
409
410 @Override
411 public void mouseClicked(MouseEvent e) {
412 localAction.actionPerformed(null);
413
414 }
415
416 @Override
417 public void mouseEntered(MouseEvent e) {
418 // TODO Auto-generated method stub
419
420 }
421
422 @Override
423 public void mouseExited(MouseEvent e) {
424 // TODO Auto-generated method stub
425
426 }
427
428 @Override
429 public void mousePressed(MouseEvent e) {
430 // TODO Auto-generated method stub
431
432 }
433
434 @Override
435 public void mouseReleased(MouseEvent e) {
436 // TODO Auto-generated method stub
437
438 }
439 });
440 }
441
442 /**
443 * Sets the link selected or not.
444 *
445 * @param b
446 */
447 public void setSelected(boolean b) {
448 selected = b;
449 }
450
451 /**
452 * Returns the selection icon of the link.
453 *
454 * @return
455 */
456 public ImageIcon getLocalSelIcon() {
457 // TODO Auto-generated method stub
458 return localSelIcon;
459 }
460
461 /**
462 * Method which adds the rollover text for the messages in AbstractDialog
463 * extended classes.
464 *
465 * @param rolloverText
466 */
467 public void addRolloverText(String rolloverText) {
468 if (father != null) {
469 this.rollOverText = rolloverText;
470 localLbl.removeMouseListener(rolloverListener);
471 localBttn.removeMouseListener(rolloverListener);
472
473 localLbl.addMouseListener(rolloverListener);
474 localBttn.addMouseListener(rolloverListener);
475 }
476 }
477
478 /**
479 * Listener which sets the message of the father component.
480 */
481 private MouseListener rolloverListener = new MouseListener() {
482
483 @Override
484 public void mouseClicked(MouseEvent e) {
485 // TODO Auto-generated method stub
486
487 }
488
489 @Override
490 public void mouseEntered(MouseEvent e) {
491 if (father != null)
492 father.setHint(rollOverText);
493
494 }
495
496 @Override
497 public void mouseExited(MouseEvent e) {
498 if (father != null)
499 father.setHint(null);
500
501 }
502
503 @Override
504 public void mousePressed(MouseEvent e) {
505 // TODO Auto-generated method stub
506
507 }
508
509 @Override
510 public void mouseReleased(MouseEvent e) {
511 // TODO Auto-generated method stub
512
513 }
514 };
515
516 /**
517 * Returns the label of the link.
518 *
519 * @return
520 */
521 public JLabel getLocalLbl() {
522 // TODO Auto-generated method stub
523 return localLbl;
524 }
525
526}
0\ No newline at end of file527\ No newline at end of file
1528
=== added file 'src/org/revager/gui/helpers/LinkGroup.java'
--- src/org/revager/gui/helpers/LinkGroup.java 1970-01-01 00:00:00 +0000
+++ src/org/revager/gui/helpers/LinkGroup.java 2010-05-26 20:44:25 +0000
@@ -0,0 +1,113 @@
1/*
2 * Copyright 2009 Davide Casciato, Sandra Reich, Johannes Wettinger
3 *
4 * This file is part of Resi.
5 *
6 * Resi is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * Resi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with Resi. If not, see <http://www.gnu.org/licenses/>.
18 */
19package org.revager.gui.helpers;
20
21import java.awt.Color;
22import java.util.ArrayList;
23import java.util.List;
24/**
25 * The class LinkGroup.
26 *
27 * @author D.Casciato
28 *
29 */
30public class LinkGroup {
31
32 private List<HLink> hLinksList = new ArrayList<HLink>();
33
34 /**
35 * Method which adds an Link to the LinkGroup.
36 * @param link
37 */
38 public void addLink(HLink link) {
39 hLinksList.add(link);
40 link.setLocalRolloverIcon(link.getLocalIcon());
41 }
42
43 /**
44 * Method which resets the look of the links.
45 */
46 public void resetAllLinks() {
47 for (HLink link : hLinksList) {
48 //link.setBold(false);
49 link.setColor(Color.BLACK);
50 link.setLocalRolloverIcon(link.getLocalDisIcon());
51 link.setLocalIcon(link.getLocalDisIcon());
52
53 }
54 }
55
56 /**
57 * Method which selects the given link in the LinkGroup.
58 *
59 * @param selLink
60 */
61 public void selectLink(HLink selLink) {
62 for (HLink link : hLinksList) {
63 if (link == selLink) {
64 //link.setBold(true);
65 link.setColor(Color.BLUE);
66 link.setLocalRolloverIcon(link.getLocalSelIcon());
67 link.setLocalIcon(link.getLocalSelIcon());
68 link.setSelected(true);
69 } else {
70 //link.setBold(false);
71 link.setColor(Color.BLACK);
72 link.setLocalRolloverIcon(link.getLocalDisIcon());
73 link.setLocalIcon(link.getLocalDisIcon());
74 link.setSelected(false);
75 }
76 }
77 }
78
79 /**
80 * Returns the text of the selected Link.
81 * @return
82 */
83 public String getSelectedLinkText() {
84 for (HLink link : hLinksList) {
85 if (link.getSelected())
86 return link.getLocalLbl().getText();
87 }
88 return null;
89 }
90
91 /**
92 * Returns the index of the selected Link.
93 * @return
94 */
95 public int getSelectedLinkIndex() {
96 for (int index = 0; index < hLinksList.size(); index++) {
97 if (hLinksList.get(index).getSelected())
98 return index;
99 }
100 return -1;
101 }
102
103 /**
104 * Method which deselects all Links.
105 */
106 public void deselectAllLinks() {
107 for (HLink link : hLinksList) {
108 link.setSelected(false);
109 }
110
111 }
112
113}
0114
=== added file 'src/org/revager/gui/helpers/VLink.java'
--- src/org/revager/gui/helpers/VLink.java 1970-01-01 00:00:00 +0000
+++ src/org/revager/gui/helpers/VLink.java 2010-05-26 20:44:25 +0000
@@ -0,0 +1,359 @@
1/*
2 * Copyright 2009 Davide Casciato, Sandra Reich, Johannes Wettinger
3 *
4 * This file is part of Resi.
5 *
6 * Resi is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * Resi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with Resi. If not, see <http://www.gnu.org/licenses/>.
18 */
19package org.revager.gui.helpers;
20
21import java.awt.Color;
22import java.awt.Cursor;
23import java.awt.Dimension;
24import java.awt.Font;
25import java.awt.GridBagConstraints;
26import java.awt.GridBagLayout;
27import java.awt.event.ActionListener;
28import java.awt.event.MouseEvent;
29import java.awt.event.MouseListener;
30
31import javax.swing.ImageIcon;
32import javax.swing.JButton;
33import javax.swing.JLabel;
34import javax.swing.JPanel;
35
36import org.revager.gui.AbstractDialogPanel;
37import org.revager.tools.GUITools;
38
39/**
40 * The class VLink. Temporarily not usable as radiobutton.
41 *
42 * @author D.Casciato
43 *
44 */
45@SuppressWarnings("serial")
46public class VLink extends JPanel {
47
48 private String localTextStrng;
49 private JLabel localLbl;
50 private ImageIcon localIcon;
51 private ImageIcon localRolloverIcon;
52 private JButton localBttn;
53 private GridBagLayout gbl = new GridBagLayout();
54 private Font localFont = new Font(Font.DIALOG, Font.PLAIN, 12);
55 private Font boldFont = new Font(Font.DIALOG, Font.BOLD, 12);
56 private JPanel localPnl = this;
57 private ActionListener localAction = null;
58 private AbstractDialogPanel father = null;
59 private String rollOverText = "";
60
61 /**
62 * Returns the father of the component. Father means the same as parent.
63 *
64 * @return
65 */
66 public AbstractDialogPanel getFather() {
67 return father;
68 }
69
70 /**
71 * Sets the father of the component.
72 *
73 * @return
74 */
75 public void setFather(AbstractDialogPanel parent) {
76 this.father = parent;
77 }
78
79 /**
80 * Listener for the rollover effect.
81 */
82 private MouseListener localListener = new MouseListener() {
83
84 @Override
85 public void mouseClicked(MouseEvent e) {
86 localLbl.setForeground(Color.BLACK);
87 localBttn.setSelected(false);
88 setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
89// setBold(false);
90 }
91
92 @Override
93 public void mouseEntered(MouseEvent e) {
94 localLbl.setForeground(Color.BLUE);
95 localBttn.setSelected(true);
96 setCursor(new Cursor(Cursor.HAND_CURSOR));
97// setBold(true);
98 localLbl.revalidate();
99 }
100
101 @Override
102 public void mouseExited(MouseEvent e) {
103 localLbl.setForeground(Color.BLACK);
104 localBttn.setSelected(false);
105 setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
106// setBold(false);
107 }
108
109 @Override
110 public void mousePressed(MouseEvent e) {
111 // TODO Auto-generated method stub
112
113 }
114
115 @Override
116 public void mouseReleased(MouseEvent e) {
117 // TODO Auto-generated method stub
118
119 }
120 };
121
122 /**
123 * Sets the text of the link.
124 *
125 * @param localTextStrng
126 */
127 public void setLocalTextStrng(String localTextStrng) {
128 this.localTextStrng = localTextStrng;
129 }
130
131 /**
132 * Sets the icon of the link.
133 *
134 * @param localIcon
135 */
136 public void setLocalIcon(ImageIcon localIcon) {
137 this.localIcon = localIcon;
138 }
139
140 /**
141 * Sets the rollover icon of the link.
142 *
143 * @param localRolloverIcon
144 */
145 public void setLocalRolloverIcon(ImageIcon localRolloverIcon) {
146 this.localRolloverIcon = localRolloverIcon;
147 }
148
149 /**
150 * Sets the link underlined if isUnderlined is true.
151 *
152 * @param isUnderlined
153 */
154 public void setUnderlined(Boolean isUnderlined) {
155 if (isUnderlined)
156 localLbl.setText("<html><U>" + localTextStrng + "</html>");
157 else
158 localLbl.setText(localTextStrng);
159 }
160
161 /**
162 * Sets the text italic if isItalic is true. Else the text will be plain.
163 *
164 * @param isItalic
165 */
166 public void setItalic(Boolean isItalic) {
167 if (isItalic)
168 localFont = new Font(Font.DIALOG, Font.ITALIC, 12);
169 else
170 localFont = new Font(Font.DIALOG, Font.PLAIN, 12);
171
172 }
173
174 /**
175 * Sets the text bold if isBold is true.
176 *
177 * @param isBold
178 */
179 public void setBold(Boolean isBold) {
180 if (isBold) {
181 localFont = new Font(Font.DIALOG, Font.BOLD, 12);
182 localLbl.setFont(localFont);
183 this.validate();
184 localLbl.repaint();
185 } else {
186 localFont = new Font(Font.DIALOG, Font.PLAIN, 12);
187 localLbl.setFont(localFont);
188 this.validate();
189 localLbl.repaint();
190 }
191 }
192
193 /**
194 * Sets the color of the text.
195 *
196 * @param color
197 */
198 public void setColor(Color color) {
199 localLbl.setForeground(color);
200 }
201
202 /**
203 * Constructor
204 *
205 * @param text
206 * @param icon
207 * @param rolloverIcon
208 */
209 public VLink(String text, ImageIcon icon, ImageIcon rolloverIcon) {
210 super();
211 this.setLayout(gbl);
212 localIcon = icon;
213 localRolloverIcon = rolloverIcon;
214 localBttn = GUITools.newImageButton(localIcon, localRolloverIcon);
215 localTextStrng = text;
216 localLbl = new JLabel("<html><U>" + localTextStrng + "</html>");
217 localLbl.setFont(boldFont);
218 Dimension prefSize = localLbl.getPreferredSize();
219 localLbl.setFont(localFont);
220 localLbl.setMinimumSize(prefSize);
221
222 this.addMouseListener(localListener);
223 localLbl.addMouseListener(localListener);
224 localBttn.addMouseListener(localListener);
225
226 GUITools.addComponent(localPnl, gbl, localBttn, 0, 0, 1, 1, 0.0, 0.0,
227 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.NORTH);
228 GUITools.addComponent(localPnl, gbl, localLbl, 0, 1, 1, 1, 0.0, 0.0, 5,
229 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.NORTH);
230
231 }
232
233 /**
234 * Method for adding an action to the links subcomponents.
235 *
236 * @param action
237 */
238 public void addActionListener(ActionListener action) {
239 localAction = action;
240 localBttn.addMouseListener(new MouseListener() {
241
242 @Override
243 public void mouseClicked(MouseEvent e) {
244 localAction.actionPerformed(null);
245 }
246
247 @Override
248 public void mouseEntered(MouseEvent e) {
249 // TODO Auto-generated method stub
250
251 }
252
253 @Override
254 public void mouseExited(MouseEvent e) {
255 // TODO Auto-generated method stub
256
257 }
258
259 @Override
260 public void mousePressed(MouseEvent e) {
261 // TODO Auto-generated method stub
262
263 }
264
265 @Override
266 public void mouseReleased(MouseEvent e) {
267 // TODO Auto-generated method stub
268
269 }
270 });
271 localLbl.addMouseListener(new MouseListener() {
272
273 @Override
274 public void mouseClicked(MouseEvent e) {
275 localAction.actionPerformed(null);
276 }
277
278 @Override
279 public void mouseEntered(MouseEvent e) {
280 // TODO Auto-generated method stub
281
282 }
283
284 @Override
285 public void mouseExited(MouseEvent e) {
286 // TODO Auto-generated method stub
287
288 }
289
290 @Override
291 public void mousePressed(MouseEvent e) {
292 // TODO Auto-generated method stub
293
294 }
295
296 @Override
297 public void mouseReleased(MouseEvent e) {
298 // TODO Auto-generated method stub
299
300 }
301 });
302 }
303
304 /**
305 * Method which adds the rollover text for the messages in AbstractDialog
306 * extended classes.
307 *
308 * @param rolloverText
309 */
310 public void addRolloverText(String rolloverText) {
311 if (father != null) {
312 this.rollOverText = rolloverText;
313 this.removeMouseListener(rolloverListener);
314 localLbl.removeMouseListener(rolloverListener);
315 localBttn.removeMouseListener(rolloverListener);
316 this.addMouseListener(rolloverListener);
317 localLbl.addMouseListener(rolloverListener);
318 localBttn.addMouseListener(rolloverListener);
319 }
320 }
321
322 /**
323 * Listener which sets the message of the father component.
324 */
325 private MouseListener rolloverListener = new MouseListener() {
326
327 @Override
328 public void mouseClicked(MouseEvent e) {
329 // TODO Auto-generated method stub
330
331 }
332
333 @Override
334 public void mouseEntered(MouseEvent e) {
335 if (father != null)
336 father.setHint(rollOverText);
337
338 }
339
340 @Override
341 public void mouseExited(MouseEvent e) {
342 if (father != null)
343 father.setHint(null);
344 }
345
346 @Override
347 public void mousePressed(MouseEvent e) {
348 // TODO Auto-generated method stub
349
350 }
351
352 @Override
353 public void mouseReleased(MouseEvent e) {
354 // TODO Auto-generated method stub
355
356 }
357 };
358
359}
0360
=== added file 'src/org/revager/gui/icons/aspectsManager_25x25.png'
1Binary 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 differ361Binary 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
=== added file 'src/org/revager/gui/icons/aspectsManager_25x25_0.png'
2Binary 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 differ362Binary 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
=== added file 'src/org/revager/gui/icons/english_31x20.png'
3Binary 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 differ363Binary 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
=== added file 'src/org/revager/gui/icons/english_31x20_0.png'
4Binary 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 differ364Binary 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
=== added file 'src/org/revager/gui/icons/german_31x20.png'
5Binary 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 differ365Binary 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
=== added file 'src/org/revager/gui/icons/german_31x20_0.png'
6Binary 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 differ366Binary 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
=== modified file 'src/org/revager/gui/icons/instantReview_128x128_0.png'
7Binary 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 differ367Binary 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
=== added file 'src/org/revager/gui/icons/language_31x20.png'
8Binary 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 differ368Binary 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
=== added file 'src/org/revager/gui/icons/language_31x20_0.png'
9Binary 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 differ369Binary 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
=== modified file 'src/org/revager/gui/icons/moderator_128x128_0.png'
10Binary 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 differ370Binary 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
=== added file 'src/org/revager/gui/icons/moderator_50x50.png'
11Binary 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 differ371Binary 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
=== added file 'src/org/revager/gui/icons/moderator_50x50_0.png'
12Binary 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 differ372Binary 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
=== added file 'src/org/revager/gui/icons/openBttn_16x16.png'
13Binary 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 differ373Binary 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
=== added file 'src/org/revager/gui/icons/open_40x40.png'
14Binary 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 differ374Binary 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
=== added file 'src/org/revager/gui/icons/open_40x40_0.png'
15Binary 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 differ375Binary 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
=== added file 'src/org/revager/gui/icons/revager_50x50.png'
16Binary 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 differ376Binary 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
=== added file 'src/org/revager/gui/icons/review_40x40.png'
17Binary 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 differ377Binary 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
=== added file 'src/org/revager/gui/icons/review_40x40_0.png'
18Binary 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 differ378Binary 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
=== modified file 'src/org/revager/gui/icons/scribe_128x128_0.png'
19Binary 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 differ379Binary 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
=== added file 'src/org/revager/gui/icons/scribe_50x50.png'
20Binary 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 differ380Binary 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
=== added file 'src/org/revager/gui/icons/scribe_50x50_0.png'
21Binary 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 differ381Binary 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
=== modified file 'src/org/revager/gui/models/StrengthTableModel.java'
--- src/org/revager/gui/models/StrengthTableModel.java 2010-01-31 17:32:35 +0000
+++ src/org/revager/gui/models/StrengthTableModel.java 2010-05-26 20:44:25 +0000
@@ -22,7 +22,6 @@
2222
23import org.revager.gui.UI;23import org.revager.gui.UI;
2424
25
26/**25/**
27 * The Class StrengthTableModel.26 * The Class StrengthTableModel.
28 */27 */
@@ -46,10 +45,7 @@
46 */45 */
47 @Override46 @Override
48 public int getRowCount() {47 public int getRowCount() {
49 if(UI.getInstance().getAttendeeDialog().isVisible())48 return UI.getInstance().getAttendeeDialog().getStrengthList().size();
50 return UI.getInstance().getAttendeeDialog().getStrengthList().size();
51 else
52 return UI.getInstance().getAssistantDialog().getStrengthList().size();
53 }49 }
5450
55 /*51 /*
@@ -59,11 +55,8 @@
59 */55 */
60 @Override56 @Override
61 public Object getValueAt(int rowIndex, int columnIndex) {57 public Object getValueAt(int rowIndex, int columnIndex) {
62 if(UI.getInstance().getAttendeeDialog().isVisible())58 return UI.getInstance().getAttendeeDialog().getStrengthList().get(
63 return UI.getInstance().getAttendeeDialog().getStrengthList().get(rowIndex);59 rowIndex);
64 else
65 return UI.getInstance().getAssistantDialog().getStrengthList().get(rowIndex);
66
67 }60 }
6861
69 /*62 /*
@@ -73,17 +66,10 @@
73 * int, int)66 * int, int)
74 */67 */
75 public void setValueAt(Object insertion, int row, int column) {68 public void setValueAt(Object insertion, int row, int column) {
76 if(UI.getInstance().getAttendeeDialog().isVisible()){69 UI.getInstance().getAttendeeDialog().getStrengthList().set(row,
77 UI.getInstance().getAttendeeDialog().getStrengthList().set(row,70 (String) insertion);
78 (String) insertion);71
79
80 }else{
81 UI.getInstance().getAssistantDialog().getStrengthList().set(row,
82 (String) insertion);
83
84 }
85 fireTableDataChanged();72 fireTableDataChanged();
86
87 }73 }
8874
89 /*75 /*
9076
=== modified file 'src/org/revager/resources/localeStrings_de.properties'
--- src/org/revager/resources/localeStrings_de.properties 2010-01-31 17:32:35 +0000
+++ src/org/revager/resources/localeStrings_de.properties 2010-05-26 20:44:25 +0000
@@ -27,6 +27,7 @@
27mode.moderator=Moderator27mode.moderator=Moderator
28mode.scribe=Notar28mode.scribe=Notar
29mode.instant=Sofortiges Review29mode.instant=Sofortiges Review
30mode.scribeOrSingle=Notar oder Single Reviewer
3031
3132
3233
@@ -166,14 +167,26 @@
166## Assistant Dialog ##167## Assistant Dialog ##
167######################168######################
168assistantDialog.title=RevAger Assistent169assistantDialog.title=RevAger Assistent
170assistantDialog.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.
171assistantDialog.firstDesc=Willkomen in RevAger!
172assistantDialog.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.
173assistantDialog.newRev.rollover=Wählen Sie diese Option um ein neues Review als Moderator zu organisieren.
174assistantDialog.openRev.rollover=Wählen Sie diese Option um ein existierendes Review zu öffnen.
175assistantDialog.selectLanguage.rollover=Wählen Sie diese Option um die Applikations-Sprache zu ändern.
176assistantDialog.openAspectsMngr.rollover=Wählen Sie diese Option um Fragencataloge und Prüfaspekte im Prüfaspekte-Manager zu verwalten.
169assistantDialog.selectReviewDescription=Sie können ein gespeichertes Review laden oder ein neues Review anlegen.177assistantDialog.selectReviewDescription=Sie können ein gespeichertes Review laden oder ein neues Review anlegen.
170assistantDialog.selectModeDescription=Bitte wählen Sie den Modus aus, in dem Sie arbeiten möchten.178assistantDialog.selectModeDescription=Bitte wählen Sie den Modus aus, in dem Sie arbeiten möchten.
171assistantDialog.selectReview=Review-Datei179assistantDialog.selectReview=Review-Datei
172assistantDialog.lastReviews=Letzte Reviews180assistantDialog.lastReviews=Letzte Reviews
173assistantDialog.manageCatalogs=Fragenkataloge verwalten181assistantDialog.manageCatalogs=Fragenkataloge verwalten
174assistantDialog.browseToolTip=Review aus Verzeichnis wählen182assistantDialog.browseToolTip=Review aus Verzeichnis wählen
175183assistantDialog.newReview=Neues Review anlegen
176184assistantDialog.quickstart=Sofortiges Review
185assistantDialog.openReview=Bestehendes Review öffnen
186assistantDialog.selectLanguage=Sprache wählen
187assistantDialog.aspectsManager=Prüfaspekte-Manager öffnen
188assistantDialog.selectAnotherRev=Ein anderes Review wählen...
189assistantDialog.noRevs=Keine Reviews vorhanden
177190
178#####################191#####################
179## Settings Dialog ##192## Settings Dialog ##
@@ -613,6 +626,8 @@
613popup.editAspect.description=Beschreibung:626popup.editAspect.description=Beschreibung:
614popup.editAspect.askForCategoryName=Bitte geben Sie eine Bezeichnung für die Kategorie ein.627popup.editAspect.askForCategoryName=Bitte geben Sie eine Bezeichnung für die Kategorie ein.
615628
629popup.language.german=Deutsch
630popup.language.english=English
616631
617632
618##############633##############
619634
=== modified file 'src/org/revager/resources/localeStrings_en.properties'
--- src/org/revager/resources/localeStrings_en.properties 2010-01-31 17:32:35 +0000
+++ src/org/revager/resources/localeStrings_en.properties 2010-05-26 20:44:25 +0000
@@ -26,6 +26,7 @@
26mode.moderator=Moderator26mode.moderator=Moderator
27mode.scribe=Scribe27mode.scribe=Scribe
28mode.instant=Instant Review28mode.instant=Instant Review
29mode.scribeOrSingle=Scribe or Single Reviewer
2930
3031
3132
@@ -165,12 +166,26 @@
165## Assistant Dialog ##166## Assistant Dialog ##
166######################167######################
167assistantDialog.title=RevAger assistant168assistantDialog.title=RevAger assistant
169assistantDialog.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.
170assistantDialog.firstDesc=Welcome to RevAger!
171assistantDialog.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.
172assistantDialog.newRev.rollover=Choose this if you want to organize a Review as moderator.
173assistantDialog.openRev.rollover=Choose this if you want to open an existing Review.
174assistantDialog.selectLanguage.rollover=Choose this if you want to change the application language.
175assistantDialog.openAspectsMngr.rollover=Choose this if you want to manage catalogs and aspects in the aspects-manager.
168assistantDialog.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.176assistantDialog.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.
169assistantDialog.selectModeDescription=Please choose one mode you want to work in.177assistantDialog.selectModeDescription=Please choose one mode you want to work in.
170assistantDialog.selectReview=Review file178assistantDialog.selectReview=Review file
171assistantDialog.lastReviews=Last reviews179assistantDialog.lastReviews=Last reviews
172assistantDialog.manageCatalogs=Manage catalogs180assistantDialog.manageCatalogs=Manage catalogs
173assistantDialog.browseToolTip=Choose review from directory181assistantDialog.browseToolTip=Choose review from directory
182assistantDialog.newReview=Schedule new review
183assistantDialog.quickstart=Quickstart
184assistantDialog.openReview=Open existing review
185assistantDialog.selectLanguage=Select language
186assistantDialog.aspectsManager=Open aspects manager
187assistantDialog.selectAnotherRev=Select another review...
188assistantDialog.noRevs=No Reviews available
174189
175190
176191
@@ -607,6 +622,8 @@
607popup.editAspect.description=Description:622popup.editAspect.description=Description:
608popup.editAspect.askForCategoryName=Please enter a name for the category.623popup.editAspect.askForCategoryName=Please enter a name for the category.
609624
625popup.language.german=Deutsch
626popup.language.english=English
610627
611628
612##############629##############
613630
=== modified file 'src/org/revager/tools/GUITools.java'
--- src/org/revager/tools/GUITools.java 2010-01-31 17:32:35 +0000
+++ src/org/revager/tools/GUITools.java 2010-05-26 20:44:25 +0000
@@ -69,7 +69,6 @@
69import org.revager.app.model.Data;69import org.revager.app.model.Data;
70import org.revager.gui.UI;70import org.revager.gui.UI;
7171
72
73/**72/**
74 * The Class GUITools.73 * The Class GUITools.
75 */74 */
@@ -683,5 +682,4 @@
683 }682 }
684 });683 });
685 }684 }
686
687}685}

Subscribers

People subscribed via source and target branches