public void itemStateChanged(ItemEvent e) { if (mleCheckBox.isSelected()) { FlagMLE = USE_MLE; } else { FlagMLE = NO_MLE; } DBRecordStat.flagMLE = FlagMLE; DBRecordSize.flagMLE = FlagMLE; GUI.StatPanel1.resetStatPanel(); GUI.StatPanel1.resetTable1(); GUI.SizePanel1.resetSizePanel(); }
public void itemStateChanged(ItemEvent e) { if (e.getStateChange() != ItemEvent.DESELECTED) { return; } if (chooseA.getSelectedItem() == null || chooseB.getSelectedItem() == null) { return; } GUI.StatPanel1.resetStatPanel(); GUI.StatPanel1.resetTable1(); GUI.SizePanel1.resetSizePanel(); boolean modA, modB; modA = !chooseA.getSelectedItem().equals("Choose Modality A"); modB = !chooseB.getSelectedItem().equals("Choose Modality B"); if (modA && !modB) { DBRecordStat.selectedMod = 0; DBRecordStat.modalityA = (String) chooseA.getSelectedItem(); DBRecordStat.modalityB = GUInterface.NO_MOD; varAnalysisButton.setText("MRMC Variance Analysis (A)"); } else if (!modA && modB) { DBRecordStat.selectedMod = 1; DBRecordStat.modalityA = GUInterface.NO_MOD; DBRecordStat.modalityB = (String) chooseB.getSelectedItem(); varAnalysisButton.setText("MRMC Variance Analysis (B)"); } else if (modA && modB) { DBRecordStat.selectedMod = 3; DBRecordStat.modalityA = (String) chooseA.getSelectedItem(); DBRecordStat.modalityB = (String) chooseB.getSelectedItem(); varAnalysisButton.setText("MRMC Variance Analysis (Difference)"); } else { varAnalysisButton.setText("MRMC Variance Analysis"); DBRecordStat.modalityA = GUInterface.NO_MOD; DBRecordStat.modalityB = GUInterface.NO_MOD; return; } DBRecordSize.selectedMod = DBRecordStat.selectedMod; DBRecordSize.modalityA = DBRecordStat.modalityA; DBRecordSize.modalityB = DBRecordStat.modalityB; } // method
public void actionPerformed(ActionEvent e) { System.out.println("MRMC Variance analysis button clicked. RawStudyCard.varAnalysisListener"); // Check that .imrmc input file has been read // If there is no JTextFilename, then reader scores have not been read String name = JTextFilename.getText(); System.out.println("name=" + name); if (name.equals(null) || name.equals("")) { JFrame frame = GUI.MRMCobject.getFrame(); JOptionPane.showMessageDialog( frame, "Please browse for .imrmc or.csv input file", " Error", JOptionPane.ERROR_MESSAGE); return; } // Check that a modality has been selected if (DBRecordStat.modalityA == GUInterface.NO_MOD && DBRecordStat.modalityB == GUInterface.NO_MOD) { JFrame frame = GUI.MRMCobject.getFrame(); JOptionPane.showMessageDialog( frame, "You must select at least one modality", "Error", JOptionPane.ERROR_MESSAGE); return; } // Don't allow both modalities to be the same if (DBRecordStat.modalityA.compareTo(DBRecordStat.modalityB) == 0) { JFrame frame = GUI.MRMCobject.getFrame(); JOptionPane.showMessageDialog( frame, "Modalities must be different", " Error", JOptionPane.ERROR_MESSAGE); return; } // Analyze observerData DBRecordStat.DBRecordStatFill(InputFile1, DBRecordStat); // Check if variance estimate is negative if (DBRecordStat.totalVar > 0) GUI.hasNegative = false; else GUI.hasNegative = true; if (GUI.hasNegative && FlagMLE == NO_MLE) { JFrame frame = GUI.MRMCobject.getFrame(); int result = JOptionPane.showConfirmDialog( frame, "The total variance estimate is negative.\n" + "Please report to the program developers. This is not expected.\n" + "Do you want to proceed with MLE estimates to avoid negatives?"); if (JOptionPane.CANCEL_OPTION == result) { System.out.println("cancel"); } else if (JOptionPane.YES_OPTION == result) { FlagMLE = USE_MLE; DBRecordStat.flagMLE = FlagMLE; mleCheckBox.setSelected(true); DBRecordStat.totalVar = DBRecordStat.totalVarMLE; DBRecordStat.totalVarSingle = DBRecordStat.totalVarMLESingle; DBRecordStat.testStat = new StatTest(DBRecordStat); } else if (JOptionPane.NO_OPTION == result) { FlagMLE = NO_MLE; } } // Update GUI DBRecordStat.flagMLE = FlagMLE; DBRecordSize.flagMLE = FlagMLE; GUI.StatPanel1.setStatPanel(); GUI.StatPanel1.setTable1(); DBRecordSize.Nreader = DBRecordStat.Nreader; DBRecordSize.Nnormal = DBRecordStat.Nnormal; DBRecordSize.Ndisease = DBRecordStat.Ndisease; GUI.SizePanel1.NreaderJTextField.setText(Long.toString(DBRecordStat.Nreader)); GUI.SizePanel1.NnormalJTextField.setText(Long.toString(DBRecordStat.Nnormal)); GUI.SizePanel1.NdiseaseJTextField.setText(Long.toString(DBRecordStat.Ndisease)); }