Search in sources :

Example 1 with AnnotationEditorFactory

use of de.tudarmstadt.ukp.clarin.webanno.api.annotation.AnnotationEditorFactory in project webanno by webanno.

the class AnnotationPage method createAnnotationEditor.

private AnnotationEditorBase createAnnotationEditor() {
    String editorId = getModelObject().getPreferences().getEditor();
    AnnotationEditorFactory factory = editorRegistry.getEditorFactory(editorId);
    if (factory == null) {
        factory = editorRegistry.getDefaultEditorFactory();
    }
    return factory.create("editor", getModel(), detailEditor, this::getEditorCas);
}
Also used : AnnotationEditorFactory(de.tudarmstadt.ukp.clarin.webanno.api.annotation.AnnotationEditorFactory)

Example 2 with AnnotationEditorFactory

use of de.tudarmstadt.ukp.clarin.webanno.api.annotation.AnnotationEditorFactory in project webanno by webanno.

the class AnnotationPreferencesDialogContent method loadModel.

private Preferences loadModel(AnnotatorState bModel) {
    Preferences model = new Preferences();
    // Import current settings from the annotator
    model.windowSize = bModel.getPreferences().getWindowSize() < 1 ? 1 : bModel.getPreferences().getWindowSize();
    model.sidebarSize = bModel.getPreferences().getSidebarSize();
    model.fontZoom = bModel.getPreferences().getFontZoom();
    model.scrollPage = bModel.getPreferences().isScrollPage();
    model.colorPerLayer = bModel.getPreferences().getColorPerLayer();
    model.readonlyLayerColoringBehaviour = bModel.getPreferences().getReadonlyLayerColoringBehaviour();
    model.rememberLayer = bModel.getPreferences().isRememberLayer();
    String editorId = bModel.getPreferences().getEditor();
    AnnotationEditorFactory editorFactory = annotationEditorRegistry.getEditorFactory(editorId);
    if (editorFactory == null) {
        editorFactory = annotationEditorRegistry.getDefaultEditorFactory();
    }
    model.editor = Pair.of(editorFactory.getBeanName(), editorFactory.getDisplayName());
    model.annotationLayers = annotationService.listAnnotationLayer(bModel.getProject()).stream().filter(layer -> layer.isEnabled()).filter(layer -> !Token.class.getName().equals(layer.getName())).filter(layer -> !(layer.getType().equals(WebAnnoConst.CHAIN_TYPE) && (bModel.getMode().equals(Mode.CORRECTION) || // disable coreference annotation for correction/curation pages
    bModel.getMode().equals(Mode.CURATION)))).collect(Collectors.toList());
    return model;
}
Also used : Form(org.apache.wicket.markup.html.form.Form) ReadonlyColoringBehaviour(de.tudarmstadt.ukp.clarin.webanno.api.annotation.coloring.ColoringStrategy.ReadonlyColoringBehaviour) SpringBean(org.apache.wicket.spring.injection.annot.SpringBean) ProjectService(de.tudarmstadt.ukp.clarin.webanno.api.ProjectService) AnnotatorState(de.tudarmstadt.ukp.clarin.webanno.api.annotation.model.AnnotatorState) AjaxFormComponentUpdatingBehavior(org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior) LoggerFactory(org.slf4j.LoggerFactory) Mode(de.tudarmstadt.ukp.clarin.webanno.model.Mode) CheckBox(org.apache.wicket.markup.html.form.CheckBox) CompoundPropertyModel(org.apache.wicket.model.CompoundPropertyModel) ArrayList(java.util.ArrayList) AnnotationSchemaService(de.tudarmstadt.ukp.clarin.webanno.api.AnnotationSchemaService) Token(de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token) Pair(org.apache.commons.lang3.tuple.Pair) AnnotationPreference(de.tudarmstadt.ukp.clarin.webanno.api.annotation.model.AnnotationPreference) Map(java.util.Map) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ChoiceRenderer(org.apache.wicket.markup.html.form.ChoiceRenderer) PreferencesUtil(de.tudarmstadt.ukp.clarin.webanno.ui.annotation.PreferencesUtil) AjaxEventBehavior(org.apache.wicket.ajax.AjaxEventBehavior) IModel(org.apache.wicket.model.IModel) EnumSet(java.util.EnumSet) ListView(org.apache.wicket.markup.html.list.ListView) Label(org.apache.wicket.markup.html.basic.Label) NumberTextField(org.apache.wicket.markup.html.form.NumberTextField) Logger(org.slf4j.Logger) ListItem(org.apache.wicket.markup.html.list.ListItem) WebAnnoConst(de.tudarmstadt.ukp.clarin.webanno.api.WebAnnoConst) Model(org.apache.wicket.model.Model) ModalWindow(org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow) IOException(java.io.IOException) LambdaAjaxButton(de.tudarmstadt.ukp.clarin.webanno.support.lambda.LambdaAjaxButton) Collectors(java.util.stream.Collectors) DropDownChoice(org.apache.wicket.markup.html.form.DropDownChoice) Serializable(java.io.Serializable) Panel(org.apache.wicket.markup.html.panel.Panel) List(java.util.List) AnnotationEditorFactory(de.tudarmstadt.ukp.clarin.webanno.api.annotation.AnnotationEditorFactory) LambdaAjaxLink(de.tudarmstadt.ukp.clarin.webanno.support.lambda.LambdaAjaxLink) AnnotationLayer(de.tudarmstadt.ukp.clarin.webanno.model.AnnotationLayer) ColoringStrategyType(de.tudarmstadt.ukp.clarin.webanno.api.annotation.coloring.ColoringStrategy.ColoringStrategyType) AnnotationEditorRegistry(de.tudarmstadt.ukp.clarin.webanno.api.annotation.AnnotationEditorRegistry) AnnotationEditorFactory(de.tudarmstadt.ukp.clarin.webanno.api.annotation.AnnotationEditorFactory)

