+
+ public final static void outOfMemoryError( final OutOfMemoryError e ) {
+ System.err.println();
+ System.err.println( "Java memory allocation might be too small, try \"-Xmx2048m\" java command line option" );
+ System.err.println();
+ e.printStackTrace( System.err );
+ System.err.println();
+ System.exit( -1 );
+ }
+
+ public final static Color obtainColorDependingOnTaxonomyGroup( final String tax_group ) {
+ if ( !ForesterUtil.isEmpty( tax_group ) ) {
+ if ( tax_group.equals( "deuterostomia" ) ) {
+ return TaxonomyColors.DEUTEROSTOMIA_COLOR;
+ }
+ else if ( tax_group.equals( "protostomia" ) ) {
+ return TaxonomyColors.PROTOSTOMIA_COLOR;
+ }
+ else if ( tax_group.equals( "cnidaria" ) ) {
+ return TaxonomyColors.CNIDARIA_COLOR;
+ }
+ else if ( tax_group.equals( "placozoa" ) ) {
+ return TaxonomyColors.PLACOZOA_COLOR;
+ }
+ else if ( tax_group.equals( "ctenophora" ) ) {
+ return TaxonomyColors.CTENOPHORA_COLOR;
+ }
+ else if ( tax_group.equals( "porifera" ) ) {
+ return TaxonomyColors.PORIFERA_COLOR;
+ }
+ else if ( tax_group.equals( "choanoflagellida" ) ) {
+ return TaxonomyColors.CHOANOFLAGELLIDA;
+ }
+ else if ( tax_group.equals( "ichthyophonida & filasterea" ) ) {
+ return TaxonomyColors.ICHTHYOSPOREA_AND_FILASTEREA;
+ }
+ else if ( tax_group.equals( "dikarya" ) ) {
+ return TaxonomyColors.DIKARYA_COLOR;
+ }
+ else if ( tax_group.equalsIgnoreCase( "fungi" ) || tax_group.equalsIgnoreCase( "other fungi" ) ) {
+ return TaxonomyColors.OTHER_FUNGI_COLOR;
+ }
+ else if ( tax_group.equals( "nucleariidae and fonticula" ) ) {
+ return TaxonomyColors.NUCLEARIIDAE_AND_FONTICULA_GROUP_COLOR;
+ }
+ else if ( tax_group.equals( "amoebozoa" ) ) {
+ return TaxonomyColors.AMOEBOZOA_COLOR;
+ }
+ else if ( tax_group.equals( "embryophyta" ) ) {
+ return TaxonomyColors.EMBRYOPHYTA_COLOR;
+ }
+ else if ( tax_group.equals( "chlorophyta" ) ) {
+ return TaxonomyColors.CHLOROPHYTA_COLOR;
+ }
+ else if ( tax_group.equals( "rhodophyta" ) ) {
+ return TaxonomyColors.RHODOPHYTA_COLOR;
+ }
+ else if ( tax_group.equals( "hacrobia" ) ) {
+ return TaxonomyColors.HACROBIA_COLOR;
+ }
+ else if ( tax_group.equals( "glaucocystophyceae" ) ) {
+ return TaxonomyColors.GLAUCOPHYTA_COLOR;
+ }
+ else if ( tax_group.equals( "stramenopiles" ) ) {
+ return TaxonomyColors.STRAMENOPILES_COLOR;
+ }
+ else if ( tax_group.equals( "alveolata" ) ) {
+ return TaxonomyColors.ALVEOLATA_COLOR;
+ }
+ else if ( tax_group.equals( "rhizaria" ) ) {
+ return TaxonomyColors.RHIZARIA_COLOR;
+ }
+ else if ( tax_group.equals( "excavata" ) ) {
+ return TaxonomyColors.EXCAVATA_COLOR;
+ }
+ else if ( tax_group.equals( "apusozoa" ) ) {
+ return TaxonomyColors.APUSOZOA_COLOR;
+ }
+ else if ( tax_group.equals( "archaea" ) ) {
+ return TaxonomyColors.ARCHAEA_COLOR;
+ }
+ else if ( tax_group.equals( "bacteria" ) ) {
+ return TaxonomyColors.BACTERIA_COLOR;
+ }
+ }
+ return null;
+ }
+
+ public final static String obtainNormalizedTaxonomyGroup( final String tax ) {
+ if ( tax.equalsIgnoreCase( "deuterostomia" ) ) {
+ return "deuterostomia";
+ }
+ else if ( tax.equalsIgnoreCase( "protostomia" ) ) {
+ return "protostomia";
+ }
+ else if ( tax.equalsIgnoreCase( "cnidaria" ) ) {
+ return "cnidaria";
+ }
+ else if ( tax.toLowerCase().startsWith( "trichoplax" ) || tax.equalsIgnoreCase( "placozoa" ) ) {
+ return "placozoa";
+ }
+ else if ( tax.toLowerCase().startsWith( "mnemiopsis" ) || tax.equalsIgnoreCase( "ctenophora" ) ) {
+ return "ctenophora";
+ }
+ else if ( tax.toLowerCase().startsWith( "amphimedon" ) || tax.equalsIgnoreCase( "porifera" ) ) {
+ return "porifera";
+ }
+ else if ( tax.equalsIgnoreCase( "codonosigidae" ) || tax.equalsIgnoreCase( "choanoflagellida" ) ) {
+ return "choanoflagellida";
+ }
+ else if ( tax.toLowerCase().startsWith( "ichthyophonida & filasterea" )
+ || tax.toLowerCase().startsWith( "ichthyophonida and filasterea" )
+ || tax.toLowerCase().startsWith( "ichthyosporea & filasterea" )
+ || tax.toLowerCase().startsWith( "ichthyosporea and filasterea" ) ) {
+ return "ichthyophonida & filasterea";
+ }
+ else if ( tax.equalsIgnoreCase( "dikarya" ) ) {
+ return "dikarya";
+ }
+ else if ( tax.equalsIgnoreCase( "other fungi" ) ) {
+ return "other fungi";
+ }
+ else if ( tax.toLowerCase().startsWith( "nucleariidae and fonticula" ) ) {
+ return "nucleariidae and fonticula group";
+ }
+ else if ( tax.equalsIgnoreCase( "amoebozoa" ) ) {
+ return "amoebozoa";
+ }
+ else if ( tax.equalsIgnoreCase( "embryophyta" ) ) {
+ return "embryophyta";
+ }
+ else if ( tax.equalsIgnoreCase( "chlorophyta" ) ) {
+ return "chlorophyta";
+ }
+ else if ( tax.equalsIgnoreCase( "rhodophyta" ) ) {
+ return "rhodophyta";
+ }
+ else if ( tax.toLowerCase().startsWith( "hacrobia" ) ) {
+ return "hacrobia";
+ }
+ else if ( tax.equalsIgnoreCase( "glaucocystophyceae" ) || tax.equalsIgnoreCase( "glaucophyta" ) ) {
+ return "glaucocystophyceae";
+ }
+ else if ( tax.equalsIgnoreCase( "stramenopiles" ) ) {
+ return "stramenopiles";
+ }
+ else if ( tax.equalsIgnoreCase( "alveolata" ) ) {
+ return "alveolata";
+ }
+ else if ( tax.equalsIgnoreCase( "rhizaria" ) ) {
+ return "rhizaria";
+ }
+ else if ( tax.equalsIgnoreCase( "excavata" ) ) {
+ return "excavata";
+ }
+ else if ( tax.equalsIgnoreCase( "apusozoa" ) ) {
+ return "apusozoa";
+ }
+ else if ( tax.equalsIgnoreCase( "archaea" ) ) {
+ return "archaea";
+ }
+ else if ( tax.equalsIgnoreCase( "bacteria" ) ) {
+ return "bacteria";
+ }
+ return null;
+ }