cnode = (CategoryNode)n;
else // patternnode
cnode = (CategoryNode)n.getParent();
final CategoryNode catnode = cnode;
TaskWorker tworker = new TaskWorker(yoshikoder){
YKDictionaryReportDialog dia;
protected void doWork() throws Exception {
TokenizationCache tcache = yoshikoder.getTokenizationCache();
TokenList tl = tcache.getTokenList(doc);
if (tl == null){
tl = TokenizationService.getTokenizationService().tokenize(doc);
tcache.putTokenList(doc, tl);
}
EntryFrequencyMap efm = new EntryFrequencyMap(catnode, tl);
DictionaryFrequencyReport catsAndPats =
new DictionaryFrequencyReport("Dictionary Entry Frequencies",
"Frequencies of each dictionary entry in " + doc.getTitle(),
yoshikoder.getDictionary().getName(),
doc, efm, true);
DictionaryFrequencyReport catsOnly =
new DictionaryFrequencyReport("Dictionary Entry Frequencies",
"Frequencies of each dictionary entry in " + doc.getTitle(),
yoshikoder.getDictionary().getName(),
doc, efm, false);
dia = new YKDictionaryReportDialog(yoshikoder, catsOnly, catsAndPats, onlyShowCats);
}
protected void onSuccess() {
dia.setVisible(true);
// why is this called without the dialog returning
onlyShowCats = !dia.getCurrentReport().getShowPatterns();
log.info("now closed dialog said that the cats only flag was set when it last looked? " + onlyShowCats);
}
protected void onError() {
if (e instanceof TokenizationException){
DialogUtil.yelp(yoshikoder, "Tokenization Error", e);
} else if (e instanceof IOException){
DialogUtil.yelp(yoshikoder, "Input/Ouput Error", e);
} else {
DialogUtil.yelp(yoshikoder, "Error", e);
}
}
};
tworker.start();
}