} else if (dataType.equals(Constants.TREE_KEY)) {
List<EditFieldCommand> treeList = data.getTreeList();
for (int i = 0; i < treeList.size(); i++) {
EditFieldCommand editFieldCommand = treeList.get(i);
// check if user update title
PhyloTree phyloTree = mPhyloTreeService.findByID(editFieldCommand
.getPhyloTree().getId());
phyloTree.setLabel(editFieldCommand.getPhyloTree().getLabel());
mPhyloTreeService.update(phyloTree);
if (!editFieldCommand.getChecked()) {
continue; // skip current iteration if not
}
// checked
AnalyzedTree analyzedTree = new AnalyzedTree();
analyzedTree.setInput(input);
analyzedTree.setTree(phyloTree);
analysisStep.addAnalyzedData(analyzedTree);
mAnalysisStepService.update(analysisStep);
}
} else if ( dataType.equals(Constants.TREE_LIST)) {
List<EditFieldCommand> treeBlockList = data.getTreeBlockList();
LOGGER.warn("Going to set tree block as analyzed data");
for ( int i = 0; i < treeBlockList.size(); i++ ) {
EditFieldCommand editFieldCommand = treeBlockList.get(i);
if ( ! editFieldCommand.getChecked() ) {
continue; // skip current iteration if not checked
}
TreeBlock treeBlock = mPhyloTreeService.findTreeBlockByID(editFieldCommand.getTreeBlock().getId());
if ( treeBlock == null ) {
LOGGER.warn("No treeblock!!!");
}
else {
LOGGER.warn(treeBlock.getTitle());
Iterator<PhyloTree> treeIterator = treeBlock.getTreeListIterator();
while (treeIterator.hasNext()) {
PhyloTree phyloTree = treeIterator.next();
AnalyzedTree analyzedTree = new AnalyzedTree();
analyzedTree.setInput(input);
analyzedTree.setTree(phyloTree);
analysisStep.addAnalyzedData(analyzedTree);
mAnalysisStepService.update(analysisStep);