Search in sources :

Example 1 with SystemSettings

use of trial.SystemSettings in project project1-ICS372 by sandip-rai.

the class ButtonResetAllSettingsListener method actionPerformed.

/* (non-Javadoc)
	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
	 */
@Override
public void actionPerformed(ActionEvent e) {
    SystemSettings settings = guiController.getClinicalTrial().getSettings();
    settings.setDateFormat("ddMMMyyyy HH:mm");
    settings.setAddUnknownClinics(true);
    settings.setJsonAddUnknownPatients(false);
    settings.setJsonAddUnknownReadings(false);
    settings.setXmlAddUnknownPatients(true);
    settings.setXmlAddUnknownReadings(true);
    SystemSettingsView view = guiController.getSystemSettingView();
    view.getDateFormat().setText("ddMMMyyyy HH:mm");
    view.getCheckBoxAddClinics().setSelected(true);
    view.getCheckBoxJsonPatients().setSelected(false);
    view.getCheckBoxJsonReadings().setSelected(false);
    view.getCheckBoxXmlPatients().setSelected(true);
    view.getCheckBoxXmlReadings().setSelected(true);
}
Also used : SystemSettings(trial.SystemSettings) SystemSettingsView(gui.views.SystemSettingsView)

Example 2 with SystemSettings

use of trial.SystemSettings in project project1-ICS372 by sandip-rai.

the class CheckBoxXmlAddPatients method itemStateChanged.

/* (non-Javadoc)
	 * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
	 */
@Override
public void itemStateChanged(ItemEvent e) {
    SystemSettings settings = guiController.getClinicalTrial().getSettings();
    // If setXmlAddUnknownPatients was checked
    if (e.getStateChange() == 1) {
        // set the SystemSetting for setXmlAddUnknownPatients to true
        settings.setXmlAddUnknownPatients(true);
        // Enable the  check box to add readings and activate new patients
        guiController.getSystemSettingView().getCheckBoxXmlReadings().setEnabled(true);
    } else {
        // If setXmlAddUnknownPatients was unchecked set all XML settings to false
        settings.setXmlAddUnknownPatients(false);
        settings.setXmlAddUnknownReadings(false);
        // Uncheck setXmlAddUnknownReadings and disabled it
        guiController.getSystemSettingView().getCheckBoxXmlReadings().setEnabled(false);
        guiController.getSystemSettingView().getCheckBoxXmlReadings().setSelected(false);
    }
}
Also used : SystemSettings(trial.SystemSettings)

Example 3 with SystemSettings

use of trial.SystemSettings in project project1-ICS372 by sandip-rai.

the class CheckBoxXmlAddReadings method itemStateChanged.

/* (non-Javadoc)
	 * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
	 */
@Override
public void itemStateChanged(ItemEvent e) {
    SystemSettings settings = guiController.getClinicalTrial().getSettings();
    Boolean addPatients = settings.xmlAddUnknownPatients();
    if (e.getStateChange() == 1 && addPatients) {
        // If setXmlAddUnknownReadings was checked set the SystemSetting to true
        settings.setXmlAddUnknownReadings(true);
    } else {
        // If setXmlAddUnknownReadings was unchecked set the SyStemSetting to false
        settings.setXmlAddUnknownReadings(false);
    }
}
Also used : SystemSettings(trial.SystemSettings)

Example 4 with SystemSettings

use of trial.SystemSettings in project project1-ICS372 by sandip-rai.

the class SystemSettingsView method setupFrame.

/**
 * Sets the up frame.
 *
 * @param clinicalTrial the new up frame
 */
// setup Frame
public void setupFrame(ClinicalTrial clinicalTrial) {
    // Get SystemSettings and use them to initialize local variables
    SystemSettings settings = clinicalTrial.getSettings();
    boolean addClinic = settings.addUnknownClinics();
    boolean jsonPatients = settings.jsonAddUnknownPatients();
    boolean jsonReadings = settings.jsonAddUnknownReadings();
    boolean xmlPatients = settings.xmlAddUnknownPatients();
    boolean xmlReadings = settings.xmlAddUnknownReadings();
    String dateFormat = settings.getDateFormat();
    // Initiate the check boxes based on current SystemSettings
    checkBoxAddClinics.setSelected(addClinic);
    checkBoxJsonPatients.setSelected(jsonPatients);
    checkBoxJsonReadings.setSelected(jsonReadings);
    checkBoxXmlPatients.setSelected(xmlPatients);
    checkBoxXmlReadings.setSelected(xmlReadings);
    if (!jsonPatients) {
        checkBoxJsonReadings.setEnabled(false);
    }
    if (!xmlPatients) {
        checkBoxXmlReadings.setEnabled(false);
    }
    // Set the date format based on system settings
    this.dateFormat.setText(dateFormat);
    PanelAndFrame.setupFrame(frame, panels, menuBar);
}
Also used : SystemSettings(trial.SystemSettings)

Example 5 with SystemSettings

use of trial.SystemSettings in project project1-ICS372 by sandip-rai.

the class CheckBoxJsonAddPatients method itemStateChanged.

/* (non-Javadoc)
	 * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
	 */
@Override
public void itemStateChanged(ItemEvent e) {
    SystemSettings settings = guiController.getClinicalTrial().getSettings();
    // If JsonAddUnknownPatients was checked
    if (e.getStateChange() == 1) {
        // Set JsonAddUnknownPatients to true
        settings.setJsonAddUnknownPatients(true);
        // Enable the  check box to add readings and activate new patients
        guiController.getSystemSettingView().getCheckBoxJsonReadings().setEnabled(true);
    } else {
        // If the check box was unchecked set all json SystemSettings to false
        settings.setJsonAddUnknownPatients(false);
        settings.setJsonAddUnknownReadings(false);
        // Uncheck the JSON reading box as well and disable it
        guiController.getSystemSettingView().getCheckBoxJsonReadings().setEnabled(false);
        guiController.getSystemSettingView().getCheckBoxJsonReadings().setSelected(false);
    }
}
Also used : SystemSettings(trial.SystemSettings)

Aggregations

SystemSettings (trial.SystemSettings)6 SystemSettingsView (gui.views.SystemSettingsView)1