Aggregations

AnnotationEditorFactory (de.tudarmstadt.ukp.clarin.webanno.api.annotation.AnnotationEditorFactory)2 AnnotationSchemaService (de.tudarmstadt.ukp.clarin.webanno.api.AnnotationSchemaService)1 ProjectService (de.tudarmstadt.ukp.clarin.webanno.api.ProjectService)1 WebAnnoConst (de.tudarmstadt.ukp.clarin.webanno.api.WebAnnoConst)1 AnnotationEditorRegistry (de.tudarmstadt.ukp.clarin.webanno.api.annotation.AnnotationEditorRegistry)1 ColoringStrategyType (de.tudarmstadt.ukp.clarin.webanno.api.annotation.coloring.ColoringStrategy.ColoringStrategyType)1 ReadonlyColoringBehaviour (de.tudarmstadt.ukp.clarin.webanno.api.annotation.coloring.ColoringStrategy.ReadonlyColoringBehaviour)1 AnnotationPreference (de.tudarmstadt.ukp.clarin.webanno.api.annotation.model.AnnotationPreference)1 AnnotatorState (de.tudarmstadt.ukp.clarin.webanno.api.annotation.model.AnnotatorState)1 AnnotationLayer (de.tudarmstadt.ukp.clarin.webanno.model.AnnotationLayer)1 Mode (de.tudarmstadt.ukp.clarin.webanno.model.Mode)1 LambdaAjaxButton (de.tudarmstadt.ukp.clarin.webanno.support.lambda.LambdaAjaxButton)1 LambdaAjaxLink (de.tudarmstadt.ukp.clarin.webanno.support.lambda.LambdaAjaxLink)1 PreferencesUtil (de.tudarmstadt.ukp.clarin.webanno.ui.annotation.PreferencesUtil)1 Token (de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token)1 IOException (java.io.IOException)1 Serializable (java.io.Serializable)1 ArrayList (java.util.ArrayList)1 EnumSet (java.util.EnumSet)1 List (java.util.List)1