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