inprogress
[jalview.git] / forester / java / src / org / forester / archaeopteryx / Configuration.java
1 // $Id:
2 // FORESTER -- software libraries and applications
3 // for evolutionary biology research and applications.
4 //
5 // Copyright (C) 2008-2009 Christian M. Zmasek
6 // Copyright (C) 2008-2009 Burnham Institute for Medical Research
7 // Copyright (C) 2000-2001 Washington University School of Medicine
8 // and Howard Hughes Medical Institute
9 // Copyright (C) 2003-2007 Ethalinda K.S. Cannon
10 // All rights reserved
11 //
12 // This library is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU Lesser General Public
14 // License as published by the Free Software Foundation; either
15 // version 2.1 of the License, or (at your option) any later version.
16 //
17 // This library is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 // Lesser General Public License for more details.
21 //
22 // You should have received a copy of the GNU Lesser General Public
23 // License along with this library; if not, write to the Free Software
24 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25 //
26 // Contact: phylosoft @ gmail . com
27 // WWW: https://sites.google.com/site/cmzmasek/home/software/forester
28
29 package org.forester.archaeopteryx;
30
31 import java.awt.Color;
32 import java.io.BufferedReader;
33 import java.io.File;
34 import java.io.FileReader;
35 import java.io.IOException;
36 import java.io.InputStreamReader;
37 import java.net.URL;
38 import java.util.Arrays;
39 import java.util.Hashtable;
40 import java.util.Map;
41 import java.util.SortedMap;
42 import java.util.StringTokenizer;
43 import java.util.TreeMap;
44
45 import org.forester.archaeopteryx.Options.CLADOGRAM_TYPE;
46 import org.forester.archaeopteryx.Options.NODE_LABEL_DIRECTION;
47 import org.forester.archaeopteryx.Options.OVERVIEW_PLACEMENT_TYPE;
48 import org.forester.archaeopteryx.Options.PHYLOGENY_GRAPHICS_TYPE;
49 import org.forester.io.parsers.nhx.NHXParser.TAXONOMY_EXTRACTION;
50 import org.forester.phylogeny.data.NodeData.NODE_DATA;
51 import org.forester.phylogeny.data.NodeVisualization;
52 import org.forester.phylogeny.data.NodeVisualization.NodeFill;
53 import org.forester.phylogeny.data.NodeVisualization.NodeShape;
54 import org.forester.util.ForesterUtil;
55
56 public final class Configuration {
57
58     static final String                     VALIDATE_AGAINST_PHYLOXML_XSD_SCHEMA                   = "validate_against_phyloxml_xsd_schema";
59     private static final String             DISPLAY_COLOR_KEY                                      = "display_color";
60     private static final int                DEPRECATED                                             = -2;
61     private UI                              _ui                                                    = UI.UNKNOWN;
62     private boolean                         _use_tabbed_display                                    = false;
63     private boolean                         _hide_controls_and_menus                               = false;
64     private CLADOGRAM_TYPE                  _cladogram_type                                        = Constants.CLADOGRAM_TYPE_DEFAULT;
65     private SortedMap<String, Color>        _display_colors                                        = null;
66     private boolean                         _antialias_screen                                      = true;
67     private PHYLOGENY_GRAPHICS_TYPE         _phylogeny_graphics_type                               = PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR;
68     private String                          _base_font_family_name                                 = "";
69     private int                             _base_font_size                                        = -1;
70     private int                             _min_base_font_size                                    = 2;
71     private int                             _max_base_font_size                                    = 20;
72     private int                             _graphics_export_x                                     = -1;
73     private int                             _graphics_export_y                                     = -1;
74     private short                           _ov_max_width                                          = 80;
75     private short                           _ov_max_height                                         = 80;
76     private OVERVIEW_PLACEMENT_TYPE         _ov_placement                                          = OVERVIEW_PLACEMENT_TYPE.UPPER_LEFT;
77     private double                          _min_confidence_value                                  = Options.MIN_CONFIDENCE_DEFAULT;
78     private float                           _print_line_width                                      = Constants.PDF_LINE_WIDTH_DEFAULT;
79     private boolean                         _show_scale                                            = false;
80     private boolean                         _show_branch_length_values                             = false;
81     private boolean                         _show_overview                                         = true;
82     private short                           _number_of_digits_after_comma_for_confidence_values    = Constants.NUMBER_OF_DIGITS_AFTER_COMMA_FOR_CONFIDENCE_VALUES_DEFAULT;
83     private short                           _number_of_digits_after_comma_for_branch_length_values = Constants.NUMBER_OF_DIGITS_AFTER_COMMA_FOR_BRANCH_LENGTH_VALUES_DEFAULT;
84     private boolean                         _editable                                              = true;
85     private boolean                         _nh_parsing_replace_underscores                        = false;
86     private TAXONOMY_EXTRACTION             _taxonomy_extraction                                   = TAXONOMY_EXTRACTION.NO;
87     private boolean                         _internal_number_are_confidence_for_nh_parsing         = false;
88     private boolean                         _display_sequence_relations                            = false;
89     private boolean                         _validate_against_phyloxml_xsd_schema                  = Constants.VALIDATE_AGAINST_PHYLOXML_XSD_SCJEMA_DEFAULT;
90     private boolean                         _background_color_gradient                             = false;
91     private boolean                         _show_domain_labels                                    = true;
92     private boolean                         _show_annotation_ref_source                            = true;
93     private boolean                         _abbreviate_scientific_names                           = false;
94     private boolean                         _color_labels_same_as_parent_branch                    = false;
95     private boolean                         _show_default_node_shapes_internal                     = false;
96     private boolean                         _show_default_node_shapes_external                     = false;
97     private NodeShape                       _default_node_shape                                    = NodeShape.RECTANGLE;
98     private NodeFill                        _default_node_fill                                     = NodeFill.SOLID;
99     private short                           _default_node_shape_size                               = Constants.DEFAULT_NODE_SHAPE_SIZE_DEFAULT;
100     private boolean                         _taxonomy_colorize_node_shapes                         = false;
101     private int                             _default_bootstrap_samples                             = -1;
102     private File                            _path_to_local_mafft                                   = null;
103     private File                            _path_to_local_fastme                                  = null;
104     private File                            _path_to_local_raxml                                   = null;
105     final static int                        display_as_phylogram                                   = 0;
106     final static int                        show_node_names                                        = 1;
107     final static int                        show_tax_code                                          = 2;
108     final static int                        show_annotation                                        = 3;
109     final static int                        write_confidence_values                                = 4;
110     final static int                        write_events                                           = 5;
111     final static int                        color_according_to_species                             = 6;
112     final static int                        color_branches                                         = 7;
113     final static int                        width_branches                                         = 8;
114     final static int                        show_custom_node_shapes                                = 9;
115     final static int                        show_domain_architectures                              = 10;
116     final static int                        show_binary_characters                                 = 11;
117     final static int                        show_binary_character_counts                           = 12;
118     final static int                        show_seq_names                                         = 13;
119     final static int                        show_sequence_acc                                      = 14;
120     final static int                        display_internal_data                                  = 15;
121     final static int                        dynamically_hide_data                                  = 16;
122     final static int                        show_taxonomy_scientific_names                         = 17;
123     final static int                        show_taxonomy_common_names                             = 18;
124     final static int                        color_according_to_annotation                          = 19;
125     final static int                        show_seq_symbols                                       = 20;
126     final static int                        node_data_popup                                        = 21;
127     final static int                        show_relation_confidence                               = 22;
128     final static int                        show_vector_data                                       = 23;
129     final static int                        show_taxonomy_images                                   = 24;
130     final static int                        show_properties                                        = 25;
131     final static int                        show_gene_names                                        = 26;
132     // ------------------
133     // Click-to options
134     // ------------------
135     final static int                        display_node_data                                      = 0;
136     final static int                        collapse_uncollapse                                    = 1;
137     final static int                        reroot                                                 = 2;
138     final static int                        subtree                                                = 3;
139     final static int                        swap                                                   = 4;
140     final static int                        color_subtree                                          = 5;
141     final static int                        open_seq_web                                           = 6;
142     final static int                        open_pdb_web                                           = 7;
143     final static int                        open_tax_web                                           = 8;
144     final static int                        blast                                                  = 9;
145     final static int                        cut_subtree                                            = 10;
146     final static int                        copy_subtree                                           = 11;
147     final static int                        paste_subtree                                          = 12;
148     final static int                        delete_subtree_or_node                                 = 13;
149     final static int                        add_new_node                                           = 14;
150     final static int                        edit_node_data                                         = 15;
151     final static int                        sort_descendents                                       = 16;
152     final static int                        get_ext_desc_data                                      = 17;
153     final static int                        select_nodes                                           = 18;
154     // ---------------------------
155     // Display options for trees
156     // ---------------------------
157     // ---------------------------------
158     // Pertaining to the config itself
159     // ---------------------------------
160     // Full path to config (may be URL)
161     String                                  config_filename;
162     String                                  default_config_filename                                = Constants.DEFAULT_CONFIGURATION_FILE_NAME;
163     final static String                     display_options[][]                                    = {
164             { "Phylogram", "display", "?" }, { "Node Name", "display", "yes" }, { "Taxonomy Code", "display", "yes" },
165             { "Seq Annotations", "nodisplay", "no" }, { "Confidence Values", "display", "?" },
166             { "Node Events", "display", "?" }, { "Colorize by Taxonomy", "display", "yes" },
167             { "Use Branch Colors", "display", "no" }, { "Use Branch Widths", "display", "no" },
168             { "Show Custom Nodes", "display", "yes" }, { "Protein Domains", "nodisplay", "no" },
169             { "Binary Characters", "nodisplay", "no" }, { "Binary Char Counts", "nodisplay", "no" },
170             { "Seq Name", "display", "yes" }, { "Seq Accession", "display", "no" },
171             { "Show Internal Data", "display", "yes" }, { "Dyna Hide", "display", "yes" },
172             { "Taxonomy Scientific", "display", "yes" }, { "Taxonomy Common", "display", "no" },
173             { "Colorize by Annotation", "nodisplay", "no" }, { "Seq Symbol", "display", "yes" },
174             { "Rollover", "display", "yes" }, { "Relation Confidence", "nodisplay", "no" },
175             { "Vector Data", "nodisplay", "no" }, { "Taxonomy Images", "display", "no" },
176             { "Properties", "nodisplay", "no" }, { "Gene Name", "display", "yes" }                };
177     final static String                     clickto_options[][]                                    = {
178             { "Display Node Data", "display" }, { "Collapse/Uncollapse", "display" }, { "Root/Reroot", "display" },
179             { "Sub/Super Tree", "display" }, { "Swap Descendants", "display" },
180             { "Colorize Subtree/Node(s)", "display" }, { "Open Sequence DB", "display" }, { "Open PDB", "display" },
181             { "Open Taxonomy DB", "display" }, { "Blast", "display" }, { "Cut Subtree", "display" },
182             { "Copy Subtree", "display" }, { "Paste Subtree", "display" }, { "Delete Subtree/Node", "display" },
183             { "Add New Node", "display" }, { "Edit Node Data", "display" }, { "Sort Descendants", "display" },
184             { "Return", "display" }, { "Select Node(s)", "display" }                              };
185     // This option is selected in the dropdown
186     int                                     default_clickto                                        = Configuration.display_node_data;
187     // --------------
188     // Color set
189     // --------------
190     TreeColorSet                            tree_color_set;
191     // -------
192     // Fonts
193     // -------
194     TreeFontSet                             tree_font_set;
195     // ----------------
196     // Species colors
197     // ----------------
198     private static Hashtable<String, Color> _species_colors;
199     // ----------------
200     // Domain colors
201     // ----------------
202     private static Hashtable<String, Color> _domain_colors;
203     // ----------------
204     // Function colors
205     // ----------------
206     private static Hashtable<String, Color> _annotation_colors;
207     boolean                                 verbose                                                = Constants.VERBOSE_DEFAULT;
208     private NODE_LABEL_DIRECTION            _node_label_direction                                  = NODE_LABEL_DIRECTION.HORIZONTAL;
209     private Color                           _gui_background_color                                  = Constants.GUI_BACKGROUND_DEFAULT;
210     private Color                           _gui_checkbox_text_color                               = Constants.CHECKBOX_TEXT_COLOR_DEFAULT;
211     private Color                           _gui_checkbox_and_button_active_color                  = Constants.CHECKBOX_AND_BUTTON_ACTIVE_COLOR_DEFAULT;
212     private Color                           _gui_button_text_color                                 = Constants.BUTTON_TEXT_COLOR_DEFAULT;
213     private Color                           _gui_button_background_color                           = Constants.BUTTON_BACKGROUND_COLOR_DEFAULT;
214     private Color                           _gui_menu_background_color                             = Constants.MENU_BACKGROUND_COLOR_DEFAULT;
215     private Color                           _gui_menu_text_color                                   = Constants.MENU_TEXT_COLOR_DEFAULT;
216     private Color                           _gui_button_border_color                               = Constants.BUTTON_BORDER_COLOR_DEFAULT;
217     private Color                           _domain_structure_font_color                           = Constants.DOMAIN_STRUCTURE_FONT_COLOR_DEFAULT;
218     private Color                           _domain_structure_base_color                           = Constants.DOMAIN_STRUCTURE_BASE_COLOR_DEFAULT;
219     private NODE_DATA                       _ext_desc_data_to_return                               = NODE_DATA.UNKNOWN;
220     private String                          _label_for_get_ext_descendents_data                    = "";
221     private EXT_NODE_DATA_RETURN_ON         _ext_node_data_return_on                               = EXT_NODE_DATA_RETURN_ON.WINODW;
222     private int                             _frame_x_size;
223     private int                             _frame_y_size;
224     private boolean                         _midpoint_root                                         = false;
225     private static String                   DEFAULT_FONT_FAMILY                                    = "";
226     static {
227         for( final String font_name : Constants.DEFAULT_FONT_CHOICES ) {
228             if ( Arrays.binarySearch( AptxUtil.getAvailableFontFamiliesSorted(), font_name ) >= 0 ) {
229                 DEFAULT_FONT_FAMILY = font_name;
230                 break;
231             }
232         }
233         if ( ForesterUtil.isEmpty( DEFAULT_FONT_FAMILY ) ) {
234             DEFAULT_FONT_FAMILY = Constants.DEFAULT_FONT_CHOICES[ Constants.DEFAULT_FONT_CHOICES.length - 1 ];
235         }
236     }
237
238     public Configuration() {
239         this( null, false, false, false );
240     }
241
242     public Configuration( final String cf, final boolean is_url, final boolean is_applet, final boolean verbose ) {
243         if ( ForesterUtil.isEmpty( cf ) ) {
244             config_filename = default_config_filename;
245         }
246         else {
247             config_filename = cf;
248         }
249         setDisplayColors( new TreeMap<String, Color>() );
250         config_filename = config_filename.trim();
251         URL u = null;
252         if ( is_url ) {
253             // If URL, open accordingly
254             try {
255                 u = new URL( config_filename );
256                 try {
257                     final InputStreamReader isr = new InputStreamReader( u.openStream() );
258                     final BufferedReader bf = new BufferedReader( isr );
259                     readConfig( bf );
260                     bf.close();
261                     ForesterUtil.programMessage( Constants.PRG_NAME, "successfully read from configuration url ["
262                             + config_filename + "]" );
263                 }
264                 catch ( final Exception e ) {
265                     ForesterUtil.printWarningMessage( Constants.PRG_NAME, "failed to read configuration from ["
266                             + config_filename + "]: " + e.getLocalizedMessage() );
267                 }
268             }
269             catch ( final Exception e ) {
270                 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "cannot find or open configuration url ["
271                         + config_filename + "]" );
272             }
273         }
274         else {
275             // Otherwise, open as a file
276             File f = new File( config_filename );
277             if ( !f.exists() ) {
278                 f = new File( config_filename + ".txt" );
279             }
280             if ( f.exists() && f.canRead() ) {
281                 try {
282                     final BufferedReader bf = new BufferedReader( new FileReader( f ) );
283                     readConfig( bf );
284                     bf.close();
285                 }
286                 catch ( final Exception e ) {
287                     if ( verbose ) {
288                         ForesterUtil.printWarningMessage( Constants.PRG_NAME, "failed to read configuration from ["
289                                 + config_filename + "]: " + e );
290                     }
291                 }
292             }
293             else {
294                 if ( verbose ) {
295                     ForesterUtil.printWarningMessage( Constants.PRG_NAME, "cannot find or open configuration file ["
296                             + config_filename + "]" );
297                 }
298             }
299         }
300     }
301
302     public String getBaseFontFamilyName() {
303         return _base_font_family_name;
304     }
305
306     public int getDefaultBootstrapSamples() {
307         return _default_bootstrap_samples;
308     }
309
310     public NodeFill getDefaultNodeFill() {
311         return _default_node_fill;
312     }
313
314     public NodeShape getDefaultNodeShape() {
315         return _default_node_shape;
316     }
317
318     public short getDefaultNodeShapeSize() {
319         return _default_node_shape_size;
320     }
321
322     public Color getDomainStructureBaseColor() {
323         return _domain_structure_base_color;
324     }
325
326     public Color getDomainStructureFontColor() {
327         return _domain_structure_font_color;
328     }
329
330     public NODE_DATA getExtDescNodeDataToReturn() {
331         return _ext_desc_data_to_return;
332     }
333
334     public EXT_NODE_DATA_RETURN_ON getExtNodeDataReturnOn() {
335         return _ext_node_data_return_on;
336     }
337
338     public int getFrameXSize() {
339         return _frame_x_size;
340     }
341
342     public int getFrameYSize() {
343         return _frame_y_size;
344     }
345
346     public String getLabelForGetExtDescendentsData() {
347         return _label_for_get_ext_descendents_data;
348     }
349
350     public File getPathToLocalFastme() {
351         return _path_to_local_fastme;
352     }
353
354     public File getpathToLocalMafft() {
355         return _path_to_local_mafft;
356     }
357
358     public File getPathToLocalRaxml() {
359         return _path_to_local_raxml;
360     }
361
362     public boolean isAbbreviateScientificTaxonNames() {
363         return _abbreviate_scientific_names;
364     }
365
366     public boolean isBackgroundColorGradient() {
367         return _background_color_gradient;
368     }
369
370     public boolean isColorLabelsSameAsParentBranch() {
371         return _color_labels_same_as_parent_branch;
372     }
373
374     public boolean isShowDefaultNodeShapesExternal() {
375         return _show_default_node_shapes_external;
376     }
377
378     public boolean isShowDefaultNodeShapesInternal() {
379         return _show_default_node_shapes_internal;
380     }
381
382     public boolean isShowDomainLabels() {
383         return _show_domain_labels;
384     }
385
386     public boolean isTaxonomyColorizeNodeShapes() {
387         return _taxonomy_colorize_node_shapes;
388     }
389
390     public void putDisplayColors( final String key, final Color color ) {
391         getDisplayColors().put( key, color );
392     }
393
394     public void setAbbreviateScientificTaxonNames( final boolean abbreviate_scientific_names ) {
395         _abbreviate_scientific_names = abbreviate_scientific_names;
396     }
397
398     public void setBackgroundColorGradient( final boolean background_color_gradient ) {
399         _background_color_gradient = background_color_gradient;
400     }
401
402     public void setBaseFontFamilyName( final String base_font_family_name ) {
403         _base_font_family_name = base_font_family_name;
404     }
405
406     public void setBaseFontSize( final int base_font_size ) {
407         _base_font_size = base_font_size;
408     }
409
410     private void setMaxBaseFontSize( final int max_base_font_size ) {
411         _max_base_font_size = max_base_font_size;
412     }
413
414     private void setMinBaseFontSize( final int min_base_font_size ) {
415         _min_base_font_size = min_base_font_size;
416     }
417
418     public void setColorizeBranches( final boolean b ) {
419         display_options[ color_branches ][ 2 ] = b ? "yes" : "no";
420     }
421
422     public void setColorLabelsSameAsParentBranch( final boolean color_labels_same_as_parent_branch ) {
423         _color_labels_same_as_parent_branch = color_labels_same_as_parent_branch;
424     }
425
426     public void setDefaultNodeFill( final NodeFill default_node_fill ) {
427         _default_node_fill = default_node_fill;
428     }
429
430     public void setDefaultNodeShape( final NodeShape default_node_shape ) {
431         _default_node_shape = default_node_shape;
432     }
433
434     public void setDefaultNodeShapeSize( final short default_node_shape_size ) {
435         _default_node_shape_size = default_node_shape_size;
436     }
437
438     public void setDisplayAsPhylogram( final boolean b ) {
439         display_options[ display_as_phylogram ][ 2 ] = b ? "yes" : "no";
440     }
441
442     public void setDisplayColors( final SortedMap<String, Color> display_colors ) {
443         _display_colors = display_colors;
444     }
445
446     public void setDisplayConfidenceValues( final boolean b ) {
447         display_options[ write_confidence_values ][ 2 ] = b ? "yes" : "no";
448     }
449
450     public void setDisplayInternalData( final boolean b ) {
451         display_options[ display_internal_data ][ 2 ] = b ? "yes" : "no";
452     }
453
454     public void setDisplayNodeNames( final boolean b ) {
455         display_options[ show_node_names ][ 2 ] = b ? "yes" : "no";
456     }
457
458     public void setDisplaySequenceAcc( final boolean b ) {
459         display_options[ show_sequence_acc ][ 2 ] = b ? "yes" : "no";
460     }
461
462     public void setDisplaySequenceNames( final boolean b ) {
463         display_options[ show_seq_names ][ 2 ] = b ? "yes" : "no";
464     }
465
466     public void setDisplaySequenceRelations( final boolean display_sequence_relations ) {
467         _display_sequence_relations = display_sequence_relations;
468     }
469
470     public void setDisplaySequenceSymbols( final boolean b ) {
471         display_options[ show_seq_symbols ][ 2 ] = b ? "yes" : "no";
472     }
473
474     public void setDisplayTaxonomyCode( final boolean b ) {
475         display_options[ show_tax_code ][ 2 ] = b ? "yes" : "no";
476     }
477
478     public void setDisplayTaxonomyCommonNames( final boolean b ) {
479         display_options[ show_taxonomy_common_names ][ 2 ] = b ? "yes" : "no";
480     }
481
482     public void setDisplayTaxonomyImages( final boolean b ) {
483         display_options[ show_taxonomy_images ][ 2 ] = b ? "yes" : "no";
484     }
485
486     public void setDisplayTaxonomyScientificNames( final boolean b ) {
487         display_options[ show_taxonomy_scientific_names ][ 2 ] = b ? "yes" : "no";
488     }
489
490     public void setDynamicallyHideData( final boolean b ) {
491         display_options[ dynamically_hide_data ][ 2 ] = b ? "yes" : "no";
492     }
493
494     public void setExtDescNodeDataToReturn( final NODE_DATA ext_desc_data_to_return ) {
495         _ext_desc_data_to_return = ext_desc_data_to_return;
496     }
497
498     public void setFrameXSize( final int frame_x_size ) {
499         _frame_x_size = frame_x_size;
500     }
501
502     public void setFrameYSize( final int frame_y_size ) {
503         _frame_y_size = frame_y_size;
504     }
505
506     public void setMinConfidenceValue( final double min_confidence_value ) {
507         _min_confidence_value = min_confidence_value;
508     }
509
510     public void setNodeLabelDirection( final NODE_LABEL_DIRECTION node_label_direction ) {
511         _node_label_direction = node_label_direction;
512     }
513
514     public void setNumberOfDigitsAfterCommaForBranchLengthValue( final short number_of_digits_after_comma_for_branch_length_values ) {
515         _number_of_digits_after_comma_for_branch_length_values = number_of_digits_after_comma_for_branch_length_values;
516     }
517
518     public void setNumberOfDigitsAfterCommaForConfidenceValues( final short number_of_digits_after_comma_for_confidence_values ) {
519         _number_of_digits_after_comma_for_confidence_values = number_of_digits_after_comma_for_confidence_values;
520     }
521
522     public void setPhylogenyGraphicsType( final PHYLOGENY_GRAPHICS_TYPE phylogeny_graphics_type ) {
523         _phylogeny_graphics_type = phylogeny_graphics_type;
524     }
525
526     public void setPrintLineWidth( final float print_line_width ) {
527         _print_line_width = print_line_width;
528     }
529
530     public void setReplaceUnderscoresInNhParsing( final boolean nh_parsing_replace_underscores ) {
531         _nh_parsing_replace_underscores = nh_parsing_replace_underscores;
532     }
533
534     public void setShowBranchLengthValues( final boolean show_branch_length_values ) {
535         _show_branch_length_values = show_branch_length_values;
536     }
537
538     public void setShowDefaultNodeShapesExternal( final boolean show_default_node_shapes_external ) {
539         _show_default_node_shapes_external = show_default_node_shapes_external;
540     }
541
542     public void setShowDefaultNodeShapesInternal( final boolean show_default_node_shapes_internal ) {
543         _show_default_node_shapes_internal = show_default_node_shapes_internal;
544     }
545
546     public void setShowDomainLabels( final boolean show_domain_labels ) {
547         _show_domain_labels = show_domain_labels;
548     }
549
550     public void setShowScale( final boolean show_scale ) {
551         _show_scale = show_scale;
552     }
553
554     public void setTaxonomyColorize( final boolean b ) {
555         display_options[ color_according_to_species ][ 2 ] = b ? "yes" : "no";
556     }
557
558     public void setTaxonomyColorizeNodeShapes( final boolean taxonomy_colorize_node_shapes ) {
559         _taxonomy_colorize_node_shapes = taxonomy_colorize_node_shapes;
560     }
561
562     public void setUseBranchesWidths( final boolean b ) {
563         display_options[ width_branches ][ 2 ] = b ? "yes" : "no";
564     }
565
566     boolean displaySequenceRelations() {
567         return _display_sequence_relations;
568     }
569
570     boolean doCheckOption( final int which ) {
571         return ( display_options[ which ][ 2 ].equalsIgnoreCase( "yes" ) )
572                 || ( display_options[ which ][ 2 ].equalsIgnoreCase( "true" ) );
573     }
574
575     boolean doDisplayClickToOption( final int which ) {
576         return clickto_options[ which ][ 1 ].equalsIgnoreCase( "display" );
577     }
578
579     boolean doDisplayOption( final int which ) {
580         return display_options[ which ][ 1 ].equalsIgnoreCase( "display" );
581     }
582
583     /**
584      * Will attempt to use the phylogeny to determine whether to check
585      * this or not (e.g. phylogram)
586      * 
587      */
588     boolean doGuessCheckOption( final int which ) {
589         return display_options[ which ][ 2 ].equals( "?" );
590     }
591
592     Map<String, Color> getAnnotationColors() {
593         if ( _annotation_colors == null ) {
594             _annotation_colors = new Hashtable<String, Color>();
595         }
596         return _annotation_colors;
597     }
598
599     int getBaseFontSize() {
600         return _base_font_size;
601     }
602
603     int getMinBaseFontSize() {
604         return _min_base_font_size;
605     }
606
607     int getMaxBaseFontSize() {
608         return _max_base_font_size;
609     }
610
611     CLADOGRAM_TYPE getCladogramType() {
612         return _cladogram_type;
613     }
614
615     int getClickToOptionsCount() {
616         return clickto_options.length;
617     }
618
619     String getClickToTitle( final int which ) {
620         return clickto_options[ which ][ 0 ];
621     }
622
623     int getDefaultDisplayClicktoOption() {
624         return default_clickto;
625     }
626
627     SortedMap<String, Color> getDisplayColors() {
628         return _display_colors;
629     }
630
631     String getDisplayTitle( final int which ) {
632         return display_options[ which ][ 0 ];
633     }
634
635     Map<String, Color> getDomainColors() {
636         if ( _domain_colors == null ) {
637             _domain_colors = new Hashtable<String, Color>();
638         }
639         return _domain_colors;
640     }
641
642     int getGraphicsExportX() {
643         return _graphics_export_x;
644     }
645
646     int getGraphicsExportY() {
647         return _graphics_export_y;
648     }
649
650     Color getGuiBackgroundColor() {
651         return _gui_background_color;
652     }
653
654     Color getGuiButtonBackgroundColor() {
655         return _gui_button_background_color;
656     }
657
658     Color getGuiButtonBorderColor() {
659         return _gui_button_border_color;
660     }
661
662     Color getGuiButtonTextColor() {
663         return _gui_button_text_color;
664     }
665
666     Color getGuiCheckboxAndButtonActiveColor() {
667         return _gui_checkbox_and_button_active_color;
668     }
669
670     Color getGuiCheckboxTextColor() {
671         return _gui_checkbox_text_color;
672     }
673
674     Color getGuiMenuBackgroundColor() {
675         return _gui_menu_background_color;
676     }
677
678     Color getGuiMenuTextColor() {
679         return _gui_menu_text_color;
680     }
681
682     double getMinConfidenceValue() {
683         return _min_confidence_value;
684     }
685
686     NODE_LABEL_DIRECTION getNodeLabelDirection() {
687         return _node_label_direction;
688     }
689
690     short getNumberOfDigitsAfterCommaForBranchLengthValues() {
691         return _number_of_digits_after_comma_for_branch_length_values;
692     }
693
694     short getNumberOfDigitsAfterCommaForConfidenceValues() {
695         return _number_of_digits_after_comma_for_confidence_values;
696     }
697
698     short getOvMaxHeight() {
699         return _ov_max_height;
700     }
701
702     short getOvMaxWidth() {
703         return _ov_max_width;
704     }
705
706     OVERVIEW_PLACEMENT_TYPE getOvPlacement() {
707         return _ov_placement;
708     }
709
710     PHYLOGENY_GRAPHICS_TYPE getPhylogenyGraphicsType() {
711         return _phylogeny_graphics_type;
712     }
713
714     float getPrintLineWidth() {
715         return _print_line_width;
716     }
717
718     Hashtable<String, Color> getSpeciesColors() {
719         if ( _species_colors == null ) {
720             _species_colors = new Hashtable<String, Color>();
721         }
722         return _species_colors;
723     }
724
725     final TAXONOMY_EXTRACTION getTaxonomyExtraction() {
726         return _taxonomy_extraction;
727     }
728
729     boolean isAntialiasScreen() {
730         if ( ForesterUtil.isMac() ) {
731             //Apple Macintosh graphics are slow, turn off anti-alias.
732             return false;
733         }
734         return _antialias_screen;
735     }
736
737     /**
738      * Convenience method.
739      * 
740      * @return true if value in configuration file was 'yes'
741      */
742     boolean isDrawAsPhylogram() {
743         return doCheckOption( display_as_phylogram );
744     }
745
746     boolean isEditable() {
747         return _editable;
748     }
749
750     /**
751      * Only used by ArchaeoptryxE.
752      *
753      */
754     boolean isHideControlPanelAndMenubar() {
755         return _hide_controls_and_menus;
756     }
757
758     boolean isInternalNumberAreConfidenceForNhParsing() {
759         return _internal_number_are_confidence_for_nh_parsing;
760     }
761
762     boolean isReplaceUnderscoresInNhParsing() {
763         return _nh_parsing_replace_underscores;
764     }
765
766     boolean isShowBranchLengthValues() {
767         return _show_branch_length_values;
768     }
769
770     boolean isShowOverview() {
771         return _show_overview;
772     }
773
774     boolean isShowScale() {
775         return _show_scale;
776     }
777
778     final boolean isUseNativeUI() {
779         if ( ( _ui == UI.UNKNOWN ) && ForesterUtil.isMac() ) {
780             _ui = UI.NATIVE;
781         }
782         return _ui == UI.NATIVE;
783     }
784
785     /**
786      * Only used by ArchaeoptryxE.
787      *
788      */
789     boolean isUseTabbedDisplay() {
790         return _use_tabbed_display;
791     }
792
793     boolean isValidatePhyloXmlAgainstSchema() {
794         return _validate_against_phyloxml_xsd_schema;
795     }
796
797     final void setTaxonomyExtraction( final TAXONOMY_EXTRACTION taxonomy_extraction ) {
798         _taxonomy_extraction = taxonomy_extraction;
799     }
800
801     private int getClickToIndex( final String name ) {
802         int index = -1;
803         if ( name.equals( "edit_info" ) ) {
804             index = Configuration.display_node_data;
805             ForesterUtil
806                     .printWarningMessage( Constants.PRG_NAME,
807                                           "configuration key [edit_info] is deprecated, use [display node data] instead" );
808         }
809         else if ( name.equals( "display_node_data" ) ) {
810             index = Configuration.display_node_data;
811         }
812         else if ( name.equals( "collapse_uncollapse" ) ) {
813             index = Configuration.collapse_uncollapse;
814         }
815         else if ( name.equals( "reroot" ) ) {
816             index = Configuration.reroot;
817         }
818         else if ( name.equals( "subtree" ) ) {
819             index = Configuration.subtree;
820         }
821         else if ( name.equals( "swap" ) ) {
822             index = Configuration.swap;
823         }
824         else if ( name.equals( "sort_descendants" ) ) {
825             index = Configuration.sort_descendents;
826         }
827         else if ( name.equals( "get_ext_descendents_data" ) ) {
828             index = Configuration.get_ext_desc_data;
829         }
830         else if ( name.equals( "display_sequences" ) ) {
831             ForesterUtil
832                     .printWarningMessage( Constants.PRG_NAME, "configuration key [display_sequences] is deprecated" );
833             return DEPRECATED;
834         }
835         else if ( name.equals( "open_seq_web" ) ) {
836             index = Configuration.open_seq_web;
837         }
838         else if ( name.equals( "open_pdb_web" ) ) {
839             index = Configuration.open_pdb_web;
840         }
841         else if ( name.equals( "open_tax_web" ) ) {
842             index = Configuration.open_tax_web;
843         }
844         else if ( name.equals( "blast" ) ) {
845             index = Configuration.blast;
846         }
847         else if ( name.equals( "cut_subtree" ) ) {
848             index = Configuration.cut_subtree;
849         }
850         else if ( name.equals( "copy_subtree" ) ) {
851             index = Configuration.copy_subtree;
852         }
853         else if ( name.equals( "paste_subtree" ) ) {
854             index = Configuration.paste_subtree;
855         }
856         else if ( name.equals( "delete" ) ) {
857             index = Configuration.delete_subtree_or_node;
858         }
859         else if ( name.equals( "add_new_node" ) ) {
860             index = Configuration.add_new_node;
861         }
862         else if ( name.equals( "edit_node_data" ) ) {
863             index = Configuration.edit_node_data;
864         }
865         else if ( name.equals( "select_nodes" ) ) {
866             index = Configuration.select_nodes;
867         }
868         else if ( name.equals( "display_node_popup" ) ) {
869             ForesterUtil.printWarningMessage( Constants.PRG_NAME,
870                                               "configuration key [display_node_popup] is deprecated" );
871             return DEPRECATED;
872         }
873         else if ( name.equals( "custom_option" ) ) {
874             ForesterUtil.printWarningMessage( Constants.PRG_NAME, "configuration key [custom_option] is deprecated" );
875             return DEPRECATED;
876         }
877         else if ( name.equals( "color_subtree" ) ) {
878             index = Configuration.color_subtree;
879         }
880         return index;
881     }
882
883     private boolean parseBoolean( final String str ) {
884         final String my_str = str.trim().toLowerCase();
885         if ( my_str.equals( "yes" ) || my_str.equals( "true" ) ) {
886             return true;
887         }
888         else if ( my_str.equals( "no" ) || my_str.equals( "false" ) ) {
889             return false;
890         }
891         else {
892             ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse boolean value from [" + str + "]" );
893             return false;
894         }
895     }
896
897     private double parseDouble( final String str ) {
898         double d = 0.0;
899         try {
900             d = Double.parseDouble( str.trim() );
901         }
902         catch ( final Exception e ) {
903             ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse double from [" + str + "]" );
904             d = 0.0;
905         }
906         return d;
907     }
908
909     private float parseFloat( final String str ) {
910         float f = 0.0f;
911         try {
912             f = Float.parseFloat( str.trim() );
913         }
914         catch ( final Exception e ) {
915             ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse float from [" + str + "]" );
916             f = 0.0f;
917         }
918         return f;
919     }
920
921     private int parseInt( final String str ) {
922         int i = -1;
923         try {
924             i = Integer.parseInt( str.trim() );
925         }
926         catch ( final Exception e ) {
927             ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse integer from [" + str + "]" );
928             i = -1;
929         }
930         return i;
931     }
932
933     private short parseShort( final String str ) {
934         short i = -1;
935         try {
936             i = Short.parseShort( str.trim() );
937         }
938         catch ( final Exception e ) {
939             ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse short from [" + str + "]" );
940             i = -1;
941         }
942         return i;
943     }
944
945     private void processFontFamily( final StringTokenizer st ) {
946         setBaseFontFamilyName( "" );
947         final String font_str = ( ( String ) st.nextElement() ).trim();
948         final String[] fonts = font_str.split( ",+" );
949         for( String font : fonts ) {
950             font = font.replace( '_', ' ' ).trim();
951             if ( Arrays.binarySearch( AptxUtil.getAvailableFontFamiliesSorted(), font ) >= 0 ) {
952                 setBaseFontFamilyName( font );
953                 break;
954             }
955         }
956     }
957
958     /**
959      * read each line of config file, process non-comment lines
960      * @throws IOException 
961      */
962     private void readConfig( final BufferedReader conf_in ) throws IOException {
963         String line;
964         do {
965             line = conf_in.readLine();
966             if ( line != null ) {
967                 line = line.trim();
968                 // skip comments and blank lines
969                 if ( !line.startsWith( "#" ) && ( !ForesterUtil.isEmpty( line ) ) ) {
970                     // convert runs of spaces to tabs
971                     line = line.replaceAll( "\\s+", "\t" );
972                     final StringTokenizer st = new StringTokenizer( line, "\t" );
973                     setKeyValue( st );
974                 }
975             }
976         } while ( line != null );
977     }
978
979     private void setAntialiasScreen( final boolean antialias_screen ) {
980         _antialias_screen = antialias_screen;
981     }
982
983     private void setCladogramType( final CLADOGRAM_TYPE cladogram_type ) {
984         _cladogram_type = cladogram_type;
985     }
986
987     private void setDefaultBootstrapSamples( final int default_bootstrap_samples ) {
988         _default_bootstrap_samples = default_bootstrap_samples;
989     }
990
991     private void setEditable( final boolean editable ) {
992         _editable = editable;
993     }
994
995     private void setExtNodeDataReturnOn( final EXT_NODE_DATA_RETURN_ON ext_node_data_return_on ) {
996         _ext_node_data_return_on = ext_node_data_return_on;
997     }
998
999     private void setGraphicsExportX( final int graphics_export_x ) {
1000         _graphics_export_x = graphics_export_x;
1001     }
1002
1003     private void setGraphicsExportY( final int graphics_export_y ) {
1004         _graphics_export_y = graphics_export_y;
1005     }
1006
1007     private void setInternalNumberAreConfidenceForNhParsing( final boolean internal_number_are_confidence_for_nh_parsing ) {
1008         _internal_number_are_confidence_for_nh_parsing = internal_number_are_confidence_for_nh_parsing;
1009     }
1010
1011     /**
1012      * Set a key-value(s) tuple
1013      */
1014     private void setKeyValue( final StringTokenizer st ) {
1015         final String key = ( ( String ) st.nextElement() ).replace( ':', ' ' ).trim().toLowerCase();
1016         if ( !st.hasMoreElements() ) {
1017             return;
1018         }
1019         // Handle single value settings first:
1020         if ( key.equals( "default_click_to" ) ) {
1021             final String clickto_name = ( String ) st.nextElement();
1022             default_clickto = getClickToIndex( clickto_name );
1023             if ( default_clickto == -1 ) {
1024                 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "invalid value [" + clickto_name
1025                         + "] for [default_click_to]" );
1026                 default_clickto = 0;
1027             }
1028             else if ( default_clickto == DEPRECATED ) {
1029                 // Deprecated.
1030             }
1031         }
1032         else if ( key.equals( "native_ui" ) ) {
1033             final String my_str = ( ( String ) st.nextElement() ).trim().toLowerCase();
1034             if ( my_str.equals( "yes" ) || my_str.equals( "true" ) ) {
1035                 _ui = UI.NATIVE;
1036             }
1037             else if ( my_str.equals( "no" ) || my_str.equals( "false" ) ) {
1038                 _ui = UI.CROSSPLATFORM;
1039             }
1040             else if ( my_str.equals( "?" ) ) {
1041                 _ui = UI.UNKNOWN;
1042             }
1043             else {
1044                 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse yes/no/? value from [" + my_str
1045                         + "]" );
1046                 _ui = UI.UNKNOWN;
1047             }
1048         }
1049         else if ( key.equals( VALIDATE_AGAINST_PHYLOXML_XSD_SCHEMA ) ) {
1050             setValidatePhyloXmlAgainstSchema( parseBoolean( ( String ) st.nextElement() ) );
1051         }
1052         else if ( key.equals( "antialias_screen" ) ) {
1053             setAntialiasScreen( parseBoolean( ( String ) st.nextElement() ) );
1054         }
1055         else if ( key.equals( "phylogeny_graphics_type" ) ) {
1056             final String type_str = ( ( String ) st.nextElement() ).trim();
1057             if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.CONVEX.toString() ) ) {
1058                 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.CONVEX );
1059             }
1060             else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.CURVED.toString() ) ) {
1061                 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.CURVED );
1062             }
1063             else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.EURO_STYLE.toString() ) ) {
1064                 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.EURO_STYLE );
1065             }
1066             else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.ROUNDED.toString() ) ) {
1067                 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.ROUNDED );
1068             }
1069             else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR.toString() ) ) {
1070                 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR );
1071             }
1072             else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.TRIANGULAR.toString() ) ) {
1073                 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.TRIANGULAR );
1074             }
1075             else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.UNROOTED.toString() ) ) {
1076                 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.UNROOTED );
1077             }
1078             else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.CIRCULAR.toString() ) ) {
1079                 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.CIRCULAR );
1080             }
1081             else {
1082                 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR );
1083                 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + type_str
1084                         + "] for [phylogeny_graphics_type]" );
1085             }
1086         }
1087         else if ( key.equals( "min_confidence_value" ) ) {
1088             final String mcv_str = ( ( String ) st.nextElement() ).trim();
1089             final double d = parseDouble( mcv_str );
1090             setMinConfidenceValue( d );
1091         }
1092         else if ( key.equals( "font_family" ) ) {
1093             processFontFamily( st );
1094         }
1095         else if ( key.equals( "font_size" ) ) {
1096             final String size_str = ( ( String ) st.nextElement() ).trim();
1097             final int i = parseInt( size_str );
1098             if ( i > 0 ) {
1099                 setBaseFontSize( i );
1100             }
1101         }
1102         else if ( key.equals( "font_size_min" ) ) {
1103             final String size_str = ( ( String ) st.nextElement() ).trim();
1104             final int i = parseInt( size_str );
1105             if ( i > 0 ) {
1106                 setMinBaseFontSize( i );
1107             }
1108         }
1109         else if ( key.equals( "font_size_max" ) ) {
1110             final String size_str = ( ( String ) st.nextElement() ).trim();
1111             final int i = parseInt( size_str );
1112             if ( i > 1 ) {
1113                 setMaxBaseFontSize( i );
1114             }
1115         }
1116         else if ( key.equals( "graphics_export_x" ) ) {
1117             final String str = ( ( String ) st.nextElement() ).trim();
1118             final int i = parseInt( str );
1119             if ( i > 0 ) {
1120                 setGraphicsExportX( i );
1121             }
1122         }
1123         else if ( key.equals( "graphics_export_y" ) ) {
1124             final String str = ( ( String ) st.nextElement() ).trim();
1125             final int i = parseInt( str );
1126             if ( i > 0 ) {
1127                 setGraphicsExportY( i );
1128             }
1129         }
1130         else if ( key.equals( "pdf_export_line_width" ) ) {
1131             final String str = ( ( String ) st.nextElement() ).trim();
1132             final float f = parseFloat( str );
1133             if ( f > 0 ) {
1134                 setPrintLineWidth( f );
1135             }
1136             else {
1137                 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
1138                                                   "value for [pdf_export_line_width] cannot be zero or negative" );
1139             }
1140         }
1141         else if ( key.equals( "window_initial_size_x" ) ) {
1142             final String str = ( ( String ) st.nextElement() ).trim();
1143             final int i = parseInt( str );
1144             if ( i > 0 ) {
1145                 setFrameXSize( i );
1146             }
1147         }
1148         else if ( key.equals( "window_initial_size_y" ) ) {
1149             final String str = ( ( String ) st.nextElement() ).trim();
1150             final int i = parseInt( str );
1151             if ( i > 0 ) {
1152                 setFrameYSize( i );
1153             }
1154         }
1155         else if ( key.equals( "default_number_of_bootstrap_resamples" ) ) {
1156             final String str = ( ( String ) st.nextElement() ).trim();
1157             final int i = parseInt( str );
1158             if ( i >= 0 ) {
1159                 setDefaultBootstrapSamples( i );
1160             }
1161             else {
1162                 ForesterUtil
1163                         .printWarningMessage( Constants.PRG_NAME,
1164                                               "value for [default_number_of_bootstrap_resamples] cannot be negative" );
1165             }
1166         }
1167         else if ( key.equals( "mafft_local" ) ) {
1168             final String str = ( ( String ) st.nextElement() ).trim();
1169             if ( !ForesterUtil.isEmpty( str ) ) {
1170                 setPathToLocalMafft( new File( str ) );
1171             }
1172         }
1173         else if ( key.equals( "fastme_local" ) ) {
1174             final String str = ( ( String ) st.nextElement() ).trim();
1175             if ( !ForesterUtil.isEmpty( str ) ) {
1176                 setPathToLocalFastme( new File( str ) );
1177             }
1178         }
1179         else if ( key.equals( "raxml_local" ) ) {
1180             final String str = ( ( String ) st.nextElement() ).trim();
1181             if ( !ForesterUtil.isEmpty( str ) ) {
1182                 setPathToLocalRaxml( new File( str ) );
1183             }
1184         }
1185         else if ( key.equals( "show_scale" ) ) {
1186             setShowScale( parseBoolean( ( String ) st.nextElement() ) );
1187         }
1188         else if ( key.equals( "show_overview" ) ) {
1189             setShowOverview( parseBoolean( ( String ) st.nextElement() ) );
1190         }
1191         else if ( key.equals( "show_branch_length_values" ) ) {
1192             setShowBranchLengthValues( parseBoolean( ( String ) st.nextElement() ) );
1193         }
1194         else if ( key.equals( "background_gradient" ) ) {
1195             setBackgroundColorGradient( parseBoolean( ( String ) st.nextElement() ) );
1196         }
1197         else if ( key.equals( "color_labels_same_as_branch_length_values" ) ) {
1198             setColorLabelsSameAsParentBranch( parseBoolean( ( String ) st.nextElement() ) );
1199         }
1200         else if ( key.equals( "show_domain_labels" ) ) {
1201             setShowDomainLabels( parseBoolean( ( String ) st.nextElement() ) );
1202         }
1203         else if ( key.equals( "show_seq_annotation_ref_sources" ) ) {
1204             setShowAnnotationRefSource( parseBoolean( ( String ) st.nextElement() ) );
1205         }
1206         else if ( key.equals( "abbreviate_scientific_names" ) ) {
1207             setAbbreviateScientificTaxonNames( parseBoolean( ( String ) st.nextElement() ) );
1208         }
1209         else if ( key.equals( "cladogram_type" ) ) {
1210             final String type_str = ( ( String ) st.nextElement() ).trim();
1211             if ( type_str.equalsIgnoreCase( Options.CLADOGRAM_TYPE.NON_LINED_UP.toString() ) ) {
1212                 setCladogramType( Options.CLADOGRAM_TYPE.NON_LINED_UP );
1213             }
1214             else if ( type_str.equalsIgnoreCase( Options.CLADOGRAM_TYPE.EXT_NODE_SUM_DEP.toString() ) ) {
1215                 setCladogramType( Options.CLADOGRAM_TYPE.EXT_NODE_SUM_DEP );
1216             }
1217             else if ( type_str.equalsIgnoreCase( Options.CLADOGRAM_TYPE.TOTAL_NODE_SUM_DEP.toString() ) ) {
1218                 setCladogramType( Options.CLADOGRAM_TYPE.TOTAL_NODE_SUM_DEP );
1219             }
1220             else {
1221                 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + type_str
1222                         + "] for [cladogram_type]" );
1223             }
1224         }
1225         else if ( key.equals( "non_lined_up_cladogram" ) ) {
1226             ForesterUtil
1227                     .printWarningMessage( Constants.PRG_NAME,
1228                                           "configuration key [non_lined_up_cladogram] is deprecated, use [cladogram_type] instead" );
1229         }
1230         else if ( key.equals( "hide_controls_and_menus" ) ) {
1231             _hide_controls_and_menus = parseBoolean( ( String ) st.nextElement() );
1232         }
1233         else if ( key.equals( "use_tabbed_display" ) ) {
1234             _use_tabbed_display = parseBoolean( ( String ) st.nextElement() );
1235         }
1236         else if ( key.equals( "overview_width" ) ) {
1237             final short i = parseShort( ( ( String ) st.nextElement() ) );
1238             setOvMaxWidth( i );
1239         }
1240         else if ( key.equals( "overview_height" ) ) {
1241             final short i = parseShort( ( ( String ) st.nextElement() ) );
1242             setOvMaxHeight( i );
1243         }
1244         else if ( key.equals( "overview_placement_type" ) ) {
1245             final String type_str = ( ( String ) st.nextElement() ).trim();
1246             if ( type_str.equalsIgnoreCase( OVERVIEW_PLACEMENT_TYPE.UPPER_LEFT.toTag() ) ) {
1247                 setOvPlacement( OVERVIEW_PLACEMENT_TYPE.UPPER_LEFT );
1248             }
1249             else if ( type_str.equalsIgnoreCase( OVERVIEW_PLACEMENT_TYPE.UPPER_RIGHT.toTag() ) ) {
1250                 setOvPlacement( OVERVIEW_PLACEMENT_TYPE.UPPER_RIGHT );
1251             }
1252             else if ( type_str.equalsIgnoreCase( OVERVIEW_PLACEMENT_TYPE.LOWER_LEFT.toTag() ) ) {
1253                 setOvPlacement( OVERVIEW_PLACEMENT_TYPE.LOWER_LEFT );
1254             }
1255             else if ( type_str.equalsIgnoreCase( OVERVIEW_PLACEMENT_TYPE.LOWER_RIGHT.toTag() ) ) {
1256                 setOvPlacement( OVERVIEW_PLACEMENT_TYPE.LOWER_RIGHT );
1257             }
1258             else {
1259                 setOvPlacement( OVERVIEW_PLACEMENT_TYPE.UPPER_LEFT );
1260                 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + type_str
1261                         + "] for [overview_placement_type]" );
1262             }
1263         }
1264         else if ( key.equals( "node_label_direction" ) ) {
1265             final String type_str = ( ( String ) st.nextElement() ).trim();
1266             if ( type_str.equalsIgnoreCase( NODE_LABEL_DIRECTION.HORIZONTAL.toString() ) ) {
1267                 setNodeLabelDirection( NODE_LABEL_DIRECTION.HORIZONTAL );
1268             }
1269             else if ( type_str.equalsIgnoreCase( NODE_LABEL_DIRECTION.RADIAL.toString() ) ) {
1270                 setNodeLabelDirection( NODE_LABEL_DIRECTION.RADIAL );
1271             }
1272             else {
1273                 setNodeLabelDirection( NODE_LABEL_DIRECTION.HORIZONTAL );
1274                 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + type_str
1275                         + "] for [node_label_direction]" );
1276             }
1277         }
1278         else if ( key.equals( "branch_length_value_digits" ) ) {
1279             final short i = parseShort( ( ( String ) st.nextElement() ).trim() );
1280             if ( i >= 0 ) {
1281                 setNumberOfDigitsAfterCommaForBranchLengthValue( i );
1282             }
1283             else {
1284                 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "illegal value [" + i
1285                         + "] for [branch_length_value_digits]" );
1286             }
1287         }
1288         else if ( key.equals( "confidence_value_digits" ) ) {
1289             final short i = parseShort( ( ( String ) st.nextElement() ).trim() );
1290             if ( i >= 0 ) {
1291                 setNumberOfDigitsAfterCommaForConfidenceValues( i );
1292             }
1293             else {
1294                 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "illegal value [" + i
1295                         + "] for [confidence_value_digits]" );
1296             }
1297         }
1298         else if ( key.equals( "allow_editing" ) ) {
1299             setEditable( parseBoolean( ( String ) st.nextElement() ) );
1300         }
1301         else if ( key.equals( "display_sequence_relations" ) ) {
1302             setDisplaySequenceRelations( parseBoolean( ( String ) st.nextElement() ) );
1303         }
1304         else if ( key.equals( "replace_underscores_in_nh_parsing" ) ) {
1305             final boolean r = parseBoolean( ( String ) st.nextElement() );
1306             if ( r && ( getTaxonomyExtraction() != TAXONOMY_EXTRACTION.NO ) ) {
1307                 ForesterUtil
1308                         .printWarningMessage( Constants.PRG_NAME,
1309                                               "attempt to extract taxonomies and replace underscores at the same time" );
1310             }
1311             else {
1312                 setReplaceUnderscoresInNhParsing( r );
1313             }
1314         }
1315         else if ( key.equals( "taxonomy_extraction_in_nh_parsing" ) ) {
1316             final String s = ( String ) st.nextElement();
1317             if ( s.equalsIgnoreCase( "no" ) ) {
1318                 setTaxonomyExtraction( TAXONOMY_EXTRACTION.NO );
1319             }
1320             else if ( s.equalsIgnoreCase( "pfam_relaxed" ) ) {
1321                 setTaxonomyExtraction( TAXONOMY_EXTRACTION.PFAM_STYLE_RELAXED );
1322             }
1323             else if ( s.equalsIgnoreCase( "pfam_strict" ) ) {
1324                 setTaxonomyExtraction( TAXONOMY_EXTRACTION.PFAM_STYLE_STRICT );
1325             }
1326             else if ( s.equalsIgnoreCase( "aggressive" ) ) {
1327                 setTaxonomyExtraction( TAXONOMY_EXTRACTION.AGGRESSIVE );
1328             }
1329             else {
1330                 ForesterUtil
1331                         .printWarningMessage( Constants.PRG_NAME,
1332                                               "unknown value for \"taxonomy_extraction_in_nh_parsing\": "
1333                                                       + s
1334                                                       + " (must be either: no, pfam_relaxed, pfam_strict, or aggressive)" );
1335             }
1336             if ( ( getTaxonomyExtraction() != TAXONOMY_EXTRACTION.NO ) && isReplaceUnderscoresInNhParsing() ) {
1337                 ForesterUtil
1338                         .printWarningMessage( Constants.PRG_NAME,
1339                                               "attempt to extract taxonomies and replace underscores at the same time" );
1340             }
1341         }
1342         else if ( key.equals( "internal_labels_are_confidence_values" ) ) {
1343             setInternalNumberAreConfidenceForNhParsing( parseBoolean( ( String ) st.nextElement() ) );
1344         }
1345         else if ( key.equals( "gui_background_color" ) ) {
1346             _gui_background_color = Color.decode( ( String ) st.nextElement() );
1347         }
1348         else if ( key.equals( "gui_checkbox_text_color" ) ) {
1349             _gui_checkbox_text_color = Color.decode( ( String ) st.nextElement() );
1350         }
1351         else if ( key.equals( "gui_checkbox_and_button_active_color" ) ) {
1352             _gui_checkbox_and_button_active_color = Color.decode( ( String ) st.nextElement() );
1353         }
1354         else if ( key.equals( "gui_button_text_color" ) ) {
1355             _gui_button_text_color = Color.decode( ( String ) st.nextElement() );
1356         }
1357         else if ( key.equals( "gui_button_background_color" ) ) {
1358             _gui_button_background_color = Color.decode( ( String ) st.nextElement() );
1359         }
1360         else if ( key.equals( "gui_menu_background_color" ) ) {
1361             _gui_menu_background_color = Color.decode( ( String ) st.nextElement() );
1362         }
1363         else if ( key.equals( "gui_menu_text_color" ) ) {
1364             _gui_menu_text_color = Color.decode( ( String ) st.nextElement() );
1365         }
1366         else if ( key.equals( "gui_button_border_color" ) ) {
1367             _gui_button_border_color = Color.decode( ( String ) st.nextElement() );
1368         }
1369         else if ( key.equals( "domain_structure_font_color" ) ) {
1370             _domain_structure_font_color = Color.decode( ( String ) st.nextElement() );
1371         }
1372         else if ( key.equals( "domain_structure_base_color" ) ) {
1373             _domain_structure_base_color = Color.decode( ( String ) st.nextElement() );
1374         }
1375         else if ( key.equals( "show_default_node_shapes" ) ) {
1376             ForesterUtil
1377                     .printWarningMessage( Constants.PRG_NAME,
1378                                           "configuration key [show_default_node_shapes] is deprecated, use [show_default_node_shapes_internal] and [show_default_node_shapes_external] instead" );
1379             final boolean b = parseBoolean( ( ( String ) st.nextElement() ).trim() );
1380             setShowDefaultNodeShapesInternal( b );
1381             setShowDefaultNodeShapesExternal( b );
1382         }
1383         else if ( key.equals( "show_default_node_shapes_internal" ) ) {
1384             setShowDefaultNodeShapesInternal( parseBoolean( ( ( String ) st.nextElement() ).trim() ) );
1385         }
1386         else if ( key.equals( "show_default_node_shapes_external" ) ) {
1387             setShowDefaultNodeShapesExternal( parseBoolean( ( ( String ) st.nextElement() ).trim() ) );
1388         }
1389         else if ( key.equals( "default_node_size" ) ) {
1390             final short i = parseShort( ( ( String ) st.nextElement() ).trim() );
1391             setDefaultNodeShapeSize( i );
1392         }
1393         else if ( key.equals( "default_node_fill" ) ) {
1394             final String fill_str = ( ( String ) st.nextElement() ).trim();
1395             if ( fill_str.equalsIgnoreCase( NodeVisualization.NodeFill.NONE.toString() ) ) {
1396                 setDefaultNodeFill( NodeFill.NONE );
1397             }
1398             else if ( fill_str.equalsIgnoreCase( NodeVisualization.NodeFill.GRADIENT.toString() ) ) {
1399                 setDefaultNodeFill( NodeFill.GRADIENT );
1400             }
1401             else if ( fill_str.equalsIgnoreCase( NodeVisualization.NodeFill.SOLID.toString() ) ) {
1402                 setDefaultNodeFill( NodeFill.SOLID );
1403             }
1404             else {
1405                 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + fill_str
1406                         + "] for [default_node_fill]" );
1407             }
1408         }
1409         else if ( key.equals( "default_node_shape" ) ) {
1410             final String shape_str = ( ( String ) st.nextElement() ).trim();
1411             if ( shape_str.equalsIgnoreCase( NodeVisualization.NodeShape.CIRCLE.toString() ) ) {
1412                 setDefaultNodeShape( NodeShape.CIRCLE );
1413             }
1414             else if ( shape_str.equalsIgnoreCase( NodeVisualization.NodeShape.RECTANGLE.toString() ) ) {
1415                 setDefaultNodeShape( NodeShape.RECTANGLE );
1416             }
1417             else {
1418                 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + shape_str
1419                         + "] for [default_node_shape]" );
1420             }
1421         }
1422         else if ( key.equals( "taxonomy_colorize_node_shapes" ) ) {
1423             setTaxonomyColorizeNodeShapes( parseBoolean( ( String ) st.nextElement() ) );
1424         }
1425         else if ( key.equals( "midpoint_reroot" ) ) {
1426             setMidpointReroot( parseBoolean( ( String ) st.nextElement() ) );
1427         }
1428         else if ( key.equals( "ext_descendents_data_to_return" ) ) {
1429             final String s = ( ( String ) st.nextElement() ).trim();
1430             if ( s.equalsIgnoreCase( "node_name" ) ) {
1431                 setExtDescNodeDataToReturn( NODE_DATA.NODE_NAME );
1432             }
1433             else if ( s.equalsIgnoreCase( "sequence_acc" ) ) {
1434                 setExtDescNodeDataToReturn( NODE_DATA.SEQUENCE_ACC );
1435             }
1436             else if ( s.equalsIgnoreCase( "sequence_mol_seq_fasta" ) ) {
1437                 setExtDescNodeDataToReturn( NODE_DATA.SEQUENCE_MOL_SEQ_FASTA );
1438             }
1439             else if ( s.equalsIgnoreCase( "sequence_mol_seq" ) ) {
1440                 setExtDescNodeDataToReturn( NODE_DATA.SEQUENCE_MOL_SEQ );
1441             }
1442             else if ( s.equalsIgnoreCase( "sequence_name" ) ) {
1443                 setExtDescNodeDataToReturn( NODE_DATA.SEQUENCE_NAME );
1444             }
1445             else if ( s.equalsIgnoreCase( "gene_name" ) ) {
1446                 setExtDescNodeDataToReturn( NODE_DATA.GENE_NAME );
1447             }
1448             else if ( s.equalsIgnoreCase( "sequence_symbol" ) ) {
1449                 setExtDescNodeDataToReturn( NODE_DATA.SEQUENCE_SYMBOL );
1450             }
1451             else if ( s.equalsIgnoreCase( "taxonomy_scientific_name" ) ) {
1452                 setExtDescNodeDataToReturn( NODE_DATA.TAXONOMY_SCIENTIFIC_NAME );
1453             }
1454             else if ( s.equalsIgnoreCase( "taxonomy_code" ) ) {
1455                 setExtDescNodeDataToReturn( NODE_DATA.TAXONOMY_CODE );
1456             }
1457             else if ( s.equalsIgnoreCase( "taxonomy_common_name" ) ) {
1458                 setExtDescNodeDataToReturn( NODE_DATA.TAXONOMY_COMM0N_NAME );
1459             }
1460             else if ( s.equalsIgnoreCase( "user_selected" ) ) {
1461                 setExtDescNodeDataToReturn( NODE_DATA.UNKNOWN );
1462             }
1463             else {
1464                 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + s
1465                         + "] for [ext_descendents_data_to_return]" );
1466             }
1467         }
1468         else if ( key.equals( "label_for_get_ext_descendents_data" ) ) {
1469             final String s = ( ( String ) st.nextElement() ).trim();
1470             if ( ForesterUtil.isEmpty( s ) || ( s.length() < 2 ) ) {
1471                 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "illegal value [" + s
1472                         + "] for [label_for_get_ext_descendents_data]" );
1473             }
1474             else {
1475                 setLabelForGetExtDescendentsData( s.replaceAll( "_", " " ) );
1476             }
1477         }
1478         else if ( key.equals( "ext_descendents_data_to_return_on" ) ) {
1479             final String s = ( ( String ) st.nextElement() ).trim().toLowerCase();
1480             if ( s.equals( "console" ) ) {
1481                 setExtNodeDataReturnOn( EXT_NODE_DATA_RETURN_ON.CONSOLE );
1482             }
1483             else if ( s.equals( "window" ) ) {
1484                 setExtNodeDataReturnOn( EXT_NODE_DATA_RETURN_ON.WINODW );
1485             }
1486             else if ( s.equals( "buffer_only" ) ) {
1487                 setExtNodeDataReturnOn( EXT_NODE_DATA_RETURN_ON.BUFFER_ONLY );
1488             }
1489             else {
1490                 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + s
1491                         + "] for [ext_descendents_data_to_return_on]" );
1492             }
1493         }
1494         else if ( st.countTokens() >= 2 ) { // counts the tokens that are not
1495             // yet retrieved!
1496             int key_index = -1;
1497             if ( key.equals( "phylogram" ) ) {
1498                 key_index = Configuration.display_as_phylogram;
1499             }
1500             else if ( key.equals( "rollover" ) ) {
1501                 key_index = Configuration.node_data_popup;
1502             }
1503             else if ( key.equals( "color_according_to_species" ) ) {
1504                 key_index = Configuration.color_according_to_species;
1505             }
1506             else if ( key.equals( "show_node_names" ) ) {
1507                 key_index = Configuration.show_node_names;
1508             }
1509             else if ( key.equals( "show_taxonomy_code" ) ) {
1510                 key_index = Configuration.show_tax_code;
1511             }
1512             else if ( key.equals( "write_confidence_values" ) ) {
1513                 key_index = Configuration.write_confidence_values;
1514             }
1515             else if ( key.equals( "write_events" ) ) {
1516                 key_index = Configuration.write_events;
1517             }
1518             else if ( key.equals( "color_branches" ) ) {
1519                 key_index = Configuration.color_branches;
1520             }
1521             else if ( key.equals( "width_branches" ) ) {
1522                 key_index = Configuration.width_branches;
1523             }
1524             else if ( key.equals( "show_domain_architectures" ) ) {
1525                 key_index = Configuration.show_domain_architectures;
1526             }
1527             else if ( key.equals( "show_annotations" ) ) {
1528                 key_index = Configuration.show_annotation;
1529             }
1530             else if ( key.equals( "show_binary_characters" ) ) {
1531                 key_index = Configuration.show_binary_characters;
1532             }
1533             else if ( key.equals( "show_binary_character_counts" ) ) {
1534                 key_index = Configuration.show_binary_character_counts;
1535             }
1536             else if ( key.equals( "show_seq_names" ) ) {
1537                 key_index = Configuration.show_seq_names;
1538             }
1539             else if ( key.equals( "show_gene_names" ) ) {
1540                 key_index = Configuration.show_gene_names;
1541             }
1542             else if ( key.equals( "show_seq_symbols" ) ) {
1543                 key_index = Configuration.show_seq_symbols;
1544             }
1545             else if ( key.equals( "show_seq_acc" ) ) {
1546                 key_index = Configuration.show_sequence_acc;
1547             }
1548             else if ( key.equals( "display_internal_data" ) ) {
1549                 key_index = Configuration.display_internal_data;
1550             }
1551             else if ( key.equals( "dynamically_hide_data" ) ) {
1552                 key_index = Configuration.dynamically_hide_data;
1553             }
1554             else if ( key.equals( "show_taxonomy_scientific_names" ) ) {
1555                 key_index = Configuration.show_taxonomy_scientific_names;
1556             }
1557             else if ( key.equals( "show_taxonomy_common_names" ) ) {
1558                 key_index = Configuration.show_taxonomy_common_names;
1559             }
1560             else if ( key.equals( "show_taxonomy_images" ) ) {
1561                 key_index = Configuration.show_taxonomy_images;
1562             }
1563             else if ( key.equals( "color_according_to_annotation" ) ) {
1564                 key_index = Configuration.color_according_to_annotation;
1565             }
1566             else if ( key.equals( "show_vector_data" ) ) {
1567                 key_index = Configuration.show_vector_data;
1568             }
1569             else if ( key.equals( "show_properties" ) ) {
1570                 key_index = Configuration.show_properties;
1571             }
1572             else if ( key.equals( "show_relation_confidence" ) ) {
1573                 key_index = Configuration.show_relation_confidence;
1574             }
1575             else if ( key.equals( "show_custom_node_shapes" ) ) {
1576                 key_index = Configuration.show_custom_node_shapes;
1577             }
1578             // If we've found the key, set the values
1579             if ( key_index >= 0 ) {
1580                 display_options[ key_index ][ 1 ] = ( String ) st.nextElement();
1581                 display_options[ key_index ][ 2 ] = ( String ) st.nextElement();
1582                 // otherwise, keep looking
1583             }
1584             else {
1585                 if ( key_index == DEPRECATED ) {
1586                     // Deprecated.
1587                 }
1588                 else if ( key.equals( "click_to" ) ) {
1589                     final String click_to_name = ( String ) st.nextElement();
1590                     key_index = getClickToIndex( click_to_name );
1591                     if ( key_index >= 0 ) {
1592                         clickto_options[ key_index ][ 1 ] = ( String ) st.nextElement();
1593                     }
1594                     else if ( key_index == DEPRECATED ) {
1595                         // Deprecated.
1596                     }
1597                     else {
1598                         ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown click-to option: "
1599                                 + click_to_name );
1600                     }
1601                 }
1602                 else if ( key.equals( "species_color" ) ) {
1603                     getSpeciesColors().put( ( ( String ) st.nextElement() ).replace( '_', ' ' ),
1604                                             Color.decode( ( String ) st.nextElement() ) );
1605                 }
1606                 else if ( key.equals( "domain_color" ) ) {
1607                     getDomainColors().put( ( String ) st.nextElement(), Color.decode( ( String ) st.nextElement() ) );
1608                 }
1609                 else if ( key.equals( "annotation_color" ) ) {
1610                     getAnnotationColors()
1611                             .put( ( String ) st.nextElement(), Color.decode( ( String ) st.nextElement() ) );
1612                 }
1613                 else if ( key.equals( "function_color" ) ) {
1614                     ForesterUtil.printWarningMessage( Constants.PRG_NAME,
1615                                                       "configuration key [function_color] is deprecated" );
1616                 }
1617                 else if ( key.equals( DISPLAY_COLOR_KEY ) ) {
1618                     putDisplayColors( ( String ) st.nextElement(), Color.decode( ( String ) st.nextElement() ) );
1619                 }
1620                 else {
1621                     ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown configuration key [" + key
1622                             + "] in: " + config_filename );
1623                 }
1624             }
1625         }
1626         else {
1627             ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown configuration key [" + key + "] in: "
1628                     + config_filename );
1629         }
1630     }
1631
1632     private void setShowAnnotationRefSource( final boolean b ) {
1633         _show_annotation_ref_source = b;
1634     }
1635
1636     private void setLabelForGetExtDescendentsData( final String label_for_get_ext_descendents_data ) {
1637         _label_for_get_ext_descendents_data = label_for_get_ext_descendents_data;
1638     }
1639
1640     private void setOvMaxHeight( final short ov_max_height ) {
1641         _ov_max_height = ov_max_height;
1642     }
1643
1644     private void setOvMaxWidth( final short ov_max_width ) {
1645         _ov_max_width = ov_max_width;
1646     }
1647
1648     private void setOvPlacement( final OVERVIEW_PLACEMENT_TYPE ov_placement ) {
1649         _ov_placement = ov_placement;
1650     }
1651
1652     private void setPathToLocalFastme( final File path_to_local_fastme ) {
1653         _path_to_local_fastme = path_to_local_fastme;
1654     }
1655
1656     private void setPathToLocalMafft( final File path_to_local_mafft ) {
1657         _path_to_local_mafft = path_to_local_mafft;
1658     }
1659
1660     private void setPathToLocalRaxml( final File path_to_local_raxml ) {
1661         _path_to_local_raxml = path_to_local_raxml;
1662     }
1663
1664     private void setShowOverview( final boolean show_overview ) {
1665         _show_overview = show_overview;
1666     }
1667
1668     private void setValidatePhyloXmlAgainstSchema( final boolean validate_against_phyloxml_xsd_schema ) {
1669         _validate_against_phyloxml_xsd_schema = validate_against_phyloxml_xsd_schema;
1670     }
1671
1672     static String getDefaultFontFamilyName() {
1673         return DEFAULT_FONT_FAMILY;
1674     }
1675
1676     public enum EXT_NODE_DATA_RETURN_ON {
1677         CONSOLE, WINODW, BUFFER_ONLY;
1678     }
1679
1680     public enum UI {
1681         NATIVE, CROSSPLATFORM, NIMBUS, UNKNOWN
1682     }
1683
1684     static enum TRIPLET {
1685         TRUE, FALSE, UNKNOWN
1686     }
1687
1688     public boolean isMidpointReroot() {
1689         return _midpoint_root;
1690     }
1691
1692     public void setMidpointReroot( final boolean midpoint_root ) {
1693         _midpoint_root = midpoint_root;
1694     }
1695
1696     public boolean isShowAnnotationRefSource() {
1697         return _show_annotation_ref_source;
1698     }
1699
1700     public boolean isColorByTaxonomicGroup() {
1701         return false;
1702     }
1703 }