Example #1
0
  public static void refreshPatientData() {

    Measurements data = BrainFreezeMain.patients.get(BrainFreezeMain.currentPatientIndex).getData();

    if (data.isValid()) {

      resultChoiceList.setVisible(true); // we have valid data, show options for representation
      noDataText.setVisible(false);
      collectDataButton.setVisible(false);

      // Nothing chosen by definition, put up message
      RightPanel.swapRepresentation("ChooseSomethingMessage");

      resultChoiceList.addActionListener(
          new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
              @SuppressWarnings("unchecked")
              JComboBox<String> cb = (JComboBox<String>) e.getSource();
              String chosenRepresentation = (String) cb.getSelectedItem();
              RightPanel.swapRepresentation(chosenRepresentation);
            }
          });

      collectDataButton.setVisible(true);
      collectDataButton.setText("Retake Exam");

      RightPanel.swapRepresentation(
          "~~"); // remove any graphs that may be there, this is a new patient with no valid data
      initComboBox(0);

      collectDataButton.removeActionListener(startExamListener);
      collectDataButton.addActionListener(retakeListener);

    } else {

      resultChoiceList.setVisible(false); // we have no valid data
      noDataText.setVisible(true);
      collectDataButton.setVisible(true);
      collectDataButton.setText("Begin Examination");

      RightPanel.swapRepresentation(
          "~~"); // remove any graphs that may be there, this is a new patient with no valid data

      collectDataButton.removeActionListener(retakeListener);
      collectDataButton.addActionListener(startExamListener);
    }

    editPatientInfoButton.addActionListener(editPatientInfoListener);
    editPatientInfoButton.setVisible(true);
  }
Example #2
0
 public static void initComboBox(int i) {
   resultChoiceList.setSelectedIndex(i);
   String chosenRepresentation = (String) resultChoiceList.getSelectedItem();
   System.out.println(chosenRepresentation);
   RightPanel.swapRepresentation(chosenRepresentation);
 }
Example #3
0
 @Override
 public void actionPerformed(ActionEvent e) {
   RightPanel.swapRepresentation(RightPanel.EDIT_PATIENT_DATA);
 }
Example #4
0
 public void update(long elapsedTime) {
   leftPanel.update(elapsedTime);
   rightPanel.update(elapsedTime);
 }