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