if (state.getDefaultAnnotationLayer() != null) { state.setSelectedAnnotationLayer(state.getDefaultAnnotationLayer());
private Label createNoRecommendersMessage() { if (!alStateModel.getObject().isSessionActive()) { // Use the currently selected layer from the annotation detail editor panel as the // default choice in the active learning mode. List<AnnotationLayer> layersWithRecommenders = listLayersWithRecommenders(); if (layersWithRecommenders.contains(getModelObject().getDefaultAnnotationLayer())) { alStateModel.getObject() .setLayer(getModelObject().getDefaultAnnotationLayer()); } // If the currently selected layer has no recommenders, use the first one which has else if (!layersWithRecommenders.isEmpty()) { alStateModel.getObject().setLayer(layersWithRecommenders.get(0)); } // If there are no layers with recommenders, then choose nothing and show no // recommenders message. else { alStateModel.getObject().setLayer(null); alStateModel.getObject().setDoExistRecommenders(false); } } Label noRecommendersMessage = new Label(CID_NO_RECOMMENDERS, "None of the layers have any " + "recommenders configured. Please set the recommenders first in the Project " + "Settings."); noRecommendersMessage.add(LambdaBehavior.onConfigure(component -> component.setVisible (!alStateModel.getObject().isDoExistRecommenders()))); return noRecommendersMessage; }
private Label createNoRecommendersMessage() { if (!alStateModel.getObject().isSessionActive()) { // Use the currently selected layer from the annotation detail editor panel as the // default choice in the active learning mode. List<AnnotationLayer> layersWithRecommenders = listLayersWithRecommenders(); if (layersWithRecommenders.contains(getModelObject().getDefaultAnnotationLayer())) { alStateModel.getObject() .setLayer(getModelObject().getDefaultAnnotationLayer()); } // If the currently selected layer has no recommenders, use the first one which has else if (!layersWithRecommenders.isEmpty()) { alStateModel.getObject().setLayer(layersWithRecommenders.get(0)); } // If there are no layers with recommenders, then choose nothing and show no // recommenders message. else { alStateModel.getObject().setLayer(null); alStateModel.getObject().setDoExistRecommenders(false); } } Label noRecommendersMessage = new Label(CID_NO_RECOMMENDERS, "None of the layers have any " + "recommenders configured. Please set the recommenders first in the Project " + "Settings."); noRecommendersMessage.add(LambdaBehavior.onConfigure(component -> component.setVisible (!alStateModel.getObject().isDoExistRecommenders()))); return noRecommendersMessage; }
state.setSelectedAnnotationLayer(state.getDefaultAnnotationLayer()); state.getDefaultAnnotationLayer()) && state.getSelection().getAnnotation().isSet()) { try { state.setSelectedAnnotationLayer(state.getDefaultAnnotationLayer()); selectedAnnotationLayer .setDefaultModelObject(Optional.ofNullable(state.getDefaultAnnotationLayer()) .map(AnnotationLayer::getUiName).orElse(null)); aTarget.add(selectedAnnotationLayer); if (state.getDefaultAnnotationLayer() != null) { state.getPreferences().setDefaultLayer(state.getDefaultAnnotationLayer().getId());
void updateRememberLayer() { AnnotatorState state = getModelObject(); if (state.getPreferences().isRememberLayer()) { if (state.getDefaultAnnotationLayer() == null) { state.setDefaultAnnotationLayer(state.getSelectedAnnotationLayer()); } } else if (!state.getSelection().isArc()) { state.setDefaultAnnotationLayer(state.getSelectedAnnotationLayer()); } // if no layer is selected in Settings if (state.getSelectedAnnotationLayer() != null) { selectedAnnotationLayer.setDefaultModelObject( state.getSelectedAnnotationLayer().getUiName()); } }
state.getPreferences().isRememberLayer() && !spanLayer.equals(state.getDefaultAnnotationLayer()) ) { throw new AnnotationException("No relation annotation allowed on layer [" + state.getDefaultAnnotationLayer().getUiName() + "]");
state.getSelectedAnnotationLayer().getUiName()); LOG.trace("actionAnnotate() defaultLayer: {}", state.getDefaultAnnotationLayer().getUiName());