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, SYSTEM, 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 ) {
589 if ( Util.isMac() && Util.isJava15() ) {
593 return _ui == UI.NATIVE;
597 * Only used by ArchaeoptryxE.
600 boolean isUseTabbedDisplay() {
601 return _use_tabbed_display;
604 boolean isValidatePhyloXmlAgainstSchema() {
605 return _validate_against_phyloxml_xsd_schema;
608 private boolean parseBoolean( final String str ) {
609 final String my_str = str.trim().toLowerCase();
610 if ( my_str.equals( "yes" ) || my_str.equals( "true" ) ) {
613 else if ( my_str.equals( "no" ) || my_str.equals( "false" ) ) {
617 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse boolean value from [" + str + "]" );
622 private double parseDouble( final String str ) {
625 d = Double.parseDouble( str );
627 catch ( final Exception e ) {
628 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse double from [" + str + "]" );
634 private float parseFloat( final String str ) {
637 f = Float.parseFloat( str );
639 catch ( final Exception e ) {
640 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse float from [" + str + "]" );
646 private int parseInt( final String str ) {
649 i = Integer.parseInt( str );
651 catch ( final Exception e ) {
652 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse integer from [" + str + "]" );
658 private short parseShort( final String str ) {
661 i = Short.parseShort( str );
663 catch ( final Exception e ) {
664 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse short from [" + str + "]" );
670 private void processFontFamily( final StringTokenizer st ) {
671 setBaseFontFamilyName( "" );
672 final String font_str = ( ( String ) st.nextElement() ).trim();
673 final String[] fonts = font_str.split( ",+" );
674 for( String font : fonts ) {
675 font = font.replace( '_', ' ' ).trim();
676 if ( Arrays.binarySearch( Util.getAvailableFontFamiliesSorted(), font ) >= 0 ) {
677 setBaseFontFamilyName( font );
684 * read each line of config file, process non-comment lines
685 * @throws IOException
687 private void readConfig( final BufferedReader conf_in ) throws IOException {
690 line = conf_in.readLine();
691 if ( line != null ) {
693 // skip comments and blank lines
694 if ( !line.startsWith( "#" ) && ( !ForesterUtil.isEmpty( line ) ) ) {
695 // convert runs of spaces to tabs
696 line = line.replaceAll( "\\s+", "\t" );
697 final StringTokenizer st = new StringTokenizer( line, "\t" );
701 } while ( line != null );
704 private void setAntialiasScreen( final boolean antialias_screen ) {
705 _antialias_screen = antialias_screen;
708 public void setBackgroundColorGradient( final boolean background_color_gradient ) {
709 _background_color_gradient = background_color_gradient;
712 private void setBaseFontFamilyName( final String base_font_family_name ) {
713 _base_font_family_name = base_font_family_name;
716 private void setBaseFontSize( final int base_font_size ) {
717 _base_font_size = base_font_size;
720 private void setShowDomainLabels( final boolean show_domain_labels ) {
721 _show_domain_labels = show_domain_labels;
724 private void setAbbreviateScientificTaxonNames( final boolean abbreviate_scientific_names ) {
725 _abbreviate_scientific_names = abbreviate_scientific_names;
728 private void setColorLabelsSameAsParentBranch( final boolean color_labels_same_as_parent_branch ) {
729 _color_labels_same_as_parent_branch = color_labels_same_as_parent_branch;
732 private void setCladogramType( final CLADOGRAM_TYPE cladogram_type ) {
733 _cladogram_type = cladogram_type;
736 void setDisplayColors( final SortedMap<String, Color> display_colors ) {
737 _display_colors = display_colors;
740 private void setDisplaySequenceRelations( final boolean display_sequence_relations ) {
741 _display_sequence_relations = display_sequence_relations;
744 private void setEditable( final boolean editable ) {
745 _editable = editable;
748 private void setExtractPfamTaxonomyCodesInNhParsing( final boolean nh_parsing_extract_pfam_taxonomy_codes ) {
749 _nh_parsing_extract_pfam_taxonomy_codes = nh_parsing_extract_pfam_taxonomy_codes;
752 private void setGraphicsExportX( final int graphics_export_x ) {
753 _graphics_export_x = graphics_export_x;
756 private void setGraphicsExportY( final int graphics_export_y ) {
757 _graphics_export_y = graphics_export_y;
760 private void setDefaultBootstrapSamples( final int default_bootstrap_samples ) {
761 _default_bootstrap_samples = default_bootstrap_samples;
764 private void setInternalNumberAreConfidenceForNhParsing( final boolean internal_number_are_confidence_for_nh_parsing ) {
765 _internal_number_are_confidence_for_nh_parsing = internal_number_are_confidence_for_nh_parsing;
769 * Set a key-value(s) tuple
771 private void setKeyValue( final StringTokenizer st ) {
772 String key = ( String ) st.nextElement();
773 key = key.replace( ':', ' ' );
775 key = key.toLowerCase();
776 // Handle single value settings first:
777 if ( key.equals( "default_click_to" ) ) {
778 final String clickto_name = ( String ) st.nextElement();
779 default_clickto = getClickToIndex( clickto_name );
780 if ( default_clickto == -1 ) {
781 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "invalid value [" + clickto_name
782 + "] for [default_click_to]" );
785 else if ( default_clickto == DEPRECATED ) {
789 else if ( key.equals( "native_ui" ) ) {
790 final String my_str = ( ( String ) st.nextElement() ).trim().toLowerCase();
791 if ( my_str.equals( "yes" ) || my_str.equals( "true" ) ) {
794 else if ( my_str.equals( "no" ) || my_str.equals( "false" ) ) {
797 else if ( my_str.equals( "?" ) ) {
801 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse yes/no/? value from [" + my_str
806 else if ( key.equals( VALIDATE_AGAINST_PHYLOXML_XSD_SCHEMA ) ) {
807 setValidatePhyloXmlAgainstSchema( parseBoolean( ( String ) st.nextElement() ) );
809 else if ( key.equals( "antialias_screen" ) ) {
810 setAntialiasScreen( parseBoolean( ( String ) st.nextElement() ) );
812 else if ( key.equals( "phylogeny_graphics_type" ) ) {
813 final String type_str = ( ( String ) st.nextElement() ).trim();
814 if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.CONVEX.toString() ) ) {
815 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.CONVEX );
817 else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.CURVED.toString() ) ) {
818 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.CURVED );
820 else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.EURO_STYLE.toString() ) ) {
821 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.EURO_STYLE );
823 else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.ROUNDED.toString() ) ) {
824 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.ROUNDED );
826 else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR.toString() ) ) {
827 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR );
829 else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.TRIANGULAR.toString() ) ) {
830 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.TRIANGULAR );
832 else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.UNROOTED.toString() ) ) {
833 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.UNROOTED );
835 else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.CIRCULAR.toString() ) ) {
836 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.CIRCULAR );
839 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR );
840 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + type_str
841 + "] for [phylogeny_graphics_type]" );
844 else if ( key.equals( "min_confidence_value" ) ) {
845 final String mcv_str = ( ( String ) st.nextElement() ).trim();
846 final double d = parseDouble( mcv_str );
847 setMinConfidenceValue( d );
849 else if ( key.equals( "font_family" ) ) {
850 processFontFamily( st );
852 else if ( key.equals( "font_size" ) ) {
853 final String size_str = ( ( String ) st.nextElement() ).trim();
854 final int i = parseInt( size_str );
855 setBaseFontSize( i );
857 else if ( key.equals( "graphics_export_x" ) ) {
858 final String str = ( ( String ) st.nextElement() ).trim();
859 final int i = parseInt( str );
860 setGraphicsExportX( i );
862 else if ( key.equals( "graphics_export_y" ) ) {
863 final String str = ( ( String ) st.nextElement() ).trim();
864 final int i = parseInt( str );
865 setGraphicsExportY( i );
867 else if ( key.equals( "pdf_export_line_width" ) ) {
868 final String str = ( ( String ) st.nextElement() ).trim();
869 final float f = parseFloat( str );
871 setPrintLineWidth( f );
874 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
875 "value for [pdf_export_line_width] cannot be zero or negative" );
878 else if ( key.equals( "default_number_of_bootstrap_resamples" ) ) {
879 final String str = ( ( String ) st.nextElement() ).trim();
880 final int i = parseInt( str );
882 setDefaultBootstrapSamples( i );
886 .printWarningMessage( Constants.PRG_NAME,
887 "value for [default_number_of_bootstrap_resamples] cannot be negative" );
890 else if ( key.equals( "show_scale" ) ) {
891 setShowScale( parseBoolean( ( String ) st.nextElement() ) );
893 else if ( key.equals( "show_overview" ) ) {
894 setShowOverview( parseBoolean( ( String ) st.nextElement() ) );
896 else if ( key.equals( "show_branch_length_values" ) ) {
897 setShowBranchLengthValues( parseBoolean( ( String ) st.nextElement() ) );
899 else if ( key.equals( "background_gradient" ) ) {
900 setBackgroundColorGradient( parseBoolean( ( String ) st.nextElement() ) );
902 else if ( key.equals( "color_labels_same_as_branch_length_values" ) ) {
903 setColorLabelsSameAsParentBranch( parseBoolean( ( String ) st.nextElement() ) );
905 else if ( key.equals( "show_domain_labels" ) ) {
906 setShowDomainLabels( parseBoolean( ( String ) st.nextElement() ) );
908 else if ( key.equals( "abbreviate_scientific_names" ) ) {
909 setAbbreviateScientificTaxonNames( parseBoolean( ( String ) st.nextElement() ) );
911 else if ( key.equals( "cladogram_type" ) ) {
912 final String type_str = ( ( String ) st.nextElement() ).trim();
913 if ( type_str.equalsIgnoreCase( Options.CLADOGRAM_TYPE.NON_LINED_UP.toString() ) ) {
914 setCladogramType( Options.CLADOGRAM_TYPE.NON_LINED_UP );
916 else if ( type_str.equalsIgnoreCase( Options.CLADOGRAM_TYPE.EXT_NODE_SUM_DEP.toString() ) ) {
917 setCladogramType( Options.CLADOGRAM_TYPE.EXT_NODE_SUM_DEP );
919 else if ( type_str.equalsIgnoreCase( Options.CLADOGRAM_TYPE.TOTAL_NODE_SUM_DEP.toString() ) ) {
920 setCladogramType( Options.CLADOGRAM_TYPE.TOTAL_NODE_SUM_DEP );
923 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + type_str
924 + "] for [cladogram_type]" );
927 else if ( key.equals( "non_lined_up_cladogram" ) ) {
929 .printWarningMessage( Constants.PRG_NAME,
930 "configuration key [non_lined_up_cladogram] is deprecated, use [cladogram_type] instead" );
932 else if ( key.equals( "hide_controls_and_menus" ) ) {
933 _hide_controls_and_menus = parseBoolean( ( String ) st.nextElement() );
935 else if ( key.equals( "use_tabbed_display" ) ) {
936 _use_tabbed_display = parseBoolean( ( String ) st.nextElement() );
938 else if ( key.equals( "overview_width" ) ) {
939 final short i = parseShort( ( ( String ) st.nextElement() ).trim() );
942 else if ( key.equals( "overview_height" ) ) {
943 final short i = parseShort( ( ( String ) st.nextElement() ).trim() );
946 else if ( key.equals( "overview_placement_type" ) ) {
947 final String type_str = ( ( String ) st.nextElement() ).trim();
948 if ( type_str.equalsIgnoreCase( OVERVIEW_PLACEMENT_TYPE.UPPER_LEFT.toTag() ) ) {
949 setOvPlacement( OVERVIEW_PLACEMENT_TYPE.UPPER_LEFT );
951 else if ( type_str.equalsIgnoreCase( OVERVIEW_PLACEMENT_TYPE.UPPER_RIGHT.toTag() ) ) {
952 setOvPlacement( OVERVIEW_PLACEMENT_TYPE.UPPER_RIGHT );
954 else if ( type_str.equalsIgnoreCase( OVERVIEW_PLACEMENT_TYPE.LOWER_LEFT.toTag() ) ) {
955 setOvPlacement( OVERVIEW_PLACEMENT_TYPE.LOWER_LEFT );
957 else if ( type_str.equalsIgnoreCase( OVERVIEW_PLACEMENT_TYPE.LOWER_RIGHT.toTag() ) ) {
958 setOvPlacement( OVERVIEW_PLACEMENT_TYPE.LOWER_RIGHT );
961 setOvPlacement( OVERVIEW_PLACEMENT_TYPE.UPPER_LEFT );
962 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + type_str
963 + "] for [overview_placement_type]" );
966 else if ( key.equals( "node_label_direction" ) ) {
967 final String type_str = ( ( String ) st.nextElement() ).trim();
968 if ( type_str.equalsIgnoreCase( NODE_LABEL_DIRECTION.HORIZONTAL.toString() ) ) {
969 setNodeLabelDirection( NODE_LABEL_DIRECTION.HORIZONTAL );
971 else if ( type_str.equalsIgnoreCase( NODE_LABEL_DIRECTION.RADIAL.toString() ) ) {
972 setNodeLabelDirection( NODE_LABEL_DIRECTION.RADIAL );
975 setNodeLabelDirection( NODE_LABEL_DIRECTION.HORIZONTAL );
976 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + type_str
977 + "] for [node_label_direction]" );
980 else if ( key.equals( "branch_length_value_digits" ) ) {
981 final short i = parseShort( ( ( String ) st.nextElement() ).trim() );
983 setNumberOfDigitsAfterCommaForBranchLengthValue( i );
986 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "illegal value [" + i
987 + "] for [branch_length_value_digits]" );
990 else if ( key.equals( "confidence_value_digits" ) ) {
991 final short i = parseShort( ( ( String ) st.nextElement() ).trim() );
993 setNumberOfDigitsAfterCommaForConfidenceValues( i );
996 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "illegal value [" + i
997 + "] for [confidence_value_digits]" );
1000 else if ( key.equals( "allow_editing" ) ) {
1001 setEditable( parseBoolean( ( String ) st.nextElement() ) );
1003 else if ( key.equals( "display_sequence_relations" ) ) {
1004 setDisplaySequenceRelations( parseBoolean( ( String ) st.nextElement() ) );
1006 else if ( key.equals( "replace_underscores_in_nh_parsing" ) ) {
1007 final boolean r = parseBoolean( ( String ) st.nextElement() );
1008 if ( r && isExtractPfamTaxonomyCodesInNhParsing() ) {
1010 .printWarningMessage( Constants.PRG_NAME,
1011 "attempt to extract taxonomies and replace underscores at the same time" );
1014 setReplaceUnderscoresInNhParsing( r );
1017 else if ( key.equals( "extract_taxonomy_codes_in_nh_parsing" ) ) {
1018 final boolean e = parseBoolean( ( String ) st.nextElement() );
1019 if ( e && isReplaceUnderscoresInNhParsing() ) {
1021 .printWarningMessage( Constants.PRG_NAME,
1022 "attempt to extract taxonomies and replace underscores at the same time" );
1025 setExtractPfamTaxonomyCodesInNhParsing( e );
1028 else if ( key.equals( "internal_labels_are_confidence_values" ) ) {
1029 setInternalNumberAreConfidenceForNhParsing( parseBoolean( ( String ) st.nextElement() ) );
1031 else if ( key.equals( "gui_background_color" ) ) {
1032 _gui_background_color = Color.decode( ( String ) st.nextElement() );
1034 else if ( key.equals( "gui_checkbox_text_color" ) ) {
1035 _gui_checkbox_text_color = Color.decode( ( String ) st.nextElement() );
1037 else if ( key.equals( "gui_checkbox_and_button_active_color" ) ) {
1038 _gui_checkbox_and_button_active_color = Color.decode( ( String ) st.nextElement() );
1040 else if ( key.equals( "gui_button_text_color" ) ) {
1041 _gui_button_text_color = Color.decode( ( String ) st.nextElement() );
1043 else if ( key.equals( "gui_button_background_color" ) ) {
1044 _gui_button_background_color = Color.decode( ( String ) st.nextElement() );
1046 else if ( key.equals( "gui_menu_background_color" ) ) {
1047 _gui_menu_background_color = Color.decode( ( String ) st.nextElement() );
1049 else if ( key.equals( "gui_menu_text_color" ) ) {
1050 _gui_menu_text_color = Color.decode( ( String ) st.nextElement() );
1052 else if ( key.equals( "gui_button_border_color" ) ) {
1053 _gui_button_border_color = Color.decode( ( String ) st.nextElement() );
1055 else if ( key.equals( "domain_structure_font_color" ) ) {
1056 _domain_structure_font_color = Color.decode( ( String ) st.nextElement() );
1058 else if ( key.equals( "domain_structure_base_color" ) ) {
1059 _domain_structure_base_color = Color.decode( ( String ) st.nextElement() );
1061 else if ( st.countTokens() >= 2 ) { // counts the tokens that are not
1064 if ( key.equals( "use_real_br_lengths" ) || key.equals( "phylogram" ) ) {
1065 key_index = Configuration.display_as_phylogram;
1066 if ( key.equals( "use_real_br_lengths" ) ) {
1068 .printWarningMessage( Constants.PRG_NAME,
1069 "configuration key [use_real_br_lengths] is deprecated, use [phylogram] instead" );
1072 else if ( key.equals( "rollover" ) ) {
1073 key_index = Configuration.node_data_popup;
1075 else if ( key.equals( "color_according_to_species" ) ) {
1076 key_index = Configuration.color_according_to_species;
1078 else if ( key.equals( "show_node_names" ) ) {
1079 key_index = Configuration.show_node_names;
1081 else if ( key.equals( "show_taxonomy" ) || key.equals( "show_taxonomy_code" ) ) {
1082 key_index = Configuration.show_tax_code;
1083 if ( key.equals( "show_taxonomy" ) ) {
1085 .printWarningMessage( Constants.PRG_NAME,
1086 "configuration key [show_taxonomy] is deprecated, use [show_taxonomy_code] instead" );
1089 else if ( key.equals( "write_br_length_values" ) ) {
1090 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
1091 "configuration key [write_br_length_values] is deprecated" );
1092 key_index = DEPRECATED;
1094 else if ( key.equals( "write_bootstrap_values" ) || key.equals( "write_confidence_values" ) ) {
1095 key_index = Configuration.write_confidence_values;
1096 if ( key.equals( "write_bootstrap_values" ) ) {
1098 .printWarningMessage( Constants.PRG_NAME,
1099 "configuration key [write_bootstrap_values] is deprecated, use [write_confidence_values] instead" );
1102 else if ( key.equals( "write_events" ) || key.equals( "write_dup_spec" ) ) {
1103 key_index = Configuration.write_events;
1104 if ( key.equals( "write_dup_spec" ) ) {
1106 .printWarningMessage( Constants.PRG_NAME,
1107 "configuration key [write_dup_spec] is deprecated, use [write_events] instead" );
1110 else if ( key.equals( "color_branches" ) ) {
1111 key_index = Configuration.color_branches;
1113 else if ( key.equals( "width_branches" ) ) {
1114 key_index = Configuration.width_branches;
1116 else if ( key.equals( "color_orthologous" ) ) {
1117 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
1118 "configuration key [color_orthologous] is deprecated" );
1120 else if ( key.equals( "color_subtree_neighbors" ) ) {
1121 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
1122 "configuration key [color_subtree_neighbors] is deprecated" );
1124 else if ( key.equals( "color_super_orthologous" ) ) {
1125 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
1126 "configuration key [color_super_orthologous] is deprecated" );
1128 else if ( key.equals( "mark_nodes_with_box" ) ) {
1129 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
1130 "configuration key [mark_nodes_with_box] is deprecated" );
1131 key_index = DEPRECATED;
1133 else if ( key.equals( "show_domain_architectures" ) ) {
1134 key_index = Configuration.show_domain_architectures;
1136 else if ( key.equals( "show_annotations" ) ) {
1137 key_index = Configuration.show_annotation;
1139 else if ( key.equals( "show_binary_characters" ) ) {
1140 key_index = Configuration.show_binary_characters;
1142 else if ( key.equals( "show_binary_character_counts" ) ) {
1143 key_index = Configuration.show_binary_character_counts;
1145 else if ( key.equals( "show_gene_names" ) ) {
1146 key_index = Configuration.show_gene_names;
1148 else if ( key.equals( "show_gene_symbols" ) ) {
1149 key_index = Configuration.show_gene_symbols;
1151 else if ( key.equals( "show_sequence_acc" ) ) {
1152 key_index = Configuration.show_sequence_acc;
1154 else if ( key.equals( "show_node_ids" ) ) {
1156 .printWarningMessage( Constants.PRG_NAME, "configuration key [show_node_ids] is deprecated" );
1157 key_index = DEPRECATED;
1159 else if ( key.equals( "display_internal_data" ) ) {
1160 key_index = Configuration.display_internal_data;
1162 else if ( key.equals( "dynamically_hide_data" ) ) {
1163 key_index = Configuration.dynamically_hide_data;
1165 else if ( key.equals( "show_taxonomy_names" ) ) {
1166 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
1167 "configuration key [show_taxonomy_names] is deprecated" );
1168 key_index = DEPRECATED;
1170 else if ( key.equals( "show_taxonomy_scientific_names" ) ) {
1171 key_index = Configuration.show_taxonomy_scientific_names;
1173 else if ( key.equals( "show_taxonomy_common_names" ) ) {
1174 key_index = Configuration.show_taxonomy_common_names;
1176 else if ( key.equals( "show_taxonomy_images" ) ) {
1177 key_index = Configuration.show_taxonomy_images;
1179 else if ( key.equals( "color_according_to_annotation" ) ) {
1180 key_index = Configuration.color_according_to_annotation;
1182 else if ( key.equals( "show_property" ) ) {
1183 key_index = Configuration.show_property;
1185 else if ( key.equals( "show_vector_data" ) ) {
1186 key_index = Configuration.show_vector_data;
1188 else if ( key.equals( "show_relation_confidence" ) ) {
1189 key_index = Configuration.show_relation_confidence;
1191 // If we've found the key, set the values
1192 if ( key_index >= 0 ) {
1193 display_options[ key_index ][ 1 ] = ( String ) st.nextElement();
1194 display_options[ key_index ][ 2 ] = ( String ) st.nextElement();
1195 // otherwise, keep looking
1198 if ( key_index == DEPRECATED ) {
1201 else if ( key.equals( "click_to" ) ) {
1202 final String click_to_name = ( String ) st.nextElement();
1203 key_index = getClickToIndex( click_to_name );
1204 if ( key_index >= 0 ) {
1205 clickto_options[ key_index ][ 1 ] = ( String ) st.nextElement();
1207 else if ( key_index == DEPRECATED ) {
1211 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown click-to option: "
1215 else if ( key.equals( "species_color" ) ) {
1216 getSpeciesColors().put( ( String ) st.nextElement(), Color.decode( ( String ) st.nextElement() ) );
1218 else if ( key.equals( "domain_color" ) ) {
1219 getDomainColors().put( ( String ) st.nextElement(), Color.decode( ( String ) st.nextElement() ) );
1221 else if ( key.equals( "annotation_color" ) ) {
1222 getAnnotationColors()
1223 .put( ( String ) st.nextElement(), Color.decode( ( String ) st.nextElement() ) );
1225 else if ( key.equals( "function_color" ) ) {
1226 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
1227 "configuration key [function_color] is deprecated" );
1229 else if ( key.equals( DISPLAY_COLOR_KEY ) ) {
1230 getDisplayColors().put( ( String ) st.nextElement(), Color.decode( ( String ) st.nextElement() ) );
1232 else if ( key.equals( WEB_LINK_KEY ) ) {
1233 if ( st.countTokens() == 3 ) {
1234 createWebLink( ( String ) st.nextElement(),
1235 ( String ) st.nextElement(),
1236 ( String ) st.nextElement() );
1239 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
1240 "illegal format in configuration file for key [" + key + "]" );
1244 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown configuration key [" + key
1245 + "] in: " + config_filename );
1250 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown configuration key [" + key + "] in: "
1251 + config_filename );
1255 private void setMinConfidenceValue( final double min_confidence_value ) {
1256 _min_confidence_value = min_confidence_value;
1259 void setNodeLabelDirection( final NODE_LABEL_DIRECTION node_label_direction ) {
1260 _node_label_direction = node_label_direction;
1263 private void setNumberOfDigitsAfterCommaForBranchLengthValue( final short _number_of_digits_after_comma_for_branch_length_values ) {
1264 this._number_of_digits_after_comma_for_branch_length_values = _number_of_digits_after_comma_for_branch_length_values;
1267 private void setNumberOfDigitsAfterCommaForConfidenceValues( final short _number_of_digits_after_comma_for_confidence_values ) {
1268 this._number_of_digits_after_comma_for_confidence_values = _number_of_digits_after_comma_for_confidence_values;
1271 private void setOvMaxHeight( final short ov_max_height ) {
1272 _ov_max_height = ov_max_height;
1275 private void setOvMaxWidth( final short ov_max_width ) {
1276 _ov_max_width = ov_max_width;
1279 private void setOvPlacement( final OVERVIEW_PLACEMENT_TYPE ov_placement ) {
1280 _ov_placement = ov_placement;
1283 void setPhylogenyGraphicsType( final PHYLOGENY_GRAPHICS_TYPE phylogeny_graphics_type ) {
1284 _phylogeny_graphics_type = phylogeny_graphics_type;
1287 private void setPrintLineWidth( final float print_line_width ) {
1288 _print_line_width = print_line_width;
1291 private void setReplaceUnderscoresInNhParsing( final boolean nh_parsing_replace_underscores ) {
1292 _nh_parsing_replace_underscores = nh_parsing_replace_underscores;
1295 private void setShowBranchLengthValues( final boolean show_branch_length_values ) {
1296 _show_branch_length_values = show_branch_length_values;
1299 private void setShowOverview( final boolean show_overview ) {
1300 _show_overview = show_overview;
1303 private void setShowScale( final boolean show_scale ) {
1304 _show_scale = show_scale;
1307 private void setValidatePhyloXmlAgainstSchema( final boolean validate_against_phyloxml_xsd_schema ) {
1308 _validate_against_phyloxml_xsd_schema = validate_against_phyloxml_xsd_schema;
1311 void setWebLinks( final SortedMap<String, WebLink> weblinks ) {
1312 _weblinks = weblinks;
1315 static String getDefaultFontFamilyName() {
1316 return DEFAULT_FONT_FAMILY;
1319 static enum TRIPLET {
1320 TRUE, FALSE, UNKNOWN
1323 public Color getDomainStructureFontColor() {
1324 return _domain_structure_font_color;
1327 public Color getDomainStructureBaseColor() {
1328 return _domain_structure_base_color;
1331 public boolean isColorLabelsSameAsParentBranch() {
1332 return _color_labels_same_as_parent_branch;
1335 public boolean isShowDomainLabels() {
1336 return _show_domain_labels;
1339 public boolean isAbbreviateScientificTaxonNames() {
1340 return _abbreviate_scientific_names;