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