in progress
[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     private boolean _line_up_renderable_node_data;
224     private boolean _right_align_domains;
225     
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 NODE_DATA getExtDescNodeDataToReturn() {
323         return _ext_desc_data_to_return;
324     }
325
326     public EXT_NODE_DATA_RETURN_ON getExtNodeDataReturnOn() {
327         return _ext_node_data_return_on;
328     }
329
330     public int getFrameXSize() {
331         return _frame_x_size;
332     }
333
334     public int getFrameYSize() {
335         return _frame_y_size;
336     }
337
338     public String getLabelForGetExtDescendentsData() {
339         return _label_for_get_ext_descendents_data;
340     }
341
342     public File getPathToLocalFastme() {
343         return _path_to_local_fastme;
344     }
345
346     public File getPathToLocalMafft() {
347         return _path_to_local_mafft;
348     }
349
350     public File getPathToLocalRaxml() {
351         return _path_to_local_raxml;
352     }
353
354     public boolean isAbbreviateScientificTaxonNames() {
355         return _abbreviate_scientific_names;
356     }
357
358     public boolean isBackgroundColorGradient() {
359         return _background_color_gradient;
360     }
361
362     public boolean isColorByTaxonomicGroup() {
363         return false;
364     }
365
366     public boolean isColorLabelsSameAsParentBranch() {
367         return _color_labels_same_as_parent_branch;
368     }
369
370     public boolean isMidpointReroot() {
371         return _midpoint_root;
372     }
373
374     public boolean isShowAnnotationRefSource() {
375         return _show_annotation_ref_source;
376     }
377
378     public boolean isShowDefaultNodeShapesExternal() {
379         return _show_default_node_shapes_external;
380     }
381
382     public boolean isShowDefaultNodeShapesInternal() {
383         return _show_default_node_shapes_internal;
384     }
385
386     public boolean isShowDomainLabels() {
387         return _show_domain_labels;
388     }
389
390     public void putDisplayColors( final String key, final Color color ) {
391         getDisplayColors().put( key, color );
392     }
393
394     public void setAddTaxonomyImagesCB( final boolean b ) {
395         display_options[ show_taxonomy_images ][ 1 ] = b ? "yes" : "no";
396     }
397
398     public void setAbbreviateScientificTaxonNames( final boolean abbreviate_scientific_names ) {
399         _abbreviate_scientific_names = abbreviate_scientific_names;
400     }
401
402     public void setBackgroundColorGradient( final boolean background_color_gradient ) {
403         _background_color_gradient = background_color_gradient;
404     }
405
406     public void setBaseFontFamilyName( final String base_font_family_name ) {
407         _base_font_family_name = base_font_family_name;
408     }
409
410     public void setBaseFontSize( final int base_font_size ) {
411         _base_font_size = base_font_size;
412     }
413
414     public void setColorizeBranches( final boolean b ) {
415         display_options[ use_style ][ 2 ] = b ? "yes" : "no";
416     }
417
418     public void setColorLabelsSameAsParentBranch( final boolean color_labels_same_as_parent_branch ) {
419         _color_labels_same_as_parent_branch = color_labels_same_as_parent_branch;
420     }
421
422     public void setDefaultNodeFill( final NodeFill default_node_fill ) {
423         _default_node_fill = default_node_fill;
424     }
425
426     public void setDefaultNodeShape( final NodeShape default_node_shape ) {
427         _default_node_shape = default_node_shape;
428     }
429
430     public void setDefaultNodeShapeSize( final short default_node_shape_size ) {
431         _default_node_shape_size = default_node_shape_size;
432     }
433
434     public void setDisplayAsPhylogram( final boolean b ) {
435         display_options[ display_as_phylogram ][ 2 ] = b ? "yes" : "no";
436     }
437
438     public void setUseStyle( final boolean b ) {
439         display_options[ use_style ][ 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 setDisplayGeneNames( final boolean b ) {
467         display_options[ show_gene_names ][ 2 ] = b ? "yes" : "no";
468     }
469
470     public void setDisplaySequenceRelations( final boolean display_sequence_relations ) {
471         _display_sequence_relations = display_sequence_relations;
472     }
473
474     public void setDisplaySequenceSymbols( final boolean b ) {
475         display_options[ show_seq_symbols ][ 2 ] = b ? "yes" : "no";
476     }
477
478     public void setDisplayTaxonomyCode( final boolean b ) {
479         display_options[ show_tax_code ][ 2 ] = b ? "yes" : "no";
480     }
481
482     public void setDisplayTaxonomyCommonNames( final boolean b ) {
483         display_options[ show_taxonomy_common_names ][ 2 ] = b ? "yes" : "no";
484     }
485
486     public void setDisplayTaxonomyImages( final boolean b ) {
487         display_options[ show_taxonomy_images ][ 2 ] = b ? "yes" : "no";
488     }
489
490     public void setDisplayTaxonomyScientificNames( final boolean b ) {
491         display_options[ show_taxonomy_scientific_names ][ 2 ] = b ? "yes" : "no";
492     }
493
494     public void setDynamicallyHideData( final boolean b ) {
495         display_options[ dynamically_hide_data ][ 2 ] = b ? "yes" : "no";
496     }
497
498     public void setExtDescNodeDataToReturn( final NODE_DATA ext_desc_data_to_return ) {
499         _ext_desc_data_to_return = ext_desc_data_to_return;
500     }
501
502     public void setFrameXSize( final int frame_x_size ) {
503         _frame_x_size = frame_x_size;
504     }
505
506     public void setFrameYSize( final int frame_y_size ) {
507         _frame_y_size = frame_y_size;
508     }
509
510     public void setMidpointReroot( final boolean midpoint_root ) {
511         _midpoint_root = midpoint_root;
512     }
513
514     public void setMinConfidenceValue( final double min_confidence_value ) {
515         _min_confidence_value = min_confidence_value;
516     }
517
518     public void setNodeLabelDirection( final NODE_LABEL_DIRECTION node_label_direction ) {
519         _node_label_direction = node_label_direction;
520     }
521
522     public void setNumberOfDigitsAfterCommaForBranchLengthValue( final short number_of_digits_after_comma_for_branch_length_values ) {
523         _number_of_digits_after_comma_for_branch_length_values = number_of_digits_after_comma_for_branch_length_values;
524     }
525
526     public void setNumberOfDigitsAfterCommaForConfidenceValues( final short number_of_digits_after_comma_for_confidence_values ) {
527         _number_of_digits_after_comma_for_confidence_values = number_of_digits_after_comma_for_confidence_values;
528     }
529
530     public void setPhylogenyGraphicsType( final PHYLOGENY_GRAPHICS_TYPE phylogeny_graphics_type ) {
531         _phylogeny_graphics_type = phylogeny_graphics_type;
532     }
533
534     public void setPrintLineWidth( final float print_line_width ) {
535         _print_line_width = print_line_width;
536     }
537
538     public void setReplaceUnderscoresInNhParsing( final boolean nh_parsing_replace_underscores ) {
539         _nh_parsing_replace_underscores = nh_parsing_replace_underscores;
540     }
541
542     public void setShowBranchLengthValues( final boolean show_branch_length_values ) {
543         _show_branch_length_values = show_branch_length_values;
544     }
545
546     public void setShowDefaultNodeShapesExternal( final boolean show_default_node_shapes_external ) {
547         _show_default_node_shapes_external = show_default_node_shapes_external;
548     }
549
550     public void setShowDefaultNodeShapesInternal( final boolean show_default_node_shapes_internal ) {
551         _show_default_node_shapes_internal = show_default_node_shapes_internal;
552     }
553
554     public void setShowDomainLabels( final boolean show_domain_labels ) {
555         _show_domain_labels = show_domain_labels;
556     }
557
558     public void setShowScale( final boolean show_scale ) {
559         _show_scale = show_scale;
560     }
561
562     boolean displaySequenceRelations() {
563         return _display_sequence_relations;
564     }
565
566     boolean doCheckOption( final int which ) {
567         return ( display_options[ which ][ 2 ].equalsIgnoreCase( "yes" ) )
568                 || ( display_options[ which ][ 2 ].equalsIgnoreCase( "true" ) );
569     }
570
571     boolean doDisplayClickToOption( final int which ) {
572         return clickto_options[ which ][ 1 ].equalsIgnoreCase( "display" );
573     }
574
575     boolean doDisplayOption( final int which ) {
576         return display_options[ which ][ 1 ].equalsIgnoreCase( "display" );
577     }
578
579     /**
580      * Will attempt to use the phylogeny to determine whether to check
581      * this or not (e.g. phylogram)
582      * 
583      */
584     boolean doGuessCheckOption( final int which ) {
585         return display_options[ which ][ 2 ].equals( "?" );
586     }
587
588     Map<String, Color> getAnnotationColors() {
589         if ( _annotation_colors == null ) {
590             _annotation_colors = new Hashtable<String, Color>();
591         }
592         return _annotation_colors;
593     }
594
595     int getBaseFontSize() {
596         return _base_font_size;
597     }
598
599     CLADOGRAM_TYPE getCladogramType() {
600         return _cladogram_type;
601     }
602
603     int getClickToOptionsCount() {
604         return clickto_options.length;
605     }
606
607     String getClickToTitle( final int which ) {
608         return clickto_options[ which ][ 0 ];
609     }
610
611     int getDefaultDisplayClicktoOption() {
612         return default_clickto;
613     }
614
615     SortedMap<String, Color> getDisplayColors() {
616         return _display_colors;
617     }
618
619     String getDisplayTitle( final int which ) {
620         return display_options[ which ][ 0 ];
621     }
622
623     Map<String, Color> getDomainColors() {
624         if ( _domain_colors == null ) {
625             _domain_colors = new Hashtable<String, Color>();
626         }
627         return _domain_colors;
628     }
629
630     int getGraphicsExportX() {
631         return _graphics_export_x;
632     }
633
634     int getGraphicsExportY() {
635         return _graphics_export_y;
636     }
637
638     Color getGuiBackgroundColor() {
639         return _gui_background_color;
640     }
641
642     Color getGuiButtonBackgroundColor() {
643         return _gui_button_background_color;
644     }
645
646     Color getGuiButtonBorderColor() {
647         return _gui_button_border_color;
648     }
649
650     Color getGuiButtonTextColor() {
651         return _gui_button_text_color;
652     }
653
654     Color getGuiCheckboxAndButtonActiveColor() {
655         return _gui_checkbox_and_button_active_color;
656     }
657
658     Color getGuiCheckboxTextColor() {
659         return _gui_checkbox_text_color;
660     }
661
662     Color getGuiMenuBackgroundColor() {
663         return _gui_menu_background_color;
664     }
665
666     Color getGuiMenuTextColor() {
667         return _gui_menu_text_color;
668     }
669
670     int getMaxBaseFontSize() {
671         return _max_base_font_size;
672     }
673
674     int getMinBaseFontSize() {
675         return _min_base_font_size;
676     }
677
678     double getMinConfidenceValue() {
679         return _min_confidence_value;
680     }
681
682     NODE_LABEL_DIRECTION getNodeLabelDirection() {
683         return _node_label_direction;
684     }
685
686     short getNumberOfDigitsAfterCommaForBranchLengthValues() {
687         return _number_of_digits_after_comma_for_branch_length_values;
688     }
689
690     short getNumberOfDigitsAfterCommaForConfidenceValues() {
691         return _number_of_digits_after_comma_for_confidence_values;
692     }
693
694     short getOvMaxHeight() {
695         return _ov_max_height;
696     }
697
698     short getOvMaxWidth() {
699         return _ov_max_width;
700     }
701
702     OVERVIEW_PLACEMENT_TYPE getOvPlacement() {
703         return _ov_placement;
704     }
705
706     PHYLOGENY_GRAPHICS_TYPE getPhylogenyGraphicsType() {
707         return _phylogeny_graphics_type;
708     }
709
710     float getPrintLineWidth() {
711         return _print_line_width;
712     }
713
714     Hashtable<String, Color> getSpeciesColors() {
715         if ( _species_colors == null ) {
716             _species_colors = new Hashtable<String, Color>();
717         }
718         return _species_colors;
719     }
720
721     Hashtable<String, Color> getSequenceColors() {
722         if ( _sequence_colors == null ) {
723             _sequence_colors = new Hashtable<String, Color>();
724         }
725         return _sequence_colors;
726     }
727
728     final TAXONOMY_EXTRACTION getTaxonomyExtraction() {
729         return _taxonomy_extraction;
730     }
731
732     boolean isAntialiasScreen() {
733         if ( ForesterUtil.isMac() ) {
734             //Apple Macintosh graphics are slow, turn off anti-alias.
735             return false;
736         }
737         return _antialias_screen;
738     }
739
740     /**
741      * Convenience method.
742      * 
743      * @return true if value in configuration file was 'yes'
744      */
745     boolean isDrawAsPhylogram() {
746         return doCheckOption( display_as_phylogram );
747     }
748
749     boolean isEditable() {
750         return _editable;
751     }
752
753     /**
754      * Only used by ArchaeoptryxE.
755      *
756      */
757     boolean isHideControlPanelAndMenubar() {
758         return _hide_controls_and_menus;
759     }
760
761     boolean isInternalNumberAreConfidenceForNhParsing() {
762         return _internal_number_are_confidence_for_nh_parsing;
763     }
764
765     boolean isReplaceUnderscoresInNhParsing() {
766         return _nh_parsing_replace_underscores;
767     }
768
769     boolean isShowBranchLengthValues() {
770         return _show_branch_length_values;
771     }
772
773     boolean isShowOverview() {
774         return _show_overview;
775     }
776
777     boolean isShowScale() {
778         return _show_scale;
779     }
780
781     final boolean isUseNativeUI() {
782         if ( ( _ui == UI.UNKNOWN ) && ForesterUtil.isMac() ) {
783             _ui = UI.NATIVE;
784         }
785         return _ui == UI.NATIVE;
786     }
787
788     /**
789      * Only used by ArchaeoptryxE.
790      *
791      */
792     boolean isUseTabbedDisplay() {
793         return _use_tabbed_display;
794     }
795
796     boolean isValidatePhyloXmlAgainstSchema() {
797         return _validate_against_phyloxml_xsd_schema;
798     }
799
800     final void setTaxonomyExtraction( final TAXONOMY_EXTRACTION taxonomy_extraction ) {
801         _taxonomy_extraction = taxonomy_extraction;
802     }
803
804     private int getClickToIndex( final String name ) {
805         int index = -1;
806         if ( name.equals( "edit_info" ) ) {
807             index = Configuration.display_node_data;
808             ForesterUtil
809                     .printWarningMessage( Constants.PRG_NAME,
810                                           "configuration key [edit_info] is deprecated, use [display node data] instead" );
811         }
812         else if ( name.equals( "display_node_data" ) ) {
813             index = Configuration.display_node_data;
814         }
815         else if ( name.equals( "collapse_uncollapse" ) ) {
816             index = Configuration.collapse_uncollapse;
817         }
818         else if ( name.equals( "reroot" ) ) {
819             index = Configuration.reroot;
820         }
821         else if ( name.equals( "subtree" ) ) {
822             index = Configuration.subtree;
823         }
824         else if ( name.equals( "swap" ) ) {
825             index = Configuration.swap;
826         }
827         else if ( name.equals( "sort_descendants" ) ) {
828             index = Configuration.sort_descendents;
829         }
830         else if ( name.equals( "get_ext_descendents_data" ) ) {
831             index = Configuration.get_ext_desc_data;
832         }
833         else if ( name.equals( "display_sequences" ) ) {
834             ForesterUtil
835                     .printWarningMessage( Constants.PRG_NAME, "configuration key [display_sequences] is deprecated" );
836             return DEPRECATED;
837         }
838         else if ( name.equals( "open_seq_web" ) ) {
839             index = Configuration.open_seq_web;
840         }
841         else if ( name.equals( "open_pdb_web" ) ) {
842             index = Configuration.open_pdb_web;
843         }
844         else if ( name.equals( "open_tax_web" ) ) {
845             index = Configuration.open_tax_web;
846         }
847         else if ( name.equals( "blast" ) ) {
848             index = Configuration.blast;
849         }
850         else if ( name.equals( "cut_subtree" ) ) {
851             index = Configuration.cut_subtree;
852         }
853         else if ( name.equals( "copy_subtree" ) ) {
854             index = Configuration.copy_subtree;
855         }
856         else if ( name.equals( "paste_subtree" ) ) {
857             index = Configuration.paste_subtree;
858         }
859         else if ( name.equals( "delete" ) ) {
860             index = Configuration.delete_subtree_or_node;
861         }
862         else if ( name.equals( "add_new_node" ) ) {
863             index = Configuration.add_new_node;
864         }
865         else if ( name.equals( "edit_node_data" ) ) {
866             index = Configuration.edit_node_data;
867         }
868         else if ( name.equals( "select_nodes" ) ) {
869             index = Configuration.select_nodes;
870         }
871         else if ( name.equals( "display_node_popup" ) ) {
872             ForesterUtil.printWarningMessage( Constants.PRG_NAME,
873                                               "configuration key [display_node_popup] is deprecated" );
874             return DEPRECATED;
875         }
876         else if ( name.equals( "custom_option" ) ) {
877             ForesterUtil.printWarningMessage( Constants.PRG_NAME, "configuration key [custom_option] is deprecated" );
878             return DEPRECATED;
879         }
880         else if ( name.equals( "color_subtree" ) ) {
881             index = Configuration.color_subtree;
882         }
883         else if ( name.equals( "change_node_font" ) ) {
884             index = Configuration.change_node_font;
885         }
886         else if ( name.equals( "color_node_font" ) ) {
887             index = Configuration.color_node_font;
888         }
889         else if ( name.equals( "color_subtree" ) ) {
890             index = Configuration.color_subtree;
891         }
892         return index;
893     }
894
895     private boolean parseBoolean( final String str ) {
896         final String my_str = str.trim().toLowerCase();
897         if ( my_str.equals( "yes" ) || my_str.equals( "true" ) ) {
898             return true;
899         }
900         else if ( my_str.equals( "no" ) || my_str.equals( "false" ) ) {
901             return false;
902         }
903         else {
904             ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse boolean value from [" + str + "]" );
905             return false;
906         }
907     }
908
909     private double parseDouble( final String str ) {
910         double d = 0.0;
911         try {
912             d = Double.parseDouble( str.trim() );
913         }
914         catch ( final Exception e ) {
915             ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse double from [" + str + "]" );
916             d = 0.0;
917         }
918         return d;
919     }
920
921     private float parseFloat( final String str ) {
922         float f = 0.0f;
923         try {
924             f = Float.parseFloat( str.trim() );
925         }
926         catch ( final Exception e ) {
927             ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse float from [" + str + "]" );
928             f = 0.0f;
929         }
930         return f;
931     }
932
933     private int parseInt( final String str ) {
934         int i = -1;
935         try {
936             i = Integer.parseInt( str.trim() );
937         }
938         catch ( final Exception e ) {
939             ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse integer from [" + str + "]" );
940             i = -1;
941         }
942         return i;
943     }
944
945     private short parseShort( final String str ) {
946         short i = -1;
947         try {
948             i = Short.parseShort( str.trim() );
949         }
950         catch ( final Exception e ) {
951             ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse short from [" + str + "]" );
952             i = -1;
953         }
954         return i;
955     }
956
957     private void processFontFamily( final StringTokenizer st ) {
958         setBaseFontFamilyName( "" );
959         final String font_str = ( ( String ) st.nextElement() ).trim();
960         final String[] fonts = font_str.split( ",+" );
961         for( String font : fonts ) {
962             font = font.replace( '_', ' ' ).trim();
963             if ( Arrays.binarySearch( AptxUtil.getAvailableFontFamiliesSorted(), font ) >= 0 ) {
964                 setBaseFontFamilyName( font );
965                 break;
966             }
967         }
968     }
969
970     /**
971      * read each line of config file, process non-comment lines
972      * @throws IOException 
973      */
974     private void readConfig( final BufferedReader conf_in ) throws IOException {
975         String line;
976         do {
977             line = conf_in.readLine();
978             if ( line != null ) {
979                 line = line.trim();
980                 // skip comments and blank lines
981                 if ( !line.startsWith( "#" ) && ( !ForesterUtil.isEmpty( line ) ) ) {
982                     // convert runs of spaces to tabs
983                     line = line.replaceAll( "\\s+", "\t" );
984                     final StringTokenizer st = new StringTokenizer( line, "\t" );
985                     setKeyValue( st );
986                 }
987             }
988         } while ( line != null );
989     }
990
991     private void setAntialiasScreen( final boolean antialias_screen ) {
992         _antialias_screen = antialias_screen;
993     }
994
995     private void setCladogramType( final CLADOGRAM_TYPE cladogram_type ) {
996         _cladogram_type = cladogram_type;
997     }
998
999     private void setDefaultBootstrapSamples( final int default_bootstrap_samples ) {
1000         _default_bootstrap_samples = default_bootstrap_samples;
1001     }
1002
1003     private void setEditable( final boolean editable ) {
1004         _editable = editable;
1005     }
1006
1007     private void setExtNodeDataReturnOn( final EXT_NODE_DATA_RETURN_ON ext_node_data_return_on ) {
1008         _ext_node_data_return_on = ext_node_data_return_on;
1009     }
1010
1011     private void setGraphicsExportX( final int graphics_export_x ) {
1012         _graphics_export_x = graphics_export_x;
1013     }
1014
1015     private void setGraphicsExportY( final int graphics_export_y ) {
1016         _graphics_export_y = graphics_export_y;
1017     }
1018
1019     private void setInternalNumberAreConfidenceForNhParsing( final boolean internal_number_are_confidence_for_nh_parsing ) {
1020         _internal_number_are_confidence_for_nh_parsing = internal_number_are_confidence_for_nh_parsing;
1021     }
1022
1023     /**
1024      * Set a key-value(s) tuple
1025      */
1026     private void setKeyValue( final StringTokenizer st ) {
1027         final String key = ( ( String ) st.nextElement() ).replace( ':', ' ' ).trim().toLowerCase();
1028         if ( !st.hasMoreElements() ) {
1029             return;
1030         }
1031         // Handle single value settings first:
1032         if ( key.equals( "default_click_to" ) ) {
1033             final String clickto_name = ( String ) st.nextElement();
1034             default_clickto = getClickToIndex( clickto_name );
1035             if ( default_clickto == -1 ) {
1036                 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "invalid value [" + clickto_name
1037                         + "] for [default_click_to]" );
1038                 default_clickto = 0;
1039             }
1040             else if ( default_clickto == DEPRECATED ) {
1041                 // Deprecated.
1042             }
1043         }
1044         else if ( key.equals( "native_ui" ) ) {
1045             final String my_str = ( ( String ) st.nextElement() ).trim().toLowerCase();
1046             if ( my_str.equals( "yes" ) || my_str.equals( "true" ) ) {
1047                 _ui = UI.NATIVE;
1048             }
1049             else if ( my_str.equals( "no" ) || my_str.equals( "false" ) ) {
1050                 _ui = UI.CROSSPLATFORM;
1051             }
1052             else if ( my_str.equals( "?" ) ) {
1053                 _ui = UI.UNKNOWN;
1054             }
1055             else {
1056                 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse yes/no/? value from [" + my_str
1057                         + "]" );
1058                 _ui = UI.UNKNOWN;
1059             }
1060         }
1061         else if ( key.equals( VALIDATE_AGAINST_PHYLOXML_XSD_SCHEMA ) ) {
1062             setValidatePhyloXmlAgainstSchema( parseBoolean( ( String ) st.nextElement() ) );
1063         }
1064         else if ( key.equals( "antialias_screen" ) ) {
1065             setAntialiasScreen( parseBoolean( ( String ) st.nextElement() ) );
1066         }
1067         else if ( key.equals( "phylogeny_graphics_type" ) ) {
1068             final String type_str = ( ( String ) st.nextElement() ).trim();
1069             if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.CONVEX.toString() ) ) {
1070                 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.CONVEX );
1071             }
1072             else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.CURVED.toString() ) ) {
1073                 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.CURVED );
1074             }
1075             else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.EURO_STYLE.toString() ) ) {
1076                 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.EURO_STYLE );
1077             }
1078             else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.ROUNDED.toString() ) ) {
1079                 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.ROUNDED );
1080             }
1081             else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR.toString() ) ) {
1082                 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR );
1083             }
1084             else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.TRIANGULAR.toString() ) ) {
1085                 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.TRIANGULAR );
1086             }
1087             else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.UNROOTED.toString() ) ) {
1088                 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.UNROOTED );
1089             }
1090             else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.CIRCULAR.toString() ) ) {
1091                 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.CIRCULAR );
1092             }
1093             else {
1094                 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR );
1095                 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + type_str
1096                         + "] for [phylogeny_graphics_type]" );
1097             }
1098         }
1099         else if ( key.equals( "min_confidence_value" ) ) {
1100             final String mcv_str = ( ( String ) st.nextElement() ).trim();
1101             final double d = parseDouble( mcv_str );
1102             setMinConfidenceValue( d );
1103         }
1104         else if ( key.equals( "font_family" ) ) {
1105             processFontFamily( st );
1106         }
1107         else if ( key.equals( "font_size" ) ) {
1108             final String size_str = ( ( String ) st.nextElement() ).trim();
1109             final int i = parseInt( size_str );
1110             if ( i > 0 ) {
1111                 setBaseFontSize( i );
1112             }
1113         }
1114         else if ( key.equals( "font_size_min" ) ) {
1115             final String size_str = ( ( String ) st.nextElement() ).trim();
1116             final int i = parseInt( size_str );
1117             if ( i > 0 ) {
1118                 setMinBaseFontSize( i );
1119             }
1120         }
1121         else if ( key.equals( "font_size_max" ) ) {
1122             final String size_str = ( ( String ) st.nextElement() ).trim();
1123             final int i = parseInt( size_str );
1124             if ( i > 1 ) {
1125                 setMaxBaseFontSize( i );
1126             }
1127         }
1128         else if ( key.equals( "graphics_export_x" ) ) {
1129             final String str = ( ( String ) st.nextElement() ).trim();
1130             final int i = parseInt( str );
1131             if ( i > 0 ) {
1132                 setGraphicsExportX( i );
1133             }
1134         }
1135         else if ( key.equals( "graphics_export_y" ) ) {
1136             final String str = ( ( String ) st.nextElement() ).trim();
1137             final int i = parseInt( str );
1138             if ( i > 0 ) {
1139                 setGraphicsExportY( i );
1140             }
1141         }
1142         else if ( key.equals( "pdf_export_line_width" ) ) {
1143             final String str = ( ( String ) st.nextElement() ).trim();
1144             final float f = parseFloat( str );
1145             if ( f > 0 ) {
1146                 setPrintLineWidth( f );
1147             }
1148             else {
1149                 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
1150                                                   "value for [pdf_export_line_width] cannot be zero or negative" );
1151             }
1152         }
1153         else if ( key.equals( "window_initial_size_x" ) ) {
1154             final String str = ( ( String ) st.nextElement() ).trim();
1155             final int i = parseInt( str );
1156             if ( i > 0 ) {
1157                 setFrameXSize( i );
1158             }
1159         }
1160         else if ( key.equals( "window_initial_size_y" ) ) {
1161             final String str = ( ( String ) st.nextElement() ).trim();
1162             final int i = parseInt( str );
1163             if ( i > 0 ) {
1164                 setFrameYSize( i );
1165             }
1166         }
1167         else if ( key.equals( "default_number_of_bootstrap_resamples" ) ) {
1168             final String str = ( ( String ) st.nextElement() ).trim();
1169             final int i = parseInt( str );
1170             if ( i >= 0 ) {
1171                 setDefaultBootstrapSamples( i );
1172             }
1173             else {
1174                 ForesterUtil
1175                         .printWarningMessage( Constants.PRG_NAME,
1176                                               "value for [default_number_of_bootstrap_resamples] cannot be negative" );
1177             }
1178         }
1179         else if ( key.equals( "mafft_local" ) ) {
1180             final String str = ( ( String ) st.nextElement() ).trim();
1181             if ( !ForesterUtil.isEmpty( str ) ) {
1182                 setPathToLocalMafft( new File( str ) );
1183             }
1184         }
1185         else if ( key.equals( "fastme_local" ) ) {
1186             final String str = ( ( String ) st.nextElement() ).trim();
1187             if ( !ForesterUtil.isEmpty( str ) ) {
1188                 setPathToLocalFastme( new File( str ) );
1189             }
1190         }
1191         else if ( key.equals( "raxml_local" ) ) {
1192             final String str = ( ( String ) st.nextElement() ).trim();
1193             if ( !ForesterUtil.isEmpty( str ) ) {
1194                 setPathToLocalRaxml( new File( str ) );
1195             }
1196         }
1197         else if ( key.equals( "show_scale" ) ) {
1198             setShowScale( parseBoolean( ( String ) st.nextElement() ) );
1199         }
1200         else if ( key.equals( "show_overview" ) ) {
1201             setShowOverview( parseBoolean( ( String ) st.nextElement() ) );
1202         }
1203         else if ( key.equals( "show_branch_length_values" ) ) {
1204             setShowBranchLengthValues( parseBoolean( ( String ) st.nextElement() ) );
1205         }
1206         else if ( key.equals( "background_gradient" ) ) {
1207             setBackgroundColorGradient( parseBoolean( ( String ) st.nextElement() ) );
1208         }
1209         else if ( key.equals( "color_labels_same_as_branch_length_values" ) ) {
1210             setColorLabelsSameAsParentBranch( parseBoolean( ( String ) st.nextElement() ) );
1211         }
1212         else if ( key.equals( "show_domain_labels" ) ) {
1213             setShowDomainLabels( parseBoolean( ( String ) st.nextElement() ) );
1214         }
1215         else if ( key.equals( "show_seq_annotation_ref_sources" ) ) {
1216             setShowAnnotationRefSource( parseBoolean( ( String ) st.nextElement() ) );
1217         }
1218         else if ( key.equals( "abbreviate_scientific_names" ) ) {
1219             setAbbreviateScientificTaxonNames( parseBoolean( ( String ) st.nextElement() ) );
1220         }
1221         else if ( key.equals( "cladogram_type" ) ) {
1222             final String type_str = ( ( String ) st.nextElement() ).trim();
1223             if ( type_str.equalsIgnoreCase( Options.CLADOGRAM_TYPE.NON_LINED_UP.toString() ) ) {
1224                 setCladogramType( Options.CLADOGRAM_TYPE.NON_LINED_UP );
1225             }
1226             else if ( type_str.equalsIgnoreCase( Options.CLADOGRAM_TYPE.EXT_NODE_SUM_DEP.toString() ) ) {
1227                 setCladogramType( Options.CLADOGRAM_TYPE.EXT_NODE_SUM_DEP );
1228             }
1229             else if ( type_str.equalsIgnoreCase( Options.CLADOGRAM_TYPE.TOTAL_NODE_SUM_DEP.toString() ) ) {
1230                 setCladogramType( Options.CLADOGRAM_TYPE.TOTAL_NODE_SUM_DEP );
1231             }
1232             else {
1233                 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + type_str
1234                         + "] for [cladogram_type]" );
1235             }
1236         }
1237         else if ( key.equals( "non_lined_up_cladogram" ) ) {
1238             ForesterUtil
1239                     .printWarningMessage( Constants.PRG_NAME,
1240                                           "configuration key [non_lined_up_cladogram] is deprecated, use [cladogram_type] instead" );
1241         }
1242         else if ( key.equals( "hide_controls_and_menus" ) ) {
1243             _hide_controls_and_menus = parseBoolean( ( String ) st.nextElement() );
1244         }
1245         else if ( key.equals( "use_tabbed_display" ) ) {
1246             _use_tabbed_display = parseBoolean( ( String ) st.nextElement() );
1247         }
1248         else if ( key.equals( "overview_width" ) ) {
1249             final short i = parseShort( ( ( String ) st.nextElement() ) );
1250             setOvMaxWidth( i );
1251         }
1252         else if ( key.equals( "overview_height" ) ) {
1253             final short i = parseShort( ( ( String ) st.nextElement() ) );
1254             setOvMaxHeight( i );
1255         }
1256         else if ( key.equals( "overview_placement_type" ) ) {
1257             final String type_str = ( ( String ) st.nextElement() ).trim();
1258             if ( type_str.equalsIgnoreCase( OVERVIEW_PLACEMENT_TYPE.UPPER_LEFT.toTag() ) ) {
1259                 setOvPlacement( OVERVIEW_PLACEMENT_TYPE.UPPER_LEFT );
1260             }
1261             else if ( type_str.equalsIgnoreCase( OVERVIEW_PLACEMENT_TYPE.UPPER_RIGHT.toTag() ) ) {
1262                 setOvPlacement( OVERVIEW_PLACEMENT_TYPE.UPPER_RIGHT );
1263             }
1264             else if ( type_str.equalsIgnoreCase( OVERVIEW_PLACEMENT_TYPE.LOWER_LEFT.toTag() ) ) {
1265                 setOvPlacement( OVERVIEW_PLACEMENT_TYPE.LOWER_LEFT );
1266             }
1267             else if ( type_str.equalsIgnoreCase( OVERVIEW_PLACEMENT_TYPE.LOWER_RIGHT.toTag() ) ) {
1268                 setOvPlacement( OVERVIEW_PLACEMENT_TYPE.LOWER_RIGHT );
1269             }
1270             else {
1271                 setOvPlacement( OVERVIEW_PLACEMENT_TYPE.UPPER_LEFT );
1272                 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + type_str
1273                         + "] for [overview_placement_type]" );
1274             }
1275         }
1276         else if ( key.equals( "node_label_direction" ) ) {
1277             final String type_str = ( ( String ) st.nextElement() ).trim();
1278             if ( type_str.equalsIgnoreCase( NODE_LABEL_DIRECTION.HORIZONTAL.toString() ) ) {
1279                 setNodeLabelDirection( NODE_LABEL_DIRECTION.HORIZONTAL );
1280             }
1281             else if ( type_str.equalsIgnoreCase( NODE_LABEL_DIRECTION.RADIAL.toString() ) ) {
1282                 setNodeLabelDirection( NODE_LABEL_DIRECTION.RADIAL );
1283             }
1284             else {
1285                 setNodeLabelDirection( NODE_LABEL_DIRECTION.HORIZONTAL );
1286                 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + type_str
1287                         + "] for [node_label_direction]" );
1288             }
1289         }
1290         else if ( key.equals( "branch_length_value_digits" ) ) {
1291             final short i = parseShort( ( ( String ) st.nextElement() ).trim() );
1292             if ( i >= 0 ) {
1293                 setNumberOfDigitsAfterCommaForBranchLengthValue( i );
1294             }
1295             else {
1296                 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "illegal value [" + i
1297                         + "] for [branch_length_value_digits]" );
1298             }
1299         }
1300         else if ( key.equals( "confidence_value_digits" ) ) {
1301             final short i = parseShort( ( ( String ) st.nextElement() ).trim() );
1302             if ( i >= 0 ) {
1303                 setNumberOfDigitsAfterCommaForConfidenceValues( i );
1304             }
1305             else {
1306                 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "illegal value [" + i
1307                         + "] for [confidence_value_digits]" );
1308             }
1309         }
1310         else if ( key.equals( "allow_editing" ) ) {
1311             setEditable( parseBoolean( ( String ) st.nextElement() ) );
1312         }
1313         else if ( key.equals( "display_sequence_relations" ) ) {
1314             setDisplaySequenceRelations( parseBoolean( ( String ) st.nextElement() ) );
1315         }
1316         else if ( key.equals( "replace_underscores_in_nh_parsing" ) ) {
1317             final boolean r = parseBoolean( ( String ) st.nextElement() );
1318             if ( r && ( getTaxonomyExtraction() != TAXONOMY_EXTRACTION.NO ) ) {
1319                 ForesterUtil
1320                         .printWarningMessage( Constants.PRG_NAME,
1321                                               "attempt to extract taxonomies and replace underscores at the same time" );
1322             }
1323             else {
1324                 setReplaceUnderscoresInNhParsing( r );
1325             }
1326         }
1327         else if ( key.equals( "taxonomy_extraction_in_nh_parsing" ) ) {
1328             final String s = ( String ) st.nextElement();
1329             if ( s.equalsIgnoreCase( "no" ) ) {
1330                 setTaxonomyExtraction( TAXONOMY_EXTRACTION.NO );
1331             }
1332             else if ( s.equalsIgnoreCase( "pfam_relaxed" ) ) {
1333                 setTaxonomyExtraction( TAXONOMY_EXTRACTION.PFAM_STYLE_RELAXED );
1334             }
1335             else if ( s.equalsIgnoreCase( "pfam_strict" ) ) {
1336                 setTaxonomyExtraction( TAXONOMY_EXTRACTION.PFAM_STYLE_STRICT );
1337             }
1338             else if ( s.equalsIgnoreCase( "aggressive" ) ) {
1339                 setTaxonomyExtraction( TAXONOMY_EXTRACTION.AGGRESSIVE );
1340             }
1341             else {
1342                 ForesterUtil
1343                         .printWarningMessage( Constants.PRG_NAME,
1344                                               "unknown value for \"taxonomy_extraction_in_nh_parsing\": "
1345                                                       + s
1346                                                       + " (must be either: no, pfam_relaxed, pfam_strict, or aggressive)" );
1347             }
1348             if ( ( getTaxonomyExtraction() != TAXONOMY_EXTRACTION.NO ) && isReplaceUnderscoresInNhParsing() ) {
1349                 ForesterUtil
1350                         .printWarningMessage( Constants.PRG_NAME,
1351                                               "attempt to extract taxonomies and replace underscores at the same time" );
1352             }
1353         }
1354         else if ( key.equals( "internal_labels_are_confidence_values" ) ) {
1355             setInternalNumberAreConfidenceForNhParsing( parseBoolean( ( String ) st.nextElement() ) );
1356         }
1357         else if ( key.equals( "gui_background_color" ) ) {
1358             _gui_background_color = Color.decode( ( String ) st.nextElement() );
1359         }
1360         else if ( key.equals( "gui_checkbox_text_color" ) ) {
1361             _gui_checkbox_text_color = Color.decode( ( String ) st.nextElement() );
1362         }
1363         else if ( key.equals( "gui_checkbox_and_button_active_color" ) ) {
1364             _gui_checkbox_and_button_active_color = Color.decode( ( String ) st.nextElement() );
1365         }
1366         else if ( key.equals( "gui_button_text_color" ) ) {
1367             _gui_button_text_color = Color.decode( ( String ) st.nextElement() );
1368         }
1369         else if ( key.equals( "gui_button_background_color" ) ) {
1370             _gui_button_background_color = Color.decode( ( String ) st.nextElement() );
1371         }
1372         else if ( key.equals( "gui_menu_background_color" ) ) {
1373             _gui_menu_background_color = Color.decode( ( String ) st.nextElement() );
1374         }
1375         else if ( key.equals( "gui_menu_text_color" ) ) {
1376             _gui_menu_text_color = Color.decode( ( String ) st.nextElement() );
1377         }
1378         else if ( key.equals( "gui_button_border_color" ) ) {
1379             _gui_button_border_color = Color.decode( ( String ) st.nextElement() );
1380         }
1381       
1382         else if ( key.equals( "show_default_node_shapes" ) ) {
1383             ForesterUtil
1384                     .printWarningMessage( Constants.PRG_NAME,
1385                                           "configuration key [show_default_node_shapes] is deprecated, use [show_default_node_shapes_internal] and [show_default_node_shapes_external] instead" );
1386             final boolean b = parseBoolean( ( ( String ) st.nextElement() ).trim() );
1387             setShowDefaultNodeShapesInternal( b );
1388             setShowDefaultNodeShapesExternal( b );
1389         }
1390         else if ( key.equals( "show_default_node_shapes_internal" ) ) {
1391             setShowDefaultNodeShapesInternal( parseBoolean( ( ( String ) st.nextElement() ).trim() ) );
1392         }
1393         else if ( key.equals( "show_default_node_shapes_external" ) ) {
1394             setShowDefaultNodeShapesExternal( parseBoolean( ( ( String ) st.nextElement() ).trim() ) );
1395         }
1396         else if ( key.equals( "default_node_size" ) ) {
1397             final short i = parseShort( ( ( String ) st.nextElement() ).trim() );
1398             setDefaultNodeShapeSize( i );
1399         }
1400         else if ( key.equals( "default_node_fill" ) ) {
1401             final String fill_str = ( ( String ) st.nextElement() ).trim();
1402             if ( fill_str.equalsIgnoreCase( NodeVisualData.NodeFill.NONE.toString() ) ) {
1403                 setDefaultNodeFill( NodeFill.NONE );
1404             }
1405             else if ( fill_str.equalsIgnoreCase( NodeVisualData.NodeFill.GRADIENT.toString() ) ) {
1406                 setDefaultNodeFill( NodeFill.GRADIENT );
1407             }
1408             else if ( fill_str.equalsIgnoreCase( NodeVisualData.NodeFill.SOLID.toString() ) ) {
1409                 setDefaultNodeFill( NodeFill.SOLID );
1410             }
1411             else {
1412                 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + fill_str
1413                         + "] for [default_node_fill]" );
1414             }
1415         }
1416         else if ( key.equals( "default_node_shape" ) ) {
1417             final String shape_str = ( ( String ) st.nextElement() ).trim();
1418             if ( shape_str.equalsIgnoreCase( NodeVisualData.NodeShape.CIRCLE.toString() ) ) {
1419                 setDefaultNodeShape( NodeShape.CIRCLE );
1420             }
1421             else if ( shape_str.equalsIgnoreCase( NodeVisualData.NodeShape.RECTANGLE.toString() ) ) {
1422                 setDefaultNodeShape( NodeShape.RECTANGLE );
1423             }
1424             else {
1425                 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + shape_str
1426                         + "] for [default_node_shape]" );
1427             }
1428         }
1429         else if ( key.equals( "midpoint_reroot" ) ) {
1430             setMidpointReroot( parseBoolean( ( String ) st.nextElement() ) );
1431         }
1432         else if ( key.equals( "ext_descendents_data_to_return" ) ) {
1433             final String s = ( ( String ) st.nextElement() ).trim();
1434             if ( s.equalsIgnoreCase( "node_name" ) ) {
1435                 setExtDescNodeDataToReturn( NODE_DATA.NODE_NAME );
1436             }
1437             else if ( s.equalsIgnoreCase( "sequence_acc" ) ) {
1438                 setExtDescNodeDataToReturn( NODE_DATA.SEQUENCE_ACC );
1439             }
1440             else if ( s.equalsIgnoreCase( "sequence_mol_seq_fasta" ) ) {
1441                 setExtDescNodeDataToReturn( NODE_DATA.SEQUENCE_MOL_SEQ_FASTA );
1442             }
1443             else if ( s.equalsIgnoreCase( "sequence_mol_seq" ) ) {
1444                 setExtDescNodeDataToReturn( NODE_DATA.SEQUENCE_MOL_SEQ );
1445             }
1446             else if ( s.equalsIgnoreCase( "sequence_name" ) ) {
1447                 setExtDescNodeDataToReturn( NODE_DATA.SEQUENCE_NAME );
1448             }
1449             else if ( s.equalsIgnoreCase( "gene_name" ) ) {
1450                 setExtDescNodeDataToReturn( NODE_DATA.GENE_NAME );
1451             }
1452             else if ( s.equalsIgnoreCase( "sequence_symbol" ) ) {
1453                 setExtDescNodeDataToReturn( NODE_DATA.SEQUENCE_SYMBOL );
1454             }
1455             else if ( s.equalsIgnoreCase( "taxonomy_scientific_name" ) ) {
1456                 setExtDescNodeDataToReturn( NODE_DATA.TAXONOMY_SCIENTIFIC_NAME );
1457             }
1458             else if ( s.equalsIgnoreCase( "taxonomy_code" ) ) {
1459                 setExtDescNodeDataToReturn( NODE_DATA.TAXONOMY_CODE );
1460             }
1461             else if ( s.equalsIgnoreCase( "taxonomy_common_name" ) ) {
1462                 setExtDescNodeDataToReturn( NODE_DATA.TAXONOMY_COMM0N_NAME );
1463             }
1464             else if ( s.equalsIgnoreCase( "user_selected" ) ) {
1465                 setExtDescNodeDataToReturn( NODE_DATA.UNKNOWN );
1466             }
1467             else {
1468                 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + s
1469                         + "] for [ext_descendents_data_to_return]" );
1470             }
1471         }
1472         else if ( key.equals( "label_for_get_ext_descendents_data" ) ) {
1473             final String s = ( ( String ) st.nextElement() ).trim();
1474             if ( ForesterUtil.isEmpty( s ) || ( s.length() < 2 ) ) {
1475                 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "illegal value [" + s
1476                         + "] for [label_for_get_ext_descendents_data]" );
1477             }
1478             else {
1479                 setLabelForGetExtDescendentsData( s.replaceAll( "_", " " ) );
1480             }
1481         }
1482         else if ( key.equals( "ext_descendents_data_to_return_on" ) ) {
1483             final String s = ( ( String ) st.nextElement() ).trim().toLowerCase();
1484             if ( s.equals( "console" ) ) {
1485                 setExtNodeDataReturnOn( EXT_NODE_DATA_RETURN_ON.CONSOLE );
1486             }
1487             else if ( s.equals( "window" ) ) {
1488                 setExtNodeDataReturnOn( EXT_NODE_DATA_RETURN_ON.WINODW );
1489             }
1490             else if ( s.equals( "buffer_only" ) ) {
1491                 setExtNodeDataReturnOn( EXT_NODE_DATA_RETURN_ON.BUFFER_ONLY );
1492             }
1493             else {
1494                 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + s
1495                         + "] for [ext_descendents_data_to_return_on]" );
1496             }
1497         }
1498        
1499         else if ( key.equals( "vector_data_min_color" ) ) {
1500             _vector_data_min_color = Color.decode( ( String ) st.nextElement() );
1501         }
1502         else if ( key.equals( "vector_data_max_color" ) ) {
1503             _vector_data_max_color = Color.decode( ( String ) st.nextElement() );
1504         }
1505         else if ( key.equals( "vector_data_mean_color" ) ) {
1506             _vector_data_mean_color = Color.decode( ( String ) st.nextElement() );
1507         }
1508       
1509         else if ( key.equals( "vector_data_width" ) ) {
1510             _vector_data_width = parseShort( ( String ) st.nextElement() );
1511             if ( _vector_data_width < 1 ) {
1512                 _vector_data_width = 120;
1513             }
1514         }
1515         else if ( key.equals( "vector_data_height" ) ) {
1516             _vector_data_height = parseShort( ( String ) st.nextElement() );
1517             if ( _vector_data_height < 1 ) {
1518                 _vector_data_height = 12;
1519             }
1520         }
1521        
1522         else if ( key.equals( "line_up_renderable_data" ) ) {
1523             setLineUpRendarableNodeData( parseBoolean( ( String ) st.nextElement() ) );
1524         }
1525         
1526         else if ( key.equals( "right_align_domain_architectures" ) ) {
1527             setRightLineUpDomains( parseBoolean( ( String ) st.nextElement() ) );
1528         }
1529         
1530         
1531         else if ( st.countTokens() >= 2 ) { // counts the tokens that are not
1532             // yet retrieved!
1533             int key_index = -1;
1534             if ( key.equals( "phylogram" ) ) {
1535                 key_index = Configuration.display_as_phylogram;
1536             }
1537             else if ( key.equals( "rollover" ) ) {
1538                 key_index = Configuration.node_data_popup;
1539             }
1540             else if ( key.equals( "color_according_to_species" ) ) {
1541                 key_index = Configuration.color_according_to_species;
1542             }
1543             else if ( key.equals( "color_according_to_sequence" ) ) {
1544                 key_index = Configuration.color_according_to_sequence;
1545             }
1546             else if ( key.equals( "show_node_names" ) ) {
1547                 key_index = Configuration.show_node_names;
1548             }
1549             else if ( key.equals( "show_taxonomy_code" ) ) {
1550                 key_index = Configuration.show_tax_code;
1551             }
1552             else if ( key.equals( "write_confidence_values" ) ) {
1553                 key_index = Configuration.write_confidence_values;
1554             }
1555             else if ( key.equals( "write_events" ) ) {
1556                 key_index = Configuration.write_events;
1557             }
1558             else if ( key.equals( "use_visual_styles" ) ) {
1559                 key_index = Configuration.use_style;
1560             }
1561             else if ( key.equals( "color_branches" ) ) {
1562                 key_index = Configuration.use_style;
1563                 ForesterUtil
1564                         .printWarningMessage( Constants.PRG_NAME,
1565                                               "configuration key [color_branches] is deprecated, use [use_visual_styles] instead" );
1566             }
1567             else if ( key.equals( "width_branches" ) ) {
1568                 key_index = Configuration.width_branches;
1569             }
1570             else if ( key.equals( "show_domain_architectures" ) ) {
1571                 key_index = Configuration.show_domain_architectures;
1572             }
1573             else if ( key.equals( "show_annotations" ) ) {
1574                 key_index = Configuration.show_annotation;
1575             }
1576             else if ( key.equals( "show_binary_characters" ) ) {
1577                 key_index = Configuration.show_binary_characters;
1578             }
1579             else if ( key.equals( "show_binary_character_counts" ) ) {
1580                 key_index = Configuration.show_binary_character_counts;
1581             }
1582             else if ( key.equals( "show_seq_names" ) ) {
1583                 key_index = Configuration.show_seq_names;
1584             }
1585             else if ( key.equals( "show_gene_names" ) ) {
1586                 key_index = Configuration.show_gene_names;
1587             }
1588             else if ( key.equals( "show_seq_symbols" ) ) {
1589                 key_index = Configuration.show_seq_symbols;
1590             }
1591             else if ( key.equals( "show_seq_acc" ) ) {
1592                 key_index = Configuration.show_sequence_acc;
1593             }
1594             else if ( key.equals( "display_internal_data" ) ) {
1595                 key_index = Configuration.display_internal_data;
1596             }
1597             else if ( key.equals( "dynamically_hide_data" ) ) {
1598                 key_index = Configuration.dynamically_hide_data;
1599             }
1600             else if ( key.equals( "show_taxonomy_scientific_names" ) ) {
1601                 key_index = Configuration.show_taxonomy_scientific_names;
1602             }
1603             else if ( key.equals( "show_taxonomy_common_names" ) ) {
1604                 key_index = Configuration.show_taxonomy_common_names;
1605             }
1606             else if ( key.equals( "show_taxonomy_images" ) ) {
1607                 key_index = Configuration.show_taxonomy_images;
1608             }
1609             else if ( key.equals( "color_according_to_annotation" ) ) {
1610                 key_index = Configuration.color_according_to_annotation;
1611             }
1612             else if ( key.equals( "show_vector_data" ) ) {
1613                 key_index = Configuration.show_vector_data;
1614             }
1615             else if ( key.equals( "show_properties" ) ) {
1616                 key_index = Configuration.show_properties;
1617             }
1618             else if ( key.equals( "show_relation_confidence" ) ) {
1619                 key_index = Configuration.show_relation_confidence;
1620             }
1621             // If we've found the key, set the values
1622             if ( key_index >= 0 ) {
1623                 display_options[ key_index ][ 1 ] = ( String ) st.nextElement();
1624                 display_options[ key_index ][ 2 ] = ( String ) st.nextElement();
1625                 // otherwise, keep looking
1626             }
1627             else {
1628                 if ( key_index == DEPRECATED ) {
1629                     // Deprecated.
1630                 }
1631                 else if ( key.equals( "click_to" ) ) {
1632                     final String click_to_name = ( String ) st.nextElement();
1633                     key_index = getClickToIndex( click_to_name );
1634                     if ( key_index >= 0 ) {
1635                         clickto_options[ key_index ][ 1 ] = ( String ) st.nextElement();
1636                     }
1637                     else if ( key_index == DEPRECATED ) {
1638                         // Deprecated.
1639                     }
1640                     else {
1641                         ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown click-to option: "
1642                                 + click_to_name );
1643                     }
1644                 }
1645                 else if ( key.equals( "species_color" ) ) {
1646                     getSpeciesColors().put( ( ( String ) st.nextElement() ).replace( '_', ' ' ),
1647                                             Color.decode( ( String ) st.nextElement() ) );
1648                 }
1649                 else if ( key.equals( "sequence_color" ) ) {
1650                     getSequenceColors().put( ( ( String ) st.nextElement() ).replace( '_', ' ' ),
1651                                              Color.decode( ( String ) st.nextElement() ) );
1652                 }
1653                 else if ( key.equals( "domain_color" ) ) {
1654                     getDomainColors().put( ( String ) st.nextElement(), Color.decode( ( String ) st.nextElement() ) );
1655                 }
1656                 else if ( key.equals( "annotation_color" ) ) {
1657                     getAnnotationColors()
1658                             .put( ( String ) st.nextElement(), Color.decode( ( String ) st.nextElement() ) );
1659                 }
1660                 else if ( key.equals( "function_color" ) ) {
1661                     ForesterUtil.printWarningMessage( Constants.PRG_NAME,
1662                                                       "configuration key [function_color] is deprecated" );
1663                 }
1664                 else if ( key.equals( DISPLAY_COLOR_KEY ) ) {
1665                     putDisplayColors( ( String ) st.nextElement(), Color.decode( ( String ) st.nextElement() ) );
1666                 }
1667                 else {
1668                     ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown configuration key [" + key
1669                             + "] in: " + config_filename );
1670                 }
1671             }
1672         }
1673         else {
1674             ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown configuration key [" + key + "] in: "
1675                     + config_filename );
1676         }
1677     }
1678
1679     private void setLabelForGetExtDescendentsData( final String label_for_get_ext_descendents_data ) {
1680         _label_for_get_ext_descendents_data = label_for_get_ext_descendents_data;
1681     }
1682
1683     private void setMaxBaseFontSize( final int max_base_font_size ) {
1684         _max_base_font_size = max_base_font_size;
1685     }
1686
1687     private void setMinBaseFontSize( final int min_base_font_size ) {
1688         _min_base_font_size = min_base_font_size;
1689     }
1690
1691     private void setOvMaxHeight( final short ov_max_height ) {
1692         _ov_max_height = ov_max_height;
1693     }
1694
1695     private void setOvMaxWidth( final short ov_max_width ) {
1696         _ov_max_width = ov_max_width;
1697     }
1698
1699     private void setOvPlacement( final OVERVIEW_PLACEMENT_TYPE ov_placement ) {
1700         _ov_placement = ov_placement;
1701     }
1702
1703     private void setPathToLocalFastme( final File path_to_local_fastme ) {
1704         _path_to_local_fastme = path_to_local_fastme;
1705     }
1706
1707     private void setPathToLocalMafft( final File path_to_local_mafft ) {
1708         _path_to_local_mafft = path_to_local_mafft;
1709     }
1710
1711     private void setPathToLocalRaxml( final File path_to_local_raxml ) {
1712         _path_to_local_raxml = path_to_local_raxml;
1713     }
1714
1715     private void setShowAnnotationRefSource( final boolean b ) {
1716         _show_annotation_ref_source = b;
1717     }
1718
1719     private void setShowOverview( final boolean show_overview ) {
1720         _show_overview = show_overview;
1721     }
1722
1723     private void setValidatePhyloXmlAgainstSchema( final boolean validate_against_phyloxml_xsd_schema ) {
1724         _validate_against_phyloxml_xsd_schema = validate_against_phyloxml_xsd_schema;
1725     }
1726
1727     static String getDefaultFontFamilyName() {
1728         return DEFAULT_FONT_FAMILY;
1729     }
1730
1731     public enum EXT_NODE_DATA_RETURN_ON {
1732         BUFFER_ONLY, CONSOLE, WINODW;
1733     }
1734
1735     public enum UI {
1736         CROSSPLATFORM, NATIVE, NIMBUS, UNKNOWN
1737     }
1738
1739     static enum TRIPLET {
1740         FALSE, TRUE, UNKNOWN
1741     }
1742
1743     public Color getVectorDataMinColor() {
1744         return _vector_data_min_color;
1745     }
1746
1747     public Color getVectorDataMaxColor() {
1748         return _vector_data_max_color;
1749     }
1750
1751     public Color getVectorDataMeanColor() {
1752         return _vector_data_mean_color;
1753     }
1754
1755     public double getVectorDataHeight() {
1756         return _vector_data_height;
1757     }
1758
1759     public int getVectorDataWidth() {
1760         return _vector_data_width;
1761     }
1762     
1763     final public boolean isLineUpRendarableNodeData() {
1764         
1765         return _line_up_renderable_node_data;
1766     }
1767     
1768     final public boolean isRightLineUpDomains() {
1769         
1770         return _right_align_domains;
1771     }
1772     
1773     final public void setLineUpRendarableNodeData( final boolean line_up_renderable_node_data) {
1774         
1775          _line_up_renderable_node_data = line_up_renderable_node_data;
1776     }
1777     
1778     final public void setRightLineUpDomains( final boolean right_align_domains ) {
1779         
1780         _right_align_domains = right_align_domains;
1781     }
1782     
1783     
1784 }