use of trial.ClinicalTrial in project project1-ICS372 by sandip-rai.
the class ButtonAddClinicListener method actionPerformed.
/* (non-Javadoc)
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
public void actionPerformed(ActionEvent e) {
// Get the new entered values
String name = guiController.getClinicView().getClinicName().getText();
String id = guiController.getClinicView().getClinicId().getText();
// Prompt the user if reading values aren't filled
if (name == "") {
JOptionPane.showMessageDialog(null, "Please fill in the \"Clinic Name\" field");
} else {
// If all values are filled, add them to to corresponding Patient
ClinicView view = guiController.getClinicView();
ClinicalTrial clinicalTrial = guiController.getClinicalTrial();
clinicalTrial.addClinic(name, id);
view.getAddClinicText().setText("Clinic added, ready for next Clinic");
view.getClinicId().setText("");
view.getClinicName().setText("");
}
}
use of trial.ClinicalTrial in project project1-ICS372 by sandip-rai.
the class GuiControllerTest method testAll.
/**
* Test all.
*/
@Test
public void testAll() {
mainMenuView = new MainMenuView();
addPatientView = new AddPatientView();
systemSettingsView = new SystemSettingsView();
fileAdapter = new FileAdapter();
clinicalTrial = new ClinicalTrial();
displayPatientListView = new DisplayPatientListView(clinicalTrial);
clinicView = new ClinicView(clinicalTrial);
Assert.assertNotNull(mainMenuView);
Assert.assertNotNull(addPatientView);
Assert.assertNotNull(systemSettingsView);
Assert.assertNotNull(fileAdapter);
Assert.assertNotNull(clinicalTrial);
Assert.assertNotNull(displayPatientListView);
Assert.assertNotNull(clinicView);
GuiController gc = new GuiController(mainMenuView, addPatientView, systemSettingsView, fileAdapter, clinicalTrial, displayPatientListView, clinicView);
Assert.assertNotNull(gc);
Assert.assertNotNull(gc.getSystemSettingView());
Assert.assertNotNull(gc.getAddPatientView());
Assert.assertNotNull(gc.getMainMenuView());
Assert.assertNotNull(gc.getFileAdapter());
Assert.assertNotNull(gc.getClinicalTrial());
Assert.assertNotNull(gc.getDisplayPatientListView());
Assert.assertNotNull(gc.getClinicView());
}
use of trial.ClinicalTrial in project project1-ICS372 by sandip-rai.
the class Driver method main.
/**
* The main method.
*
* @param args the arguments
*/
public static void main(String[] args) {
// Models
FileAdapter fileAdapter = new FileAdapter();
ClinicalTrial clinicalTrial = fileAdapter.loadState();
// views
MainMenuView mainMenuView = new MainMenuView();
AddPatientView addPatientView = new AddPatientView();
SystemSettingsView systemSettingsView = new SystemSettingsView();
DisplayPatientListView displayPatientListView = new DisplayPatientListView(clinicalTrial);
ClinicView clinicView = new ClinicView(clinicalTrial);
// Controller
GuiController guiController = new GuiController(mainMenuView, addPatientView, systemSettingsView, fileAdapter, clinicalTrial, displayPatientListView, clinicView);
// initialize the menu bar for all views
mainMenuView.setMenuBar(PanelAndFrame.supplyMenuBar(guiController));
clinicView.setMenuBar(PanelAndFrame.supplyMenuBar(guiController));
addPatientView.setMenuBar(PanelAndFrame.supplyMenuBar(guiController));
systemSettingsView.setMenuBar(PanelAndFrame.supplyMenuBar(guiController));
displayPatientListView.setMenuBar(PanelAndFrame.supplyMenuBar(guiController));
// start the main menu
mainMenuView.setupFrame(clinicalTrial);
guiController.run(mainMenuView);
}
Aggregations