/** * 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 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()); } }