use of de.tudarmstadt.ukp.clarin.webanno.brat.message.ArcAnnotationResponse in project webanno by webanno.
the class BratAnnotationEditor method actionArc.
private ArcAnnotationResponse actionArc(AjaxRequestTarget aTarget, IRequestParameters request, JCas jCas, VID paramId) throws IOException, AnnotationException {
AnnotationFS originFs = selectByAddr(jCas, request.getParameterValue(PARAM_ORIGIN_SPAN_ID).toInt());
AnnotationFS targetFs = selectByAddr(jCas, request.getParameterValue(PARAM_TARGET_SPAN_ID).toInt());
AnnotatorState state = getModelObject();
Selection selection = state.getSelection();
selection.selectArc(paramId, originFs, targetFs);
if (selection.getAnnotation().isNotSet()) {
// Create new annotation
getActionHandler().actionCreateOrUpdate(aTarget, jCas);
} else {
getActionHandler().actionSelect(aTarget, jCas);
}
return new ArcAnnotationResponse();
}
Aggregations