X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Fdevelopment%2FDevelopmentTools.java;h=3cbc3858488ba54e2bb01cf0ffb4848eef97521f;hb=8fc867798b6ec30cc78497396288922b574045e9;hp=d41194a7fe3e67526a188d0023f5219ca0494893;hpb=eccc2fdb674f76be1815fd7984295661bff8a2be;p=jalview.git diff --git a/forester/java/src/org/forester/development/DevelopmentTools.java b/forester/java/src/org/forester/development/DevelopmentTools.java index d41194a..3cbc385 100644 --- a/forester/java/src/org/forester/development/DevelopmentTools.java +++ b/forester/java/src/org/forester/development/DevelopmentTools.java @@ -5,7 +5,7 @@ // Copyright (C) 2008-2009 Christian M. Zmasek // Copyright (C) 2008-2009 Burnham Institute for Medical Research // All rights reserved -// +// // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either @@ -15,18 +15,19 @@ // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. -// +// // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA // // Contact: phylosoft @ gmail . com -// WWW: www.phylosoft.org/forester +// WWW: https://sites.google.com/site/cmzmasek/home/software/forester package org.forester.development; import java.util.Random; +import org.forester.io.parsers.phyloxml.PhyloXmlDataFormatException; import org.forester.phylogeny.Phylogeny; import org.forester.phylogeny.PhylogenyMethods; import org.forester.phylogeny.PhylogenyNode; @@ -133,7 +134,12 @@ public final class DevelopmentTools { PhylogenyNode n = t.getFirstExternalNode(); int j = t.getRoot().getNumberOfExternalNodes(); while ( n != null ) { - PhylogenyMethods.setTaxonomyCode( n, j + "" ); + try { + PhylogenyMethods.setTaxonomyCode( n, j + "" ); + } + catch ( final PhyloXmlDataFormatException e ) { + e.printStackTrace(); + } j--; n = n.getNextExternalNode(); } @@ -176,8 +182,13 @@ public final class DevelopmentTools { final Random r = new Random(); PhylogenyNode n = t.getFirstExternalNode(); while ( n != null ) { - final String code = ( ( Math.abs( r.nextInt() ) % ( ma - mi + 1 ) ) + mi ) + ""; - PhylogenyMethods.setTaxonomyCode( n, code ); + final String code = ( ( Math.abs( r.nextInt() ) % ( ( ma - mi ) + 1 ) ) + mi ) + ""; + try { + PhylogenyMethods.setTaxonomyCode( n, code ); + } + catch ( final PhyloXmlDataFormatException e ) { + e.printStackTrace(); + } n = n.getNextExternalNode(); } }