use of com.vaadin.ui.Slider.ValueOutOfBoundsException in project catma by forTEXT.
the class TaggerView method initData.
private void initData(final AfterDocumentLoadedOperation afterDocumentLoadedOperation) {
if (sourceDocument != null) {
// loading of the Document is done in an extra step,
// because of a client side rendering racing condition which prevents the first page to be displayed
final UI ui = UI.getCurrent();
((CatmaApplication) ui).submit("Load Document", new DefaultProgressCallable<Void>() {
@Override
public Void call() throws Exception {
ui.accessSynchronously(() -> {
try {
linesPerPageSlider.setEnabled(true);
btAnalyze.setEnabled(project instanceof IndexedProject);
pagerComponent.setEnabled(true);
TaggerView.this.comments.clear();
TaggerView.this.comments.addAll(TaggerView.this.project.getComments(sourceDocument.getUuid()));
tagger.setText(sourceDocument.getContent(), TaggerView.this.comments);
totalLineCount = pager.getTotalLineCount();
try {
linesPerPageSlider.setValue((100.0 / totalLineCount) * maxPageLengthInLines);
} catch (ValueOutOfBoundsException toBeIgnored) {
}
List<AnnotationCollectionReference> collectionReferences = resourcePanel.getSelectedAnnotationCollectionReferences();
userMarkupCollectionManager.clear();
for (AnnotationCollectionReference collectionRef : collectionReferences) {
AnnotationCollection collection = project.getUserMarkupCollection(collectionRef);
userMarkupCollectionManager.add(collection);
}
Collection<TagsetDefinition> tagsets = new HashSet<>(resourcePanel.getSelectedTagsets());
annotationPanel.setData(sourceDocument, tagsets, new ArrayList<>(userMarkupCollectionManager.getUserMarkupCollections()));
if (taggerContextMenu != null) {
taggerContextMenu.setTagsets(tagsets);
}
if (afterDocumentLoadedOperation != null) {
afterDocumentLoadedOperation.afterDocumentLoaded(TaggerView.this);
}
ui.push();
} catch (IOException e) {
errorHandler.showAndLogError("Error showing the Document!", e);
}
});
return null;
}
}, new ExecutionListener<Void>() {
@Override
public void done(Void result) {
/*noop*/
}
@Override
public void error(Throwable t) {
errorHandler.showAndLogError("Error showing the Document!", t);
}
});
} else {
linesPerPageSlider.setEnabled(false);
btAnalyze.setEnabled(false);
pagerComponent.setEnabled(false);
}
}
Aggregations