public static ColoringStrategyType getBestInitialStrategy(AnnotationSchemaService aService, AnnotationLayer aLayer, AnnotationPreference aPreferences) { // Decide on coloring strategy for the current layer ColoringStrategyType coloringStrategy; if (aLayer.isReadonly()) { coloringStrategy = ColoringStrategyType.GRAY; } else if (aPreferences.isStaticColor()) { coloringStrategy = ColoringStrategyType.STATIC_PASTELLE; } else { coloringStrategy = ColoringStrategyType.DYNAMIC; } return coloringStrategy; }
public static ColoringStrategyType getBestInitialStrategy(AnnotationSchemaService aService, AnnotationLayer aLayer, AnnotationPreference aPreferences) { // Decide on coloring strategy for the current layer ColoringStrategyType coloringStrategy; if (aLayer.isReadonly()) { coloringStrategy = ColoringStrategyType.GRAY; } else if (aPreferences.isStaticColor()) { coloringStrategy = ColoringStrategyType.STATIC_PASTELLE; } else { coloringStrategy = ColoringStrategyType.DYNAMIC; } return coloringStrategy; }
boolean attachedToReadOnlyRels = attachedRels.stream().anyMatch(relFS -> { AnnotationLayer relLayer = annotationService.getLayer(aProject, relFS); return relLayer.isReadonly(); }); if (attachedToReadOnlyRels) { boolean attachedToReadOnlyLinks = attachedLinks.stream().anyMatch(relFS -> { AnnotationLayer relLayer = annotationService.getLayer(aProject, relFS); return relLayer.isReadonly(); }); if (attachedToReadOnlyLinks) {
public static ColoringStrategy getStrategy(AnnotationSchemaService aService, AnnotationLayer aLayer, AnnotationPreference aPreferences, Map<String[], Queue<String>> aColorQueues) { ColoringStrategyType t = aPreferences.getColorPerLayer().get(aLayer.getId()); ReadonlyColoringBehaviour rt = aPreferences.getReadonlyLayerColoringBehaviour(); if (aLayer.isReadonly() && rt != ReadonlyColoringBehaviour.NORMAL) { t = rt.t; } if (t == null || t == ColoringStrategyType.LEGACY) { t = getBestInitialStrategy(aService, aLayer, aPreferences); } return getStrategy(aService, aLayer, t, aColorQueues); }
public static ColoringStrategy getStrategy(AnnotationSchemaService aService, AnnotationLayer aLayer, AnnotationPreference aPreferences, Map<String[], Queue<String>> aColorQueues) { ColoringStrategyType t = aPreferences.getColorPerLayer().get(aLayer.getId()); ReadonlyColoringBehaviour rt = aPreferences.getReadonlyLayerColoringBehaviour(); if (aLayer.isReadonly() && rt != ReadonlyColoringBehaviour.NORMAL) { t = rt.t; } if (t == null || t == ColoringStrategyType.LEGACY) { t = getBestInitialStrategy(aService, aLayer, aPreferences); } return getStrategy(aService, aLayer, t, aColorQueues); }
AnnotationLayer l = null; for (AnnotationLayer layer : state.getAnnotationLayers()) { if (!layer.isEnabled() || layer.isReadonly() || layer.getName().equals(Token.class.getName())) { continue;
private Component createReverseButton() { LambdaAjaxLink link = new LambdaAjaxLink("reverse", editorPanel::actionReverse); link.setOutputMarkupPlaceholderTag(true); link.add(LambdaBehavior.onConfigure(_this -> { AnnotatorState state = AnnotationFeatureForm.this.getModelObject(); _this.setVisible(state.getSelection().getAnnotation().isSet() && state.getSelection().isArc() && state.getSelectedAnnotationLayer() .getType().equals(WebAnnoConst.RELATION_TYPE)); // Avoid reversing in read-only layers _this.setEnabled(state.getSelectedAnnotationLayer() != null && !state.getSelectedAnnotationLayer().isReadonly()); })); return link; }
DocumentMetadataAnnotationDetailPanel.this, null, null, item.getModel()); if (!featureState.feature.getLayer().isReadonly()) {
DocumentMetadataAnnotationDetailPanel.this, null, null, item.getModel()); if (!featureState.feature.getLayer().isReadonly()) {
private LambdaAjaxLink createDeleteButton() { LambdaAjaxLink link = new LambdaAjaxLink("delete", this::actionDelete); link.setOutputMarkupPlaceholderTag(true); link.add(visibleWhen(() -> getModelObject().getSelection().getAnnotation().isSet())); // Avoid deleting in read-only layers link.add(enabledWhen(() -> getModelObject().getSelectedAnnotationLayer() != null && !getModelObject().getSelectedAnnotationLayer().isReadonly())); return link; }
AnnotationFeatureForm.this.getModel(), item.getModel()); if (!featureState.feature.getLayer().isReadonly()) { AnnotatorState state = getModelObject();
if (state.getSelectedAnnotationLayer().isReadonly()) { error("Layer is not editable."); aTarget.addChildren(getPage(), IFeedback.class);
exLayer.setAllowStacking(aLayer.isAllowStacking()); exLayer.setBuiltIn(aLayer.isBuiltIn()); exLayer.setReadonly(aLayer.isReadonly()); exLayer.setCrossSentence(aLayer.isCrossSentence()); exLayer.setDescription(aLayer.getDescription());
&& state.getSelectedAnnotationLayer().isReadonly()) { state.setSelectedAnnotationLayer(new AnnotationLayer());
exLayer.setAllowStacking(aLayer.isAllowStacking()); exLayer.setBuiltIn(aLayer.isBuiltIn()); exLayer.setReadonly(aLayer.isReadonly()); exLayer.setCrossSentence(aLayer.isCrossSentence()); exLayer.setDescription(aLayer.getDescription());
AnnotationFS fs = selectByAddr(jCas, state.getSelection().getAnnotation().getId()); if (layer.isReadonly()) { error("Cannot replace an annotation on a read-only layer."); aTarget.addChildren(getPage(), IFeedback.class);
exLayer.setAllowStacking(aLayer.isAllowStacking()); exLayer.setBuiltIn(aLayer.isBuiltIn()); exLayer.setReadonly(aLayer.isReadonly()); exLayer.setCrossSentence(aLayer.isCrossSentence()); exLayer.setDescription(aLayer.getDescription());
exLayer.setAllowStacking(aLayer.isAllowStacking()); exLayer.setBuiltIn(aLayer.isBuiltIn()); exLayer.setReadonly(aLayer.isReadonly()); exLayer.setCrossSentence(aLayer.isCrossSentence()); exLayer.setDescription(aLayer.getDescription());
TypeAdapter adapter = annotationService.getAdapter(layer); if (layer.isReadonly()) { error("Cannot delete an annotation on a read-only layer."); aTarget.addChildren(getPage(), IFeedback.class);
AnnotationLayer currentLayer = annotationService.getLayer(state.getProject(), fs); if (currentLayer.isReadonly()) { error("Cannot replace an annotation on a read-only layer."); aTarget.addChildren(getPage(), IFeedback.class);