예제 #1
0
 public Relation rejectAction() {
   relation.setNoVals(relComponents, commentPane);
   List<Relation> model = fileManager.getRelationList();
   if (model.contains(relation)) {
     Relation original = model.get(model.indexOf(relation));
     if (original.isGhost()) {
       relation = original;
       relation.setNewVals(relComponents, commentPane);
     }
   }
   disableAll();
   return relation;
 }
예제 #2
0
 public Relation saveAction() {
   relation.setNewVals(relComponents, commentPane);
   /** In case we are adding a new relation that matches a ghost relation that already exists: */
   List<Relation> model = fileManager.getRelationList();
   if (model.contains(relation)) {
     Relation original = model.get(model.indexOf(relation));
     if (original.isGhost()) {
       relation = original;
       relation.setNewVals(relComponents, commentPane);
     }
   }
   if (!relation.getIdentifierSpan().equals("")) {
     disableAll();
   }
   return relation;
 }
예제 #3
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);
    }
  }
예제 #4
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();
          }
        }
예제 #5
0
  public SpanButton[] selectionAction(Relation relation, Relation parent) {
    if (parent == null) {
      this.relation = relation;
      this.isParent = true;
      relation.setPBComponents();
    } else {
      this.relation = parent;
      this.isParent = false;
    }

    relation.setComponents(relComponents, commentPane);
    enableRelationType();

    if (parent == null) {
      enableAdjuBox(true);
    } else {
      enableAdjuBox(false);
    }

    return spanButtons;
  }
예제 #6
0
 public boolean inputAction() {
   return relation.isEquivalent(relComponents, commentPane);
 }
예제 #7
0
 public Relation undoRejectAction() {
   relation.undoReject(relComponents, commentPane);
   disableAll();
   return relation;
 }
예제 #8
0
 public Relation annotatorRejectAction() {
   relation.setReject(relComponents, commentPane);
   disableAll();
   return relation;
 }
예제 #9
0
 public boolean isRejected() {
   return relation.isRejected();
 }
예제 #10
0
 public Relation acceptAction() {
   relation.setAcceptVals(relComponents, commentPane);
   return relation;
 }