X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Farchaeopteryx%2FTreePanelUtil.java;h=b58894d2f5e2775762d1f40cef67c0a660bb41d7;hb=54d8e3a926c3cf3477199c8b85aca478230e223c;hp=fd537b0bf4540ba00fff7ba1b74fc9ed8f3194f8;hpb=a9bc4199e1044343a9dfa25332779adf317184a8;p=jalview.git diff --git a/forester/java/src/org/forester/archaeopteryx/TreePanelUtil.java b/forester/java/src/org/forester/archaeopteryx/TreePanelUtil.java index fd537b0..b58894d 100644 --- a/forester/java/src/org/forester/archaeopteryx/TreePanelUtil.java +++ b/forester/java/src/org/forester/archaeopteryx/TreePanelUtil.java @@ -26,7 +26,7 @@ import org.forester.phylogeny.PhylogenyNode; import org.forester.phylogeny.data.Accession; import org.forester.phylogeny.data.Annotation; import org.forester.phylogeny.data.BranchColor; -import org.forester.phylogeny.data.NodeData.NODE_DATA; +import org.forester.phylogeny.data.NodeDataField; import org.forester.phylogeny.data.Sequence; import org.forester.phylogeny.data.Taxonomy; import org.forester.phylogeny.iterators.PhylogenyNodeIterator; @@ -150,7 +150,7 @@ public class TreePanelUtil { if ( cp.isShowSeqSymbols() && node.getNodeData().isHasSequence() && !ForesterUtil.isEmpty( node.getNodeData().getSequence().getSymbol() ) ) { TreePanelUtil - .showExtDescNodeDataUserSelectedHelperHelper( node.getNodeData().getSequence().getSymbol(), sb ); + .showExtDescNodeDataUserSelectedHelperHelper( node.getNodeData().getSequence().getSymbol(), sb ); } if ( cp.isShowGeneNames() && node.getNodeData().isHasSequence() && !ForesterUtil.isEmpty( node.getNodeData().getSequence().getGeneName() ) ) { @@ -161,29 +161,29 @@ public class TreePanelUtil { && ( node.getNodeData().getSequence().getAccession() != null ) && !ForesterUtil.isEmpty( node.getNodeData().getSequence().getAccession().toString() ) ) { TreePanelUtil.showExtDescNodeDataUserSelectedHelperHelper( node.getNodeData().getSequence().getAccession() - .toString(), sb ); + .toString(), sb ); } if ( cp.isShowTaxonomyCode() && node.getNodeData().isHasTaxonomy() && !ForesterUtil.isEmpty( node.getNodeData().getTaxonomy().getTaxonomyCode() ) ) { TreePanelUtil.showExtDescNodeDataUserSelectedHelperHelper( node.getNodeData().getTaxonomy() - .getTaxonomyCode(), sb ); + .getTaxonomyCode(), sb ); } if ( cp.isShowTaxonomyScientificNames() && node.getNodeData().isHasTaxonomy() && !ForesterUtil.isEmpty( node.getNodeData().getTaxonomy().getScientificName() ) ) { TreePanelUtil.showExtDescNodeDataUserSelectedHelperHelper( node.getNodeData().getTaxonomy() - .getScientificName(), sb ); + .getScientificName(), sb ); } if ( cp.isShowTaxonomyCommonNames() && node.getNodeData().isHasTaxonomy() && !ForesterUtil.isEmpty( node.getNodeData().getTaxonomy().getCommonName() ) ) { TreePanelUtil - .showExtDescNodeDataUserSelectedHelperHelper( node.getNodeData().getTaxonomy().getCommonName(), sb ); - } - if ( ( cp.isShowSeqNames() || cp.isShowSeqSymbols() || cp.isShowSequenceAcc() ) - && node.getNodeData().isHasSequence() - && !ForesterUtil.isEmpty( node.getNodeData().getSequence().getMolecularSequence() ) ) { - TreePanelUtil.showExtDescNodeDataUserSelectedHelperHelper( node.getNodeData().getSequence() - .getMolecularSequence(), sb ); - } + .showExtDescNodeDataUserSelectedHelperHelper( node.getNodeData().getTaxonomy().getCommonName(), sb ); + } + // if ( ( cp.isShowSeqNames() || cp.isShowSeqSymbols() || cp.isShowSequenceAcc() ) + // && node.getNodeData().isHasSequence() + // && !ForesterUtil.isEmpty( node.getNodeData().getSequence().getMolecularSequence() ) ) { + // TreePanelUtil.showExtDescNodeDataUserSelectedHelperHelper( node.getNodeData().getSequence() + // .getMolecularSequence(), sb ); + // } final String s = sb.toString().trim(); if ( !ForesterUtil.isEmpty( s ) ) { data.add( s ); @@ -211,7 +211,7 @@ public class TreePanelUtil { TreePanelUtil.collapseSubtree( n, true ); if ( !n.getNodeData().isHasTaxonomy() ) { n.getNodeData().setTaxonomy( ( Taxonomy ) n.getAllExternalDescendants().get( 0 ).getNodeData() - .getTaxonomy().copy() ); + .getTaxonomy().copy() ); } inferred = true; } @@ -283,7 +283,7 @@ public class TreePanelUtil { final List descs = PhylogenyMethods.getAllDescendants( n ); for( final PhylogenyNode desc : descs ) { desc.getBranchData() - .setBranchColor( new BranchColor( tree_panel.calculateTaxonomyBasedColor( tax ) ) ); + .setBranchColor( new BranchColor( tree_panel.calculateTaxonomyBasedColor( tax ) ) ); } } } @@ -298,11 +298,11 @@ public class TreePanelUtil { if ( n.getNodeData().isHasTaxonomy() && ( !ForesterUtil.isEmpty( n.getNodeData().getTaxonomy().getScientificName() ) || !ForesterUtil.isEmpty( n.getNodeData().getTaxonomy().getCommonName() ) || !ForesterUtil - .isEmpty( n.getNodeData().getTaxonomy().getTaxonomyCode() ) ) ) { + .isEmpty( n.getNodeData().getTaxonomy().getTaxonomyCode() ) ) ) { if ( !ForesterUtil.isEmpty( n.getNodeData().getTaxonomy().getRank() ) && n.getNodeData().getTaxonomy().getRank().equalsIgnoreCase( rank ) ) { final BranchColor c = new BranchColor( tree_panel.calculateTaxonomyBasedColor( n.getNodeData() - .getTaxonomy() ) ); + .getTaxonomy() ) ); TreePanelUtil.colorizeSubtree( n, c ); ++colorizations; if ( !ForesterUtil.isEmpty( n.getNodeData().getTaxonomy().getScientificName() ) ) { @@ -320,7 +320,7 @@ public class TreePanelUtil { for( final String lin : node.getNodeData().getTaxonomy().getLineage() ) { if ( true_lineage_to_color_map.containsKey( lin ) ) { TreePanelUtil - .colorizeSubtree( node, new BranchColor( true_lineage_to_color_map.get( lin ) ) ); + .colorizeSubtree( node, new BranchColor( true_lineage_to_color_map.get( lin ) ) ); ++colorizations; success = true; break; @@ -439,12 +439,11 @@ public class TreePanelUtil { .getSynonyms().isEmpty() ); } - static int nodeDataIntoStringBuffer( final List data, final Options optz, final StringBuilder sb ) { + static final int nodeDataIntoStringBuffer( final List data, final Options optz, final StringBuilder sb ) { final SortedMap map = new TreeMap(); int size = 0; - if ( ( optz.getExtDescNodeDataToReturn() != NODE_DATA.SEQUENCE_MOL_SEQ ) - && ( optz.getExtDescNodeDataToReturn() != NODE_DATA.SEQUENCE_MOL_SEQ_FASTA ) - && ( optz.getExtDescNodeDataToReturn() != NODE_DATA.GO_TERM_IDS ) ) { + if ( ( optz.getExtDescNodeDataToReturn() != NodeDataField.SEQUENCE_MOL_SEQ_FASTA ) + && ( optz.getExtDescNodeDataToReturn() != NodeDataField.GO_TERM_IDS ) ) { for( final String d : data ) { if ( !ForesterUtil.isEmpty( d ) ) { if ( map.containsKey( d ) ) { @@ -455,9 +454,9 @@ public class TreePanelUtil { } } } - if ( ( optz.getExtDescNodeDataToReturn() == NODE_DATA.DOMAINS_ALL ) - || ( optz.getExtDescNodeDataToReturn() == NODE_DATA.DOMAINS_COLLAPSED_PER_PROTEIN ) - || ( optz.getExtDescNodeDataToReturn() == NODE_DATA.SEQ_ANNOTATIONS ) ) { + if ( ( optz.getExtDescNodeDataToReturn() == NodeDataField.DOMAINS_ALL ) + || ( optz.getExtDescNodeDataToReturn() == NodeDataField.DOMAINS_COLLAPSED_PER_PROTEIN ) + || ( optz.getExtDescNodeDataToReturn() == NodeDataField.SEQ_ANNOTATIONS ) ) { final ArrayList sis = new ArrayList(); for( final Entry e : map.entrySet() ) { sis.add( new StringInt( e.getKey(), e.getValue() ) );