Search in sources :

Example 1 with ArcAnnotationResponse

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();
}
Also used : AnnotationFS(org.apache.uima.cas.text.AnnotationFS) ArcAnnotationResponse(de.tudarmstadt.ukp.clarin.webanno.brat.message.ArcAnnotationResponse) Selection(de.tudarmstadt.ukp.clarin.webanno.api.annotation.model.Selection) AnnotatorState(de.tudarmstadt.ukp.clarin.webanno.api.annotation.model.AnnotatorState)

Aggregations

AnnotatorState (de.tudarmstadt.ukp.clarin.webanno.api.annotation.model.AnnotatorState)1 Selection (de.tudarmstadt.ukp.clarin.webanno.api.annotation.model.Selection)1 ArcAnnotationResponse (de.tudarmstadt.ukp.clarin.webanno.brat.message.ArcAnnotationResponse)1 AnnotationFS (org.apache.uima.cas.text.AnnotationFS)1