Ejemplo n.º 1
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();
          }
        }
Ejemplo n.º 2
0
 public void actionPerformed(ActionEvent e) {
   SpanButton b = (SpanButton) e.getSource();
   /**
    * For the Implicit/EntRel/NoRel case where we do not have a spanlist for the conn, we do
    * not want to do anything when the button is clicked
    */
   // TODO: This is probably the place to calculate the sentence
   // position if the spanbutton is arg2
   String relType = relComponents[LABELS.rel.ordinal()].getAnnValue();
   SpanButton connSpanListButton = (SpanButton) relComponents[LABELS.connSpanList.ordinal()];
   if (relType.equals(RELTYPELABELS.Explicit.toString())
       || relType.equals(RELTYPELABELS.AltLex.toString())
       || b != connSpanListButton) {
     mainFrame.spanAction(b);
     mainFrame.inputAction((JComponent) e.getSource(), spanButtons);
   } else {
     b.setSelected(!b.isSelected());
   }
 }
Ejemplo n.º 3
0
        public void actionPerformed(ActionEvent e) {
          JCheckBox current = (JCheckBox) e.getSource();

          String originalDiffs =
              relComponents[LABELS.adjudicationDisagreement.ordinal()].getAnnValue();
          Set<String> originalDiffsSet = new HashSet<String>();

          if (!originalDiffs.equals("")) {
            String[] originalDiffsArr = originalDiffs.split(",");
            for (int i = 0; i < originalDiffsArr.length; i++) {
              originalDiffsSet.add(originalDiffsArr[i].trim());
            }
          }

          if (current.isSelected()) {
            originalDiffsSet.add(current.getText());
          } else {
            if (originalDiffsSet.contains(current.getText())) {
              originalDiffsSet.remove(current.getText());
            }
          }

          String[] newArray = originalDiffsSet.toArray(new String[originalDiffsSet.size()]);
          String newStr = "";
          for (int i = 0; i < newArray.length; i++) {
            if (i < newArray.length - 1) {
              newStr += newArray[i] + ", ";
            } else {
              newStr += newArray[i];
            }
          }

          relComponents[LABELS.adjudicationDisagreement.ordinal()].setAnnValue(newStr);
          mainFrame.inputAction((JComponent) e.getSource(), spanButtons);
          enableRelationType();
        }
Ejemplo n.º 4
0
 public void keyReleased(KeyEvent e) {
   // System.out.println("released " + e.getKeyChar());
   mainFrame.inputAction((JComponent) e.getSource(), spanButtons);
 }
Ejemplo n.º 5
0
 public void itemStateChanged(ItemEvent e) {
   if (e.getStateChange() == ItemEvent.SELECTED) {
     mainFrame.inputAction((JComponent) e.getSource(), spanButtons);
   }
 }