use of annis.service.objects.FrequencyTable in project ANNIS by korpling.
the class FrequencyResultPanel method showResult.
private void showResult(FrequencyTable table) {
if (queryPanel != null) {
queryPanel.notifiyQueryFinished();
}
recreateTable(table);
btDownloadCSV.setVisible(true);
FileDownloader downloader = new FileDownloader(new StreamResource(new CSVResource(table, query.getFrequencyDefinition()), "frequency.txt"));
downloader.extend(btDownloadCSV);
chart.setVisible(true);
FrequencyTable clippedTable = table;
if (clippedTable.getEntries().size() > MAX_NUMBER_OF_CHART_ITEMS) {
List<FrequencyTable.Entry> entries = new ArrayList<>(clippedTable.getEntries());
clippedTable = new FrequencyTable();
clippedTable.setEntries(entries.subList(0, MAX_NUMBER_OF_CHART_ITEMS));
clippedTable.setSum(table.getSum());
chart.setCaption("Showing historgram of top " + MAX_NUMBER_OF_CHART_ITEMS + " results, see table below for complete dataset.");
}
chart.setFrequencyData(clippedTable);
}
Aggregations