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; }
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; }
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); } }
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(); } }
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; }
public boolean inputAction() { return relation.isEquivalent(relComponents, commentPane); }
public Relation undoRejectAction() { relation.undoReject(relComponents, commentPane); disableAll(); return relation; }
public Relation annotatorRejectAction() { relation.setReject(relComponents, commentPane); disableAll(); return relation; }
public boolean isRejected() { return relation.isRejected(); }
public Relation acceptAction() { relation.setAcceptVals(relComponents, commentPane); return relation; }