Search in sources :

Example 1 with RenderAnnotationsEvent

use of de.tudarmstadt.ukp.clarin.webanno.api.annotation.rendering.event.RenderAnnotationsEvent in project webanno by webanno.

the class BratAnnotationEditor method render.

private void render(GetDocumentResponse response, JCas aJCas) {
    VDocument vdoc = new VDocument();
    preRenderer.render(vdoc, getModelObject(), aJCas, getLayersToRender());
    // Fire render event into backend
    extensionRegistry.fireRender(aJCas, getModelObject(), vdoc);
    // Fire render event into UI
    Page page = (Page) RequestCycle.get().find(IPageRequestHandler.class).getPage();
    if (page == null) {
        page = getPage();
    }
    send(page, Broadcast.BREADTH, new RenderAnnotationsEvent(RequestCycle.get().find(IPartialPageRequestHandler.class), aJCas, getModelObject(), vdoc));
    if (isHighlightEnabled()) {
        AnnotatorState state = getModelObject();
        if (state.getSelection().getAnnotation().isSet()) {
            vdoc.add(new VAnnotationMarker(VMarker.FOCUS, state.getSelection().getAnnotation()));
        }
    }
    BratRenderer.render(response, getModelObject(), vdoc, aJCas, annotationService);
}
Also used : VAnnotationMarker(de.tudarmstadt.ukp.clarin.webanno.api.annotation.rendering.model.VAnnotationMarker) VDocument(de.tudarmstadt.ukp.clarin.webanno.api.annotation.rendering.model.VDocument) AnnotatorState(de.tudarmstadt.ukp.clarin.webanno.api.annotation.model.AnnotatorState) Page(org.apache.wicket.Page) RenderAnnotationsEvent(de.tudarmstadt.ukp.clarin.webanno.api.annotation.rendering.event.RenderAnnotationsEvent)

Aggregations

AnnotatorState (de.tudarmstadt.ukp.clarin.webanno.api.annotation.model.AnnotatorState)1 RenderAnnotationsEvent (de.tudarmstadt.ukp.clarin.webanno.api.annotation.rendering.event.RenderAnnotationsEvent)1 VAnnotationMarker (de.tudarmstadt.ukp.clarin.webanno.api.annotation.rendering.model.VAnnotationMarker)1 VDocument (de.tudarmstadt.ukp.clarin.webanno.api.annotation.rendering.model.VDocument)1 Page (org.apache.wicket.Page)1