Пример #1
0
 public int getNumCqsAnswered() {
   int num = 0;
   for (CQCheck cq : getCqChecks()) {
     if (cq.isCqAnswered()) num++;
   }
   return num;
 }
Пример #2
0
 public CQCheck getCQCheckByText(String text) {
   for (CQCheck cQCheck : cqChecks) {
     if (cQCheck.getCqText().equals(text)) {
       return cQCheck;
     }
   }
   return null;
 }
Пример #3
0
 public void setScheme(Subtree scheme) {
   this.scheme = scheme;
   cbList = new CheckBoxList();
   Vector<CQCheck> cqChecks = scheme.getCqChecks();
   checkBoxes = new JCheckBox[cqChecks.size()];
   for (int cq = 0; cq < cqChecks.size(); cq++) {
     CQCheck cqCheck = cqChecks.elementAt(cq);
     checkBoxes[cq] = new JCheckBox(cqCheck.getCqText());
     checkBoxes[cq].setSelected(cqCheck.isCqAnswered());
   }
   cbList.setListData(checkBoxes);
   cqScrollPane.setViewportView(cbList);
 }
Пример #4
0
 private void okButtonActionPerformed(
     java.awt.event.ActionEvent evt) // GEN-FIRST:event_okButtonActionPerformed
     { // GEN-HEADEREND:event_okButtonActionPerformed
   Vector<CQCheck> cqChecks = scheme.getCqChecks();
   for (int cq = 0; cq < cqChecks.size(); cq++) {
     CQCheck cqCheck = cqChecks.elementAt(cq);
     if (checkBoxes[cq].isSelected()) {
       cqCheck.setCqAnswered(true);
     } else {
       cqCheck.setCqAnswered(false);
     }
   }
   okPressed = true;
   setVisible(false);
 } // GEN-LAST:event_okButtonActionPerformed