Пример #1
0
  private void enableAdjuBox(boolean isParent) {
    JComboBox adjuBox =
        (JComboBox) relComponents[LABELS.adjudicationReason.ordinal()].getJComponent();
    AdjuPopupPane popup = (AdjuPopupPane) relComponents[LABELS.adjudicationDisagreement.ordinal()];
    // CheckboxComponent consensusBox = (CheckboxComponent)
    // relComponents[LABELS.consensus.ordinal()].getJComponent();

    if (isParent) {
      adjuBox.setEnabled(true);
      // consensusBox.setEnabled(true);
      String itemValue = (String) adjuBox.getSelectedItem();
      popup.setEnabled(true);
      if (itemValue.equals("Selected Annotator") || itemValue.equals("Select and Edit")) {
        String diff = relation.getAdjuDiff();
        popup.setAnnValue(diff);
        popup.getJComponent().setEnabled(true);
        popup.setClickable(true);
      } else {
        popup.setAnnValue("");
        ;
        popup.setClickable(false);
      }
    } else {
      adjuBox.setEnabled(false);
      // consensusBox.setEnabled(false);
      popup.setEnabled(false);
    }
  }
Пример #2
0
        public void itemStateChanged(ItemEvent e) {
          if (e.getStateChange() == ItemEvent.SELECTED) {

            AdjuPopupPane popup =
                (AdjuPopupPane) relComponents[LABELS.adjudicationDisagreement.ordinal()];
            if (isParent) {
              String itemValue = (String) ((JComboBox) e.getSource()).getSelectedItem();
              if (itemValue.equals("Selected Annotator") || itemValue.equals("Select and Edit")) {
                String diff = relation.getAdjuDiff();
                popup.setAnnValue(diff);
                popup.setClickable(true);
                // relComponents[LABELS.adjudicationDisagreement.ordinal()}.
              } else {
                popup.annReset();
                popup.setClickable(false);
              }
            } else {
              popup.annReset();
              popup.setClickable(false);
            }

            mainFrame.inputAction((JComponent) e.getSource(), spanButtons);
            enableRelationType();
          }
        }