2 // FORESTER -- software libraries and applications
3 // for evolutionary biology research and applications.
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
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.
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.
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
26 // Contact: phylosoft @ gmail . com
27 // WWW: www.phylosoft.org/forester
29 package org.forester.archaeopteryx;
31 import java.awt.Color;
32 import java.io.BufferedReader;
34 import java.io.FileReader;
35 import java.io.IOException;
36 import java.io.InputStreamReader;
37 import java.net.MalformedURLException;
39 import java.util.Arrays;
40 import java.util.Hashtable;
42 import java.util.SortedMap;
43 import java.util.StringTokenizer;
44 import java.util.TreeMap;
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.util.ForesterUtil;
52 public final class Configuration {
55 NATIVE, CROSSPLATFORM, NIMBUS, UNKNOWN
57 static final String VALIDATE_AGAINST_PHYLOXML_XSD_SCHEMA = "validate_against_phyloxml_xsd_schema";
58 private static final String WEB_LINK_KEY = "web_link";
59 private static final String DISPLAY_COLOR_KEY = "display_color";
60 private static final int DEPRECATED = -2;
61 private UI _ui = UI.UNKNOWN;
62 private boolean _use_tabbed_display = false;
63 private boolean _hide_controls_and_menus = false;
64 private CLADOGRAM_TYPE _cladogram_type = Constants.CLADOGRAM_TYPE_DEFAULT;
65 private SortedMap<String, WebLink> _weblinks = null;
66 private SortedMap<String, Color> _display_colors = null;
67 private boolean _antialias_screen = true;
68 private PHYLOGENY_GRAPHICS_TYPE _phylogeny_graphics_type = PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR;
69 private String _base_font_family_name = "";
70 private int _base_font_size = -1;
71 private int _graphics_export_x = -1;
72 private int _graphics_export_y = -1;
73 private short _ov_max_width = 80;
74 private short _ov_max_height = 80;
75 private OVERVIEW_PLACEMENT_TYPE _ov_placement = OVERVIEW_PLACEMENT_TYPE.UPPER_LEFT;
76 private double _min_confidence_value = Options.MIN_CONFIDENCE_DEFAULT;
77 private float _print_line_width = Constants.PDF_LINE_WIDTH_DEFAULT;
78 private boolean _show_scale = false;
79 private boolean _show_branch_length_values = false;
80 private boolean _show_overview = true;
81 private short _number_of_digits_after_comma_for_confidence_values = Constants.NUMBER_OF_DIGITS_AFTER_COMMA_FOR_CONFIDENCE_VALUES_DEFAULT;
82 private short _number_of_digits_after_comma_for_branch_length_values = Constants.NUMBER_OF_DIGITS_AFTER_COMMA_FOR_BRANCH_LENGTH_VALUES_DEFAULT;
83 private boolean _editable = true;
84 private boolean _nh_parsing_replace_underscores = false;
85 private boolean _nh_parsing_extract_pfam_taxonomy_codes = false;
86 private boolean _internal_number_are_confidence_for_nh_parsing = false;
87 private boolean _display_sequence_relations = false;
88 private boolean _validate_against_phyloxml_xsd_schema = Constants.VALIDATE_AGAINST_PHYLOXML_XSD_SCJEMA_DEFAULT;
89 private boolean _background_color_gradient = false;
90 private boolean _show_domain_labels = true;
91 private boolean _abbreviate_scientific_names = false;
92 private boolean _color_labels_same_as_parent_branch = false;
93 private int _default_bootstrap_samples = -1;
94 final static int display_as_phylogram = 0;
95 final static int show_node_names = 1;
96 final static int show_tax_code = 2;
97 final static int show_annotation = 3;
98 final static int write_confidence_values = 4;
99 final static int write_events = 5;
100 final static int color_according_to_species = 6;
101 final static int color_branches = 7;
102 final static int width_branches = 8;
103 final static int show_domain_architectures = 9;
104 final static int show_binary_characters = 10;
105 final static int show_binary_character_counts = 11;
106 final static int show_gene_names = 12;
107 final static int show_sequence_acc = 13;
108 final static int display_internal_data = 14;
109 final static int dynamically_hide_data = 15;
110 final static int show_taxonomy_scientific_names = 16;
111 final static int show_taxonomy_common_names = 17;
112 final static int color_according_to_annotation = 18;
113 final static int show_property = 19;
114 final static int show_gene_symbols = 20;
115 final static int node_data_popup = 21;
116 final static int show_relation_confidence = 22;
117 final static int show_vector_data = 23;
118 final static int show_taxonomy_images = 24;
119 // ------------------
121 // ------------------
122 final static int display_node_data = 0;
123 final static int collapse_uncollapse = 1;
124 final static int reroot = 2;
125 final static int subtree = 3;
126 final static int swap = 4;
127 final static int color_subtree = 5;
128 final static int open_seq_web = 6;
129 final static int open_tax_web = 7;
130 final static int cut_subtree = 8;
131 final static int copy_subtree = 9;
132 final static int paste_subtree = 10;
133 final static int delete_subtree_or_node = 11;
134 final static int add_new_node = 12;
135 final static int edit_node_data = 13;
136 final static int blast = 14;
137 // ---------------------------
138 // Display options for trees
139 // ---------------------------
140 // ---------------------------------
141 // Pertaining to the config itself
142 // ---------------------------------
143 // Full path to config (may be URL)
144 String config_filename;
145 String default_config_filename = Constants.DEFAULT_CONFIGURATION_FILE_NAME;
146 final static String display_options[][] = {
147 { "Phylogram", "display", "?" }, { "Node Name", "display", "yes" }, { "Taxonomy Code", "display", "yes" },
148 { "Annotation", "nodisplay", "no" }, { "Confidence Value", "display", "?" }, { "Event", "display", "?" },
149 { "Taxonomy Colorize", "display", "yes" }, { "Colorize Branches", "display", "no" },
150 { "Use Branch-Width", "nodisplay", "no" }, { "Domains", "nodisplay", "no" },
151 { "Binary Characters", "nodisplay", "no" }, { "Binary Char Counts", "nodisplay", "no" },
152 { "Prot/Gene Name", "display", "no" }, { "Prot/Gene Acc", "display", "no" },
153 { "Show Internal Data", "display", "yes" }, { "Dyna Hide", "display", "yes" },
154 { "Taxonomy Scientific", "display", "yes" }, { "Taxonomy Common", "display", "no" },
155 { "Annotation Colorize", "nodisplay", "no" }, { "Property", "nodisplay", "no" },
156 { "Prot/Gene Symbol", "display", "no" }, { "Rollover", "display", "yes" },
157 { "Relation Confidence", "display", "no" }, { "Vector Data", "display", "no" },
158 { "Taxonomy Images", "display", "no" } };
159 final static String clickto_options[][] = {
160 { "Display Node Data", "display" }, { "Collapse/Uncollapse", "display" }, { "Root/Reroot", "display" },
161 { "Sub/Super Tree", "display" }, { "Swap Descendants", "display" }, { "Colorize Subtree", "display" },
162 { "Open Sequence Web", "nodisplay" }, { "Open Taxonomy Web", "nodisplay" }, { "Cut Subtree", "display" },
163 { "Copy Subtree", "display" }, { "Paste Subtree", "display" }, { "Delete Subtree/Node", "display" },
164 { "Add New Node", "display" }, { "Edit Node Data", "display" }, { "Blast", "display" } };
165 // This option is selected in the dropdown
166 int default_clickto = Configuration.display_node_data;
170 TreeColorSet tree_color_set;
174 TreeFontSet tree_font_set;
178 private static Hashtable<String, Color> _species_colors;
182 private static Hashtable<String, Color> _domain_colors;
186 private static Hashtable<String, Color> _annotation_colors;
187 boolean verbose = Constants.VERBOSE_DEFAULT;
188 private NODE_LABEL_DIRECTION _node_label_direction = NODE_LABEL_DIRECTION.HORIZONTAL;
189 private Color _gui_background_color = Constants.GUI_BACKGROUND_DEFAULT;
190 private Color _gui_checkbox_text_color = Constants.CHECKBOX_TEXT_COLOR_DEFAULT;
191 private Color _gui_checkbox_and_button_active_color = Constants.CHECKBOX_AND_BUTTON_ACTIVE_COLOR_DEFAULT;
192 private Color _gui_button_text_color = Constants.BUTTON_TEXT_COLOR_DEFAULT;
193 private Color _gui_button_background_color = Constants.BUTTON_BACKGROUND_COLOR_DEFAULT;
194 private Color _gui_menu_background_color = Constants.MENU_BACKGROUND_COLOR_DEFAULT;
195 private Color _gui_menu_text_color = Constants.MENU_TEXT_COLOR_DEFAULT;
196 private Color _gui_button_border_color = Constants.BUTTON_BORDER_COLOR_DEFAULT;
197 private Color _domain_structure_font_color = Constants.DOMAIN_STRUCTURE_FONT_COLOR_DEFAULT;
198 private Color _domain_structure_base_color = Constants.DOMAIN_STRUCTURE_BASE_COLOR_DEFAULT;
199 private static String DEFAULT_FONT_FAMILY = "";
201 for( final String font_name : Constants.DEFAULT_FONT_CHOICES ) {
202 if ( Arrays.binarySearch( Util.getAvailableFontFamiliesSorted(), font_name ) >= 0 ) {
203 DEFAULT_FONT_FAMILY = font_name;
207 if ( ForesterUtil.isEmpty( DEFAULT_FONT_FAMILY ) ) {
208 DEFAULT_FONT_FAMILY = Constants.DEFAULT_FONT_CHOICES[ Constants.DEFAULT_FONT_CHOICES.length - 1 ];
212 Configuration( final String cf, final boolean is_url, final boolean is_applet ) {
213 if ( ForesterUtil.isEmpty( cf ) ) {
214 config_filename = default_config_filename;
217 config_filename = cf;
219 setWebLinks( new TreeMap<String, WebLink>() );
220 setDisplayColors( new TreeMap<String, Color>() );
221 config_filename = config_filename.trim();
224 // If URL, open accordingly
226 u = new URL( config_filename );
228 final InputStreamReader isr = new InputStreamReader( u.openStream() );
229 final BufferedReader bf = new BufferedReader( isr );
232 ForesterUtil.programMessage( Constants.PRG_NAME, "successfully read from configuration url ["
233 + config_filename + "]" );
235 catch ( final Exception e ) {
236 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "failed to read configuration from ["
237 + config_filename + "]: " + e.getLocalizedMessage() );
240 catch ( final Exception e ) {
241 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "cannot find or open configuration url ["
242 + config_filename + "]" );
246 // Otherwise, open as a file
247 File f = new File( config_filename );
249 f = new File( config_filename + ".txt" );
251 if ( f.exists() && f.canRead() ) {
253 final BufferedReader bf = new BufferedReader( new FileReader( f ) );
257 catch ( final Exception e ) {
258 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "failed to read configuration from ["
259 + config_filename + "]: " + e );
263 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "cannot find or open configuration file ["
264 + config_filename + "]" );
269 private void createWebLink( final String url_str, final String desc, final String source_identifier ) {
270 WebLink weblink = null;
273 weblink = new WebLink( new URL( url_str.trim() ), desc.trim(), source_identifier.trim() );
275 catch ( final MalformedURLException e ) {
276 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not create URL from [" + url_str + "]" );
279 if ( !ex && ( weblink != null ) ) {
280 getWebLinks().put( weblink.getSourceIdentifier().toLowerCase(), weblink );
284 Color getGuiBackgroundColor() {
285 return _gui_background_color;
288 Color getGuiCheckboxTextColor() {
289 return _gui_checkbox_text_color;
292 Color getGuiCheckboxAndButtonActiveColor() {
293 return _gui_checkbox_and_button_active_color;
296 Color getGuiButtonTextColor() {
297 return _gui_button_text_color;
300 Color getGuiButtonBackgroundColor() {
301 return _gui_button_background_color;
304 Color getGuiMenuBackgroundColor() {
305 return _gui_menu_background_color;
308 Color getGuiMenuTextColor() {
309 return _gui_menu_text_color;
312 Color getGuiButtonBorderColor() {
313 return _gui_button_border_color;
316 boolean displaySequenceRelations() {
317 return _display_sequence_relations;
320 boolean doCheckOption( final int which ) {
321 return ( display_options[ which ][ 2 ].equalsIgnoreCase( "yes" ) )
322 || ( display_options[ which ][ 2 ].equalsIgnoreCase( "true" ) );
325 boolean doDisplayClickToOption( final int which ) {
326 return clickto_options[ which ][ 1 ].equalsIgnoreCase( "display" );
329 boolean doDisplayOption( final int which ) {
330 return display_options[ which ][ 1 ].equalsIgnoreCase( "display" );
334 * Will attempt to use the phylogeny to determine whether to check
335 * this or not (e.g. phylogram)
338 boolean doGuessCheckOption( final int which ) {
339 return display_options[ which ][ 2 ].equals( "?" );
342 Map<String, Color> getAnnotationColors() {
343 if ( _annotation_colors == null ) {
344 _annotation_colors = new Hashtable<String, Color>();
346 return _annotation_colors;
349 public String getBaseFontFamilyName() {
350 return _base_font_family_name;
353 int getBaseFontSize() {
354 return _base_font_size;
357 CLADOGRAM_TYPE getCladogramType() {
358 return _cladogram_type;
361 private int getClickToIndex( final String name ) {
363 if ( name.equals( "edit_info" ) ) {
364 index = Configuration.display_node_data;
366 .printWarningMessage( Constants.PRG_NAME,
367 "configuration key [edit_info] is deprecated, use [display node data] instead" );
369 else if ( name.equals( "display_node_data" ) ) {
370 index = Configuration.display_node_data;
372 else if ( name.equals( "collapse_uncollapse" ) ) {
373 index = Configuration.collapse_uncollapse;
375 else if ( name.equals( "reroot" ) ) {
376 index = Configuration.reroot;
378 else if ( name.equals( "subtree" ) ) {
379 index = Configuration.subtree;
381 else if ( name.equals( "swap" ) ) {
382 index = Configuration.swap;
384 else if ( name.equals( "display_sequences" ) ) {
386 .printWarningMessage( Constants.PRG_NAME, "configuration key [display_sequences] is deprecated" );
389 else if ( name.equals( "open_seq_web" ) ) {
390 index = Configuration.open_seq_web;
392 else if ( name.equals( "open_tax_web" ) ) {
393 index = Configuration.open_tax_web;
395 else if ( name.equals( "cut_subtree" ) ) {
396 index = Configuration.cut_subtree;
398 else if ( name.equals( "copy_subtree" ) ) {
399 index = Configuration.copy_subtree;
401 else if ( name.equals( "paste_subtree" ) ) {
402 index = Configuration.paste_subtree;
404 else if ( name.equals( "delete" ) ) {
405 index = Configuration.delete_subtree_or_node;
407 else if ( name.equals( "add_new_node" ) ) {
408 index = Configuration.add_new_node;
410 else if ( name.equals( "edit_node_data" ) ) {
411 index = Configuration.edit_node_data;
413 else if ( name.equals( "display_node_popup" ) ) {
414 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
415 "configuration key [display_node_popup] is deprecated" );
418 else if ( name.equals( "custom_option" ) ) {
419 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "configuration key [custom_option] is deprecated" );
422 else if ( name.equals( "color_subtree" ) ) {
423 index = Configuration.color_subtree;
425 else if ( name.equals( "go_to_swiss_prot" ) ) {
426 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "configuration key [go_to_swiss_prot] is deprecated" );
432 int getClickToOptionsCount() {
433 return clickto_options.length;
436 String getClickToTitle( final int which ) {
437 return clickto_options[ which ][ 0 ];
440 int getDefaultDisplayClicktoOption() {
441 return default_clickto;
444 SortedMap<String, Color> getDisplayColors() {
445 return _display_colors;
448 String getDisplayTitle( final int which ) {
449 return display_options[ which ][ 0 ];
452 Map<String, Color> getDomainColors() {
453 if ( _domain_colors == null ) {
454 _domain_colors = new Hashtable<String, Color>();
456 return _domain_colors;
459 int getGraphicsExportX() {
460 return _graphics_export_x;
463 int getGraphicsExportY() {
464 return _graphics_export_y;
467 int getDefaultBootstrapSamples() {
468 return _default_bootstrap_samples;
471 double getMinConfidenceValue() {
472 return _min_confidence_value;
475 NODE_LABEL_DIRECTION getNodeLabelDirection() {
476 return _node_label_direction;
479 short getNumberOfDigitsAfterCommaForBranchLengthValues() {
480 return _number_of_digits_after_comma_for_branch_length_values;
483 short getNumberOfDigitsAfterCommaForConfidenceValues() {
484 return _number_of_digits_after_comma_for_confidence_values;
487 short getOvMaxHeight() {
488 return _ov_max_height;
491 short getOvMaxWidth() {
492 return _ov_max_width;
495 OVERVIEW_PLACEMENT_TYPE getOvPlacement() {
496 return _ov_placement;
499 PHYLOGENY_GRAPHICS_TYPE getPhylogenyGraphicsType() {
500 return _phylogeny_graphics_type;
503 float getPrintLineWidth() {
504 return _print_line_width;
507 Hashtable<String, Color> getSpeciesColors() {
508 if ( _species_colors == null ) {
509 _species_colors = new Hashtable<String, Color>();
511 return _species_colors;
514 TreeColorSet getTreeColorSet() {
518 TreeFontSet getTreeFontSet() {
522 WebLink getWebLink( final String source ) {
523 return getWebLinks().get( source );
526 Map<String, WebLink> getWebLinks() {
530 boolean isAntialiasScreen() {
531 return _antialias_screen;
534 public boolean isBackgroundColorGradient() {
535 return _background_color_gradient;
539 * Convenience method.
541 * @return true if value in configuration file was 'yes'
543 boolean isDrawAsPhylogram() {
544 return doCheckOption( display_as_phylogram );
547 boolean isEditable() {
551 boolean isExtractPfamTaxonomyCodesInNhParsing() {
552 return _nh_parsing_extract_pfam_taxonomy_codes;
555 boolean isHasWebLink( final String source ) {
556 return getWebLinks().containsKey( source );
560 * Only used by ArchaeoptryxE.
563 boolean isHideControlPanelAndMenubar() {
564 return _hide_controls_and_menus;
567 boolean isInternalNumberAreConfidenceForNhParsing() {
568 return _internal_number_are_confidence_for_nh_parsing;
571 boolean isReplaceUnderscoresInNhParsing() {
572 return _nh_parsing_replace_underscores;
575 boolean isShowBranchLengthValues() {
576 return _show_branch_length_values;
579 boolean isShowOverview() {
580 return _show_overview;
583 boolean isShowScale() {
587 final boolean isUseNativeUI() {
588 if ( ( _ui == UI.UNKNOWN ) && Util.isMac() && Util.isJava15() ) {
591 return _ui == UI.NATIVE;
595 * Only used by ArchaeoptryxE.
598 boolean isUseTabbedDisplay() {
599 return _use_tabbed_display;
602 boolean isValidatePhyloXmlAgainstSchema() {
603 return _validate_against_phyloxml_xsd_schema;
606 private boolean parseBoolean( final String str ) {
607 final String my_str = str.trim().toLowerCase();
608 if ( my_str.equals( "yes" ) || my_str.equals( "true" ) ) {
611 else if ( my_str.equals( "no" ) || my_str.equals( "false" ) ) {
615 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse boolean value from [" + str + "]" );
620 private double parseDouble( final String str ) {
623 d = Double.parseDouble( str );
625 catch ( final Exception e ) {
626 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse double from [" + str + "]" );
632 private float parseFloat( final String str ) {
635 f = Float.parseFloat( str );
637 catch ( final Exception e ) {
638 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse float from [" + str + "]" );
644 private int parseInt( final String str ) {
647 i = Integer.parseInt( str );
649 catch ( final Exception e ) {
650 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse integer from [" + str + "]" );
656 private short parseShort( final String str ) {
659 i = Short.parseShort( str );
661 catch ( final Exception e ) {
662 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse short from [" + str + "]" );
668 private void processFontFamily( final StringTokenizer st ) {
669 setBaseFontFamilyName( "" );
670 final String font_str = ( ( String ) st.nextElement() ).trim();
671 final String[] fonts = font_str.split( ",+" );
672 for( String font : fonts ) {
673 font = font.replace( '_', ' ' ).trim();
674 if ( Arrays.binarySearch( Util.getAvailableFontFamiliesSorted(), font ) >= 0 ) {
675 setBaseFontFamilyName( font );
682 * read each line of config file, process non-comment lines
683 * @throws IOException
685 private void readConfig( final BufferedReader conf_in ) throws IOException {
688 line = conf_in.readLine();
689 if ( line != null ) {
691 // skip comments and blank lines
692 if ( !line.startsWith( "#" ) && ( !ForesterUtil.isEmpty( line ) ) ) {
693 // convert runs of spaces to tabs
694 line = line.replaceAll( "\\s+", "\t" );
695 final StringTokenizer st = new StringTokenizer( line, "\t" );
699 } while ( line != null );
702 private void setAntialiasScreen( final boolean antialias_screen ) {
703 _antialias_screen = antialias_screen;
706 public void setBackgroundColorGradient( final boolean background_color_gradient ) {
707 _background_color_gradient = background_color_gradient;
710 private void setBaseFontFamilyName( final String base_font_family_name ) {
711 _base_font_family_name = base_font_family_name;
714 private void setBaseFontSize( final int base_font_size ) {
715 _base_font_size = base_font_size;
718 private void setShowDomainLabels( final boolean show_domain_labels ) {
719 _show_domain_labels = show_domain_labels;
722 private void setAbbreviateScientificTaxonNames( final boolean abbreviate_scientific_names ) {
723 _abbreviate_scientific_names = abbreviate_scientific_names;
726 private void setColorLabelsSameAsParentBranch( final boolean color_labels_same_as_parent_branch ) {
727 _color_labels_same_as_parent_branch = color_labels_same_as_parent_branch;
730 private void setCladogramType( final CLADOGRAM_TYPE cladogram_type ) {
731 _cladogram_type = cladogram_type;
734 void setDisplayColors( final SortedMap<String, Color> display_colors ) {
735 _display_colors = display_colors;
738 private void setDisplaySequenceRelations( final boolean display_sequence_relations ) {
739 _display_sequence_relations = display_sequence_relations;
742 private void setEditable( final boolean editable ) {
743 _editable = editable;
746 private void setExtractPfamTaxonomyCodesInNhParsing( final boolean nh_parsing_extract_pfam_taxonomy_codes ) {
747 _nh_parsing_extract_pfam_taxonomy_codes = nh_parsing_extract_pfam_taxonomy_codes;
750 private void setGraphicsExportX( final int graphics_export_x ) {
751 _graphics_export_x = graphics_export_x;
754 private void setGraphicsExportY( final int graphics_export_y ) {
755 _graphics_export_y = graphics_export_y;
758 private void setDefaultBootstrapSamples( final int default_bootstrap_samples ) {
759 _default_bootstrap_samples = default_bootstrap_samples;
762 private void setInternalNumberAreConfidenceForNhParsing( final boolean internal_number_are_confidence_for_nh_parsing ) {
763 _internal_number_are_confidence_for_nh_parsing = internal_number_are_confidence_for_nh_parsing;
767 * Set a key-value(s) tuple
769 private void setKeyValue( final StringTokenizer st ) {
770 String key = ( String ) st.nextElement();
771 key = key.replace( ':', ' ' );
773 key = key.toLowerCase();
774 // Handle single value settings first:
775 if ( key.equals( "default_click_to" ) ) {
776 final String clickto_name = ( String ) st.nextElement();
777 default_clickto = getClickToIndex( clickto_name );
778 if ( default_clickto == -1 ) {
779 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "invalid value [" + clickto_name
780 + "] for [default_click_to]" );
783 else if ( default_clickto == DEPRECATED ) {
787 else if ( key.equals( "native_ui" ) ) {
788 final String my_str = ( ( String ) st.nextElement() ).trim().toLowerCase();
789 if ( my_str.equals( "yes" ) || my_str.equals( "true" ) ) {
792 else if ( my_str.equals( "no" ) || my_str.equals( "false" ) ) {
793 _ui = UI.CROSSPLATFORM;
795 else if ( my_str.equals( "?" ) ) {
799 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse yes/no/? value from [" + my_str
804 else if ( key.equals( VALIDATE_AGAINST_PHYLOXML_XSD_SCHEMA ) ) {
805 setValidatePhyloXmlAgainstSchema( parseBoolean( ( String ) st.nextElement() ) );
807 else if ( key.equals( "antialias_screen" ) ) {
808 setAntialiasScreen( parseBoolean( ( String ) st.nextElement() ) );
810 else if ( key.equals( "phylogeny_graphics_type" ) ) {
811 final String type_str = ( ( String ) st.nextElement() ).trim();
812 if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.CONVEX.toString() ) ) {
813 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.CONVEX );
815 else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.CURVED.toString() ) ) {
816 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.CURVED );
818 else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.EURO_STYLE.toString() ) ) {
819 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.EURO_STYLE );
821 else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.ROUNDED.toString() ) ) {
822 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.ROUNDED );
824 else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR.toString() ) ) {
825 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR );
827 else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.TRIANGULAR.toString() ) ) {
828 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.TRIANGULAR );
830 else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.UNROOTED.toString() ) ) {
831 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.UNROOTED );
833 else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.CIRCULAR.toString() ) ) {
834 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.CIRCULAR );
837 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR );
838 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + type_str
839 + "] for [phylogeny_graphics_type]" );
842 else if ( key.equals( "min_confidence_value" ) ) {
843 final String mcv_str = ( ( String ) st.nextElement() ).trim();
844 final double d = parseDouble( mcv_str );
845 setMinConfidenceValue( d );
847 else if ( key.equals( "font_family" ) ) {
848 processFontFamily( st );
850 else if ( key.equals( "font_size" ) ) {
851 final String size_str = ( ( String ) st.nextElement() ).trim();
852 final int i = parseInt( size_str );
853 setBaseFontSize( i );
855 else if ( key.equals( "graphics_export_x" ) ) {
856 final String str = ( ( String ) st.nextElement() ).trim();
857 final int i = parseInt( str );
858 setGraphicsExportX( i );
860 else if ( key.equals( "graphics_export_y" ) ) {
861 final String str = ( ( String ) st.nextElement() ).trim();
862 final int i = parseInt( str );
863 setGraphicsExportY( i );
865 else if ( key.equals( "pdf_export_line_width" ) ) {
866 final String str = ( ( String ) st.nextElement() ).trim();
867 final float f = parseFloat( str );
869 setPrintLineWidth( f );
872 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
873 "value for [pdf_export_line_width] cannot be zero or negative" );
876 else if ( key.equals( "default_number_of_bootstrap_resamples" ) ) {
877 final String str = ( ( String ) st.nextElement() ).trim();
878 final int i = parseInt( str );
880 setDefaultBootstrapSamples( i );
884 .printWarningMessage( Constants.PRG_NAME,
885 "value for [default_number_of_bootstrap_resamples] cannot be negative" );
888 else if ( key.equals( "show_scale" ) ) {
889 setShowScale( parseBoolean( ( String ) st.nextElement() ) );
891 else if ( key.equals( "show_overview" ) ) {
892 setShowOverview( parseBoolean( ( String ) st.nextElement() ) );
894 else if ( key.equals( "show_branch_length_values" ) ) {
895 setShowBranchLengthValues( parseBoolean( ( String ) st.nextElement() ) );
897 else if ( key.equals( "background_gradient" ) ) {
898 setBackgroundColorGradient( parseBoolean( ( String ) st.nextElement() ) );
900 else if ( key.equals( "color_labels_same_as_branch_length_values" ) ) {
901 setColorLabelsSameAsParentBranch( parseBoolean( ( String ) st.nextElement() ) );
903 else if ( key.equals( "show_domain_labels" ) ) {
904 setShowDomainLabels( parseBoolean( ( String ) st.nextElement() ) );
906 else if ( key.equals( "abbreviate_scientific_names" ) ) {
907 setAbbreviateScientificTaxonNames( parseBoolean( ( String ) st.nextElement() ) );
909 else if ( key.equals( "cladogram_type" ) ) {
910 final String type_str = ( ( String ) st.nextElement() ).trim();
911 if ( type_str.equalsIgnoreCase( Options.CLADOGRAM_TYPE.NON_LINED_UP.toString() ) ) {
912 setCladogramType( Options.CLADOGRAM_TYPE.NON_LINED_UP );
914 else if ( type_str.equalsIgnoreCase( Options.CLADOGRAM_TYPE.EXT_NODE_SUM_DEP.toString() ) ) {
915 setCladogramType( Options.CLADOGRAM_TYPE.EXT_NODE_SUM_DEP );
917 else if ( type_str.equalsIgnoreCase( Options.CLADOGRAM_TYPE.TOTAL_NODE_SUM_DEP.toString() ) ) {
918 setCladogramType( Options.CLADOGRAM_TYPE.TOTAL_NODE_SUM_DEP );
921 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + type_str
922 + "] for [cladogram_type]" );
925 else if ( key.equals( "non_lined_up_cladogram" ) ) {
927 .printWarningMessage( Constants.PRG_NAME,
928 "configuration key [non_lined_up_cladogram] is deprecated, use [cladogram_type] instead" );
930 else if ( key.equals( "hide_controls_and_menus" ) ) {
931 _hide_controls_and_menus = parseBoolean( ( String ) st.nextElement() );
933 else if ( key.equals( "use_tabbed_display" ) ) {
934 _use_tabbed_display = parseBoolean( ( String ) st.nextElement() );
936 else if ( key.equals( "overview_width" ) ) {
937 final short i = parseShort( ( ( String ) st.nextElement() ).trim() );
940 else if ( key.equals( "overview_height" ) ) {
941 final short i = parseShort( ( ( String ) st.nextElement() ).trim() );
944 else if ( key.equals( "overview_placement_type" ) ) {
945 final String type_str = ( ( String ) st.nextElement() ).trim();
946 if ( type_str.equalsIgnoreCase( OVERVIEW_PLACEMENT_TYPE.UPPER_LEFT.toTag() ) ) {
947 setOvPlacement( OVERVIEW_PLACEMENT_TYPE.UPPER_LEFT );
949 else if ( type_str.equalsIgnoreCase( OVERVIEW_PLACEMENT_TYPE.UPPER_RIGHT.toTag() ) ) {
950 setOvPlacement( OVERVIEW_PLACEMENT_TYPE.UPPER_RIGHT );
952 else if ( type_str.equalsIgnoreCase( OVERVIEW_PLACEMENT_TYPE.LOWER_LEFT.toTag() ) ) {
953 setOvPlacement( OVERVIEW_PLACEMENT_TYPE.LOWER_LEFT );
955 else if ( type_str.equalsIgnoreCase( OVERVIEW_PLACEMENT_TYPE.LOWER_RIGHT.toTag() ) ) {
956 setOvPlacement( OVERVIEW_PLACEMENT_TYPE.LOWER_RIGHT );
959 setOvPlacement( OVERVIEW_PLACEMENT_TYPE.UPPER_LEFT );
960 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + type_str
961 + "] for [overview_placement_type]" );
964 else if ( key.equals( "node_label_direction" ) ) {
965 final String type_str = ( ( String ) st.nextElement() ).trim();
966 if ( type_str.equalsIgnoreCase( NODE_LABEL_DIRECTION.HORIZONTAL.toString() ) ) {
967 setNodeLabelDirection( NODE_LABEL_DIRECTION.HORIZONTAL );
969 else if ( type_str.equalsIgnoreCase( NODE_LABEL_DIRECTION.RADIAL.toString() ) ) {
970 setNodeLabelDirection( NODE_LABEL_DIRECTION.RADIAL );
973 setNodeLabelDirection( NODE_LABEL_DIRECTION.HORIZONTAL );
974 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + type_str
975 + "] for [node_label_direction]" );
978 else if ( key.equals( "branch_length_value_digits" ) ) {
979 final short i = parseShort( ( ( String ) st.nextElement() ).trim() );
981 setNumberOfDigitsAfterCommaForBranchLengthValue( i );
984 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "illegal value [" + i
985 + "] for [branch_length_value_digits]" );
988 else if ( key.equals( "confidence_value_digits" ) ) {
989 final short i = parseShort( ( ( String ) st.nextElement() ).trim() );
991 setNumberOfDigitsAfterCommaForConfidenceValues( i );
994 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "illegal value [" + i
995 + "] for [confidence_value_digits]" );
998 else if ( key.equals( "allow_editing" ) ) {
999 setEditable( parseBoolean( ( String ) st.nextElement() ) );
1001 else if ( key.equals( "display_sequence_relations" ) ) {
1002 setDisplaySequenceRelations( parseBoolean( ( String ) st.nextElement() ) );
1004 else if ( key.equals( "replace_underscores_in_nh_parsing" ) ) {
1005 final boolean r = parseBoolean( ( String ) st.nextElement() );
1006 if ( r && isExtractPfamTaxonomyCodesInNhParsing() ) {
1008 .printWarningMessage( Constants.PRG_NAME,
1009 "attempt to extract taxonomies and replace underscores at the same time" );
1012 setReplaceUnderscoresInNhParsing( r );
1015 else if ( key.equals( "extract_taxonomy_codes_in_nh_parsing" ) ) {
1016 final boolean e = parseBoolean( ( String ) st.nextElement() );
1017 if ( e && isReplaceUnderscoresInNhParsing() ) {
1019 .printWarningMessage( Constants.PRG_NAME,
1020 "attempt to extract taxonomies and replace underscores at the same time" );
1023 setExtractPfamTaxonomyCodesInNhParsing( e );
1026 else if ( key.equals( "internal_labels_are_confidence_values" ) ) {
1027 setInternalNumberAreConfidenceForNhParsing( parseBoolean( ( String ) st.nextElement() ) );
1029 else if ( key.equals( "gui_background_color" ) ) {
1030 _gui_background_color = Color.decode( ( String ) st.nextElement() );
1032 else if ( key.equals( "gui_checkbox_text_color" ) ) {
1033 _gui_checkbox_text_color = Color.decode( ( String ) st.nextElement() );
1035 else if ( key.equals( "gui_checkbox_and_button_active_color" ) ) {
1036 _gui_checkbox_and_button_active_color = Color.decode( ( String ) st.nextElement() );
1038 else if ( key.equals( "gui_button_text_color" ) ) {
1039 _gui_button_text_color = Color.decode( ( String ) st.nextElement() );
1041 else if ( key.equals( "gui_button_background_color" ) ) {
1042 _gui_button_background_color = Color.decode( ( String ) st.nextElement() );
1044 else if ( key.equals( "gui_menu_background_color" ) ) {
1045 _gui_menu_background_color = Color.decode( ( String ) st.nextElement() );
1047 else if ( key.equals( "gui_menu_text_color" ) ) {
1048 _gui_menu_text_color = Color.decode( ( String ) st.nextElement() );
1050 else if ( key.equals( "gui_button_border_color" ) ) {
1051 _gui_button_border_color = Color.decode( ( String ) st.nextElement() );
1053 else if ( key.equals( "domain_structure_font_color" ) ) {
1054 _domain_structure_font_color = Color.decode( ( String ) st.nextElement() );
1056 else if ( key.equals( "domain_structure_base_color" ) ) {
1057 _domain_structure_base_color = Color.decode( ( String ) st.nextElement() );
1059 else if ( st.countTokens() >= 2 ) { // counts the tokens that are not
1062 if ( key.equals( "use_real_br_lengths" ) || key.equals( "phylogram" ) ) {
1063 key_index = Configuration.display_as_phylogram;
1064 if ( key.equals( "use_real_br_lengths" ) ) {
1066 .printWarningMessage( Constants.PRG_NAME,
1067 "configuration key [use_real_br_lengths] is deprecated, use [phylogram] instead" );
1070 else if ( key.equals( "rollover" ) ) {
1071 key_index = Configuration.node_data_popup;
1073 else if ( key.equals( "color_according_to_species" ) ) {
1074 key_index = Configuration.color_according_to_species;
1076 else if ( key.equals( "show_node_names" ) ) {
1077 key_index = Configuration.show_node_names;
1079 else if ( key.equals( "show_taxonomy" ) || key.equals( "show_taxonomy_code" ) ) {
1080 key_index = Configuration.show_tax_code;
1081 if ( key.equals( "show_taxonomy" ) ) {
1083 .printWarningMessage( Constants.PRG_NAME,
1084 "configuration key [show_taxonomy] is deprecated, use [show_taxonomy_code] instead" );
1087 else if ( key.equals( "write_br_length_values" ) ) {
1088 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
1089 "configuration key [write_br_length_values] is deprecated" );
1090 key_index = DEPRECATED;
1092 else if ( key.equals( "write_bootstrap_values" ) || key.equals( "write_confidence_values" ) ) {
1093 key_index = Configuration.write_confidence_values;
1094 if ( key.equals( "write_bootstrap_values" ) ) {
1096 .printWarningMessage( Constants.PRG_NAME,
1097 "configuration key [write_bootstrap_values] is deprecated, use [write_confidence_values] instead" );
1100 else if ( key.equals( "write_events" ) || key.equals( "write_dup_spec" ) ) {
1101 key_index = Configuration.write_events;
1102 if ( key.equals( "write_dup_spec" ) ) {
1104 .printWarningMessage( Constants.PRG_NAME,
1105 "configuration key [write_dup_spec] is deprecated, use [write_events] instead" );
1108 else if ( key.equals( "color_branches" ) ) {
1109 key_index = Configuration.color_branches;
1111 else if ( key.equals( "width_branches" ) ) {
1112 key_index = Configuration.width_branches;
1114 else if ( key.equals( "color_orthologous" ) ) {
1115 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
1116 "configuration key [color_orthologous] is deprecated" );
1118 else if ( key.equals( "color_subtree_neighbors" ) ) {
1119 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
1120 "configuration key [color_subtree_neighbors] is deprecated" );
1122 else if ( key.equals( "color_super_orthologous" ) ) {
1123 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
1124 "configuration key [color_super_orthologous] is deprecated" );
1126 else if ( key.equals( "mark_nodes_with_box" ) ) {
1127 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
1128 "configuration key [mark_nodes_with_box] is deprecated" );
1129 key_index = DEPRECATED;
1131 else if ( key.equals( "show_domain_architectures" ) ) {
1132 key_index = Configuration.show_domain_architectures;
1134 else if ( key.equals( "show_annotations" ) ) {
1135 key_index = Configuration.show_annotation;
1137 else if ( key.equals( "show_binary_characters" ) ) {
1138 key_index = Configuration.show_binary_characters;
1140 else if ( key.equals( "show_binary_character_counts" ) ) {
1141 key_index = Configuration.show_binary_character_counts;
1143 else if ( key.equals( "show_gene_names" ) ) {
1144 key_index = Configuration.show_gene_names;
1146 else if ( key.equals( "show_gene_symbols" ) ) {
1147 key_index = Configuration.show_gene_symbols;
1149 else if ( key.equals( "show_sequence_acc" ) ) {
1150 key_index = Configuration.show_sequence_acc;
1152 else if ( key.equals( "show_node_ids" ) ) {
1154 .printWarningMessage( Constants.PRG_NAME, "configuration key [show_node_ids] is deprecated" );
1155 key_index = DEPRECATED;
1157 else if ( key.equals( "display_internal_data" ) ) {
1158 key_index = Configuration.display_internal_data;
1160 else if ( key.equals( "dynamically_hide_data" ) ) {
1161 key_index = Configuration.dynamically_hide_data;
1163 else if ( key.equals( "show_taxonomy_names" ) ) {
1164 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
1165 "configuration key [show_taxonomy_names] is deprecated" );
1166 key_index = DEPRECATED;
1168 else if ( key.equals( "show_taxonomy_scientific_names" ) ) {
1169 key_index = Configuration.show_taxonomy_scientific_names;
1171 else if ( key.equals( "show_taxonomy_common_names" ) ) {
1172 key_index = Configuration.show_taxonomy_common_names;
1174 else if ( key.equals( "show_taxonomy_images" ) ) {
1175 key_index = Configuration.show_taxonomy_images;
1177 else if ( key.equals( "color_according_to_annotation" ) ) {
1178 key_index = Configuration.color_according_to_annotation;
1180 else if ( key.equals( "show_property" ) ) {
1181 key_index = Configuration.show_property;
1183 else if ( key.equals( "show_vector_data" ) ) {
1184 key_index = Configuration.show_vector_data;
1186 else if ( key.equals( "show_relation_confidence" ) ) {
1187 key_index = Configuration.show_relation_confidence;
1189 // If we've found the key, set the values
1190 if ( key_index >= 0 ) {
1191 display_options[ key_index ][ 1 ] = ( String ) st.nextElement();
1192 display_options[ key_index ][ 2 ] = ( String ) st.nextElement();
1193 // otherwise, keep looking
1196 if ( key_index == DEPRECATED ) {
1199 else if ( key.equals( "click_to" ) ) {
1200 final String click_to_name = ( String ) st.nextElement();
1201 key_index = getClickToIndex( click_to_name );
1202 if ( key_index >= 0 ) {
1203 clickto_options[ key_index ][ 1 ] = ( String ) st.nextElement();
1205 else if ( key_index == DEPRECATED ) {
1209 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown click-to option: "
1213 else if ( key.equals( "species_color" ) ) {
1214 getSpeciesColors().put( ( String ) st.nextElement(), Color.decode( ( String ) st.nextElement() ) );
1216 else if ( key.equals( "domain_color" ) ) {
1217 getDomainColors().put( ( String ) st.nextElement(), Color.decode( ( String ) st.nextElement() ) );
1219 else if ( key.equals( "annotation_color" ) ) {
1220 getAnnotationColors()
1221 .put( ( String ) st.nextElement(), Color.decode( ( String ) st.nextElement() ) );
1223 else if ( key.equals( "function_color" ) ) {
1224 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
1225 "configuration key [function_color] is deprecated" );
1227 else if ( key.equals( DISPLAY_COLOR_KEY ) ) {
1228 getDisplayColors().put( ( String ) st.nextElement(), Color.decode( ( String ) st.nextElement() ) );
1230 else if ( key.equals( WEB_LINK_KEY ) ) {
1231 if ( st.countTokens() == 3 ) {
1232 createWebLink( ( String ) st.nextElement(),
1233 ( String ) st.nextElement(),
1234 ( String ) st.nextElement() );
1237 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
1238 "illegal format in configuration file for key [" + key + "]" );
1242 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown configuration key [" + key
1243 + "] in: " + config_filename );
1248 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown configuration key [" + key + "] in: "
1249 + config_filename );
1253 private void setMinConfidenceValue( final double min_confidence_value ) {
1254 _min_confidence_value = min_confidence_value;
1257 void setNodeLabelDirection( final NODE_LABEL_DIRECTION node_label_direction ) {
1258 _node_label_direction = node_label_direction;
1261 private void setNumberOfDigitsAfterCommaForBranchLengthValue( final short _number_of_digits_after_comma_for_branch_length_values ) {
1262 this._number_of_digits_after_comma_for_branch_length_values = _number_of_digits_after_comma_for_branch_length_values;
1265 private void setNumberOfDigitsAfterCommaForConfidenceValues( final short _number_of_digits_after_comma_for_confidence_values ) {
1266 this._number_of_digits_after_comma_for_confidence_values = _number_of_digits_after_comma_for_confidence_values;
1269 private void setOvMaxHeight( final short ov_max_height ) {
1270 _ov_max_height = ov_max_height;
1273 private void setOvMaxWidth( final short ov_max_width ) {
1274 _ov_max_width = ov_max_width;
1277 private void setOvPlacement( final OVERVIEW_PLACEMENT_TYPE ov_placement ) {
1278 _ov_placement = ov_placement;
1281 void setPhylogenyGraphicsType( final PHYLOGENY_GRAPHICS_TYPE phylogeny_graphics_type ) {
1282 _phylogeny_graphics_type = phylogeny_graphics_type;
1285 private void setPrintLineWidth( final float print_line_width ) {
1286 _print_line_width = print_line_width;
1289 private void setReplaceUnderscoresInNhParsing( final boolean nh_parsing_replace_underscores ) {
1290 _nh_parsing_replace_underscores = nh_parsing_replace_underscores;
1293 private void setShowBranchLengthValues( final boolean show_branch_length_values ) {
1294 _show_branch_length_values = show_branch_length_values;
1297 private void setShowOverview( final boolean show_overview ) {
1298 _show_overview = show_overview;
1301 private void setShowScale( final boolean show_scale ) {
1302 _show_scale = show_scale;
1305 private void setValidatePhyloXmlAgainstSchema( final boolean validate_against_phyloxml_xsd_schema ) {
1306 _validate_against_phyloxml_xsd_schema = validate_against_phyloxml_xsd_schema;
1309 void setWebLinks( final SortedMap<String, WebLink> weblinks ) {
1310 _weblinks = weblinks;
1313 static String getDefaultFontFamilyName() {
1314 return DEFAULT_FONT_FAMILY;
1317 static enum TRIPLET {
1318 TRUE, FALSE, UNKNOWN
1321 public Color getDomainStructureFontColor() {
1322 return _domain_structure_font_color;
1325 public Color getDomainStructureBaseColor() {
1326 return _domain_structure_base_color;
1329 public boolean isColorLabelsSameAsParentBranch() {
1330 return _color_labels_same_as_parent_branch;
1333 public boolean isShowDomainLabels() {
1334 return _show_domain_labels;
1337 public boolean isAbbreviateScientificTaxonNames() {
1338 return _abbreviate_scientific_names;