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);
}
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;
}
Aggregations