else if (!layer.equals(other.layer)) { return false;
else if (!layer.equals(other.layer)) { return false;
else if (!layer.equals(other.layer)) { return false;
return false; if (layer != null ? !layer.equals(that.layer) : that.layer != null) { return false;
/** * Scan through the layers once to remember which layers attach to which layers. */ private static List<AnnotationLayer> getAttachingLayers(AnnotationLayer aTarget, List<AnnotationLayer> aLayers, AnnotationSchemaService aAnnotationService) { List<AnnotationLayer> attachingLayers = new ArrayList<>(); // Chains always attach to themselves if (CHAIN_TYPE.equals(aTarget.getType())) { attachingLayers.add(aTarget); } // FIXME This is a hack! Actually we should check the type of the attachFeature when // determine which layers attach to with other layers. Currently we only use attachType, // but do not follow attachFeature if it is set. if (aTarget.isBuiltIn() && aTarget.getName().equals(POS.class.getName())) { attachingLayers.add(aAnnotationService.getLayer(Dependency.class.getName(), aTarget.getProject())); } // Custom layers for (AnnotationLayer l : aLayers) { if (aTarget.equals(l.getAttachType())) { attachingLayers.add(l); } } return attachingLayers; }
/** * Scan through the layers once to remember which layers attach to which layers. */ private static List<AnnotationLayer> getAttachingLayers(AnnotationLayer aTarget, List<AnnotationLayer> aLayers, AnnotationSchemaService aAnnotationService) { List<AnnotationLayer> attachingLayers = new ArrayList<>(); // Chains always attach to themselves if (CHAIN_TYPE.equals(aTarget.getType())) { attachingLayers.add(aTarget); } // FIXME This is a hack! Actually we should check the type of the attachFeature when // determine which layers attach to with other layers. Currently we only use attachType, // but do not follow attachFeature if it is set. if (aTarget.isBuiltIn() && aTarget.getName().equals(POS.class.getName())) { attachingLayers.add(aAnnotationService.getLayer(Dependency.class.getName(), aTarget.getProject())); } // Custom layers for (AnnotationLayer l : aLayers) { if (aTarget.equals(l.getAttachType())) { attachingLayers.add(l); } } return attachingLayers; }
for (AnnotationLayer layer : annotationService.listAnnotationLayer(aBratAnnotatorModel .getProject())) { if (layer.getAttachType() != null && layer.getAttachType().equals(spanLayer)) { this.selectedLayer = layer; break;
/** * Listens to the user deleting an annotation in the main annotation editor. */ @OnEvent public void onAnnotationDeleted(SpanDeletedEvent aEvent) { AnnotatorState state = getModelObject(); ActiveLearningUserState alState = alStateModel.getObject(); // If the user creates a new annotation at the site of the suggestion that is currently // offered to the user, then the AL should move on to the next available suggestion if ( alState.isSessionActive() && (!alState.getSuggestion().isPresent() || ( aEvent.getUser().equals(state.getUser().getUsername()) && aEvent.getDocument().equals(state.getDocument()) && aEvent.getLayer().equals(alState.getLayer()))) ) { reactToAnnotationsBeingCreatedOrDeleted(aEvent.getRequestTarget(), aEvent.getLayer()); } }
/** * Listens to the user setting a feature on an annotation in the main annotation editor. Mind * that we do not need to listen to the creation of annotations since they have no effect on * the active learning sidebar as long as they have no features set. */ @OnEvent public void onFeatureValueUpdated(FeatureValueUpdatedEvent aEvent) { AnnotatorState state = getModelObject(); ActiveLearningUserState alState = alStateModel.getObject(); // If the user creates a new annotation at the site of the suggestion that is currently // offered to the user, then the AL should move on to the next available suggestion if ( alState.isSessionActive() && (!alState.getSuggestion().isPresent() || ( aEvent.getUser().equals(state.getUser().getUsername()) && aEvent.getDocument().equals(state.getDocument()) && aEvent.getFeature().getLayer().equals(alState.getLayer()) && aEvent.getFeature().getName().equals(alState.getSuggestion().get().getFeature()))) ) { reactToAnnotationsBeingCreatedOrDeleted(aEvent.getRequestTarget(), aEvent.getFeature().getLayer()); } }
/** * Listens to the user deleting an annotation in the main annotation editor. */ @OnEvent public void onAnnotationDeleted(SpanDeletedEvent aEvent) { AnnotatorState state = getModelObject(); ActiveLearningUserState alState = alStateModel.getObject(); // If the user creates a new annotation at the site of the suggestion that is currently // offered to the user, then the AL should move on to the next available suggestion if ( alState.isSessionActive() && (!alState.getSuggestion().isPresent() || ( aEvent.getUser().equals(state.getUser().getUsername()) && aEvent.getDocument().equals(state.getDocument()) && aEvent.getLayer().equals(alState.getLayer()))) ) { reactToAnnotationsBeingCreatedOrDeleted(aEvent.getRequestTarget(), aEvent.getLayer()); } }
/** * Listens to the user setting a feature on an annotation in the main annotation editor. Mind * that we do not need to listen to the creation of annotations since they have no effect on * the active learning sidebar as long as they have no features set. */ @OnEvent public void onFeatureValueUpdated(FeatureValueUpdatedEvent aEvent) { AnnotatorState state = getModelObject(); ActiveLearningUserState alState = alStateModel.getObject(); // If the user creates a new annotation at the site of the suggestion that is currently // offered to the user, then the AL should move on to the next available suggestion if ( alState.isSessionActive() && (!alState.getSuggestion().isPresent() || ( aEvent.getUser().equals(state.getUser().getUsername()) && aEvent.getDocument().equals(state.getDocument()) && aEvent.getFeature().getLayer().equals(alState.getLayer()) && aEvent.getFeature().getName().equals(alState.getSuggestion().get().getFeature()))) ) { reactToAnnotationsBeingCreatedOrDeleted(aEvent.getRequestTarget(), aEvent.getFeature().getLayer()); } }
state.getPreferences().isRememberLayer() && !spanLayer.equals(state.getDefaultAnnotationLayer()) ) { throw new AnnotationException("No relation annotation allowed on layer [" .getProject())) { if ( (l.getAttachType() != null && l.getAttachType().equals(spanLayer)) || (l.getAttachFeature() != null && l.getAttachFeature().getType().equals(spanLayer.getName()))