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 {
54 static final String VALIDATE_AGAINST_PHYLOXML_XSD_SCHEMA = "validate_against_phyloxml_xsd_schema";
55 private static final String WEB_LINK_KEY = "web_link";
56 private static final String DISPLAY_COLOR_KEY = "display_color";
57 private static final int DEPRECATED = -2;
58 private TRIPLET _native_ui = TRIPLET.FALSE;
59 private boolean _use_tabbed_display = false;
60 private boolean _hide_controls_and_menus = false;
61 private CLADOGRAM_TYPE _cladogram_type = Constants.CLADOGRAM_TYPE_DEFAULT;
62 private SortedMap<String, WebLink> _weblinks = null;
63 private SortedMap<String, Color> _display_colors = null;
64 private boolean _antialias_screen = true;
65 private PHYLOGENY_GRAPHICS_TYPE _phylogeny_graphics_type = PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR;
66 private String _base_font_family_name = "";
67 private int _base_font_size = -1;
68 private int _graphics_export_x = -1;
69 private int _graphics_export_y = -1;
70 private short _ov_max_width = 80;
71 private short _ov_max_height = 80;
72 private OVERVIEW_PLACEMENT_TYPE _ov_placement = OVERVIEW_PLACEMENT_TYPE.UPPER_LEFT;
73 private double _min_confidence_value = Options.MIN_CONFIDENCE_DEFAULT;
74 private float _print_line_width = Constants.PDF_LINE_WIDTH_DEFAULT;
75 private boolean _show_scale = false;
76 private boolean _show_branch_length_values = false;
77 private boolean _show_overview = true;
78 private short _number_of_digits_after_comma_for_confidence_values = Constants.NUMBER_OF_DIGITS_AFTER_COMMA_FOR_CONFIDENCE_VALUES_DEFAULT;
79 private short _number_of_digits_after_comma_for_branch_length_values = Constants.NUMBER_OF_DIGITS_AFTER_COMMA_FOR_BRANCH_LENGTH_VALUES_DEFAULT;
80 private boolean _editable = true;
81 private boolean _nh_parsing_replace_underscores = false;
82 private boolean _nh_parsing_extract_pfam_taxonomy_codes = false;
83 private boolean _internal_number_are_confidence_for_nh_parsing = false;
84 private boolean _display_sequence_relations = false;
85 private boolean _validate_against_phyloxml_xsd_schema = Constants.VALIDATE_AGAINST_PHYLOXML_XSD_SCJEMA_DEFAULT;
86 private boolean _background_color_gradient = false;
87 private boolean _show_domain_labels = true;
88 private boolean _abbreviate_scientific_names = false;
89 private boolean _color_labels_same_as_parent_branch = false;
90 private int _default_bootstrap_samples = -1;
91 final static int display_as_phylogram = 0;
92 final static int show_node_names = 1;
93 final static int show_tax_code = 2;
94 final static int show_annotation = 3;
95 final static int write_confidence_values = 4;
96 final static int write_events = 5;
97 final static int color_according_to_species = 6;
98 final static int color_branches = 7;
99 final static int width_branches = 8;
100 final static int show_domain_architectures = 9;
101 final static int show_binary_characters = 10;
102 final static int show_binary_character_counts = 11;
103 final static int show_gene_names = 12;
104 final static int show_sequence_acc = 13;
105 final static int display_internal_data = 14;
106 final static int dynamically_hide_data = 15;
107 final static int show_taxonomy_scientific_names = 16;
108 final static int show_taxonomy_common_names = 17;
109 final static int color_according_to_annotation = 18;
110 final static int show_property = 19;
111 final static int show_gene_symbols = 20;
112 final static int node_data_popup = 21;
113 final static int show_relation_confidence = 22;
114 final static int show_vector_data = 23;
115 final static int show_taxonomy_images = 24;
116 // ------------------
118 // ------------------
119 final static int display_node_data = 0;
120 final static int collapse_uncollapse = 1;
121 final static int reroot = 2;
122 final static int subtree = 3;
123 final static int swap = 4;
124 final static int color_subtree = 5;
125 final static int open_seq_web = 6;
126 final static int open_tax_web = 7;
127 final static int cut_subtree = 8;
128 final static int copy_subtree = 9;
129 final static int paste_subtree = 10;
130 final static int delete_subtree_or_node = 11;
131 final static int add_new_node = 12;
132 final static int edit_node_data = 13;
133 final static int blast = 14;
134 // ---------------------------
135 // Display options for trees
136 // ---------------------------
137 // ---------------------------------
138 // Pertaining to the config itself
139 // ---------------------------------
140 // Full path to config (may be URL)
141 String config_filename;
142 String default_config_filename = Constants.DEFAULT_CONFIGURATION_FILE_NAME;
143 final static String display_options[][] = {
144 { "Phylogram", "display", "?" }, { "Node Name", "display", "yes" }, { "Taxonomy Code", "display", "yes" },
145 { "Annotation", "nodisplay", "no" }, { "Confidence Value", "display", "?" }, { "Event", "display", "?" },
146 { "Taxonomy Colorize", "display", "yes" }, { "Colorize Branches", "display", "no" },
147 { "Use Branch-Width", "nodisplay", "no" }, { "Domains", "nodisplay", "no" },
148 { "Binary Characters", "nodisplay", "no" }, { "Binary Char Counts", "nodisplay", "no" },
149 { "Prot/Gene Name", "display", "no" }, { "Prot/Gene Acc", "display", "no" },
150 { "Show Internal Data", "display", "yes" }, { "Dyna Hide", "display", "yes" },
151 { "Taxonomy Scientific", "display", "yes" }, { "Taxonomy Common", "display", "no" },
152 { "Annotation Colorize", "nodisplay", "no" }, { "Property", "nodisplay", "no" },
153 { "Prot/Gene Symbol", "display", "no" }, { "Rollover", "display", "yes" },
154 { "Relation Confidence", "display", "no" }, { "Vector Data", "display", "no" },
155 { "Taxonomy Images", "display", "no" } };
156 final static String clickto_options[][] = {
157 { "Display Node Data", "display" }, { "Collapse/Uncollapse", "display" }, { "Root/Reroot", "display" },
158 { "Sub/Super Tree", "display" }, { "Swap Descendants", "display" }, { "Colorize Subtree", "display" },
159 { "Open Sequence Web", "nodisplay" }, { "Open Taxonomy Web", "nodisplay" }, { "Cut Subtree", "display" },
160 { "Copy Subtree", "display" }, { "Paste Subtree", "display" }, { "Delete Subtree/Node", "display" },
161 { "Add New Node", "display" }, { "Edit Node Data", "display" }, { "Blast", "display" } };
162 // This option is selected in the dropdown
163 int default_clickto = Configuration.display_node_data;
167 TreeColorSet tree_color_set;
171 TreeFontSet tree_font_set;
175 private static Hashtable<String, Color> _species_colors;
179 private static Hashtable<String, Color> _domain_colors;
183 private static Hashtable<String, Color> _annotation_colors;
184 boolean verbose = Constants.VERBOSE_DEFAULT;
185 private NODE_LABEL_DIRECTION _node_label_direction = NODE_LABEL_DIRECTION.HORIZONTAL;
186 private TRIPLET _use_native_ui;
187 private Color _gui_background_color = Constants.GUI_BACKGROUND_DEFAULT;
188 private Color _gui_checkbox_text_color = Constants.CHECKBOX_TEXT_COLOR_DEFAULT;
189 private Color _gui_checkbox_and_button_active_color = Constants.CHECKBOX_AND_BUTTON_ACTIVE_COLOR_DEFAULT;
190 private Color _gui_button_text_color = Constants.BUTTON_TEXT_COLOR_DEFAULT;
191 private Color _gui_button_background_color = Constants.BUTTON_BACKGROUND_COLOR_DEFAULT;
192 private Color _gui_menu_background_color = Constants.MENU_BACKGROUND_COLOR_DEFAULT;
193 private Color _gui_menu_text_color = Constants.MENU_TEXT_COLOR_DEFAULT;
194 private Color _gui_button_border_color = Constants.BUTTON_BORDER_COLOR_DEFAULT;
195 private Color _domain_structure_font_color = Constants.DOMAIN_STRUCTURE_FONT_COLOR_DEFAULT;
196 private Color _domain_structure_base_color = Constants.DOMAIN_STRUCTURE_BASE_COLOR_DEFAULT;
197 private static String DEFAULT_FONT_FAMILY = "";
199 for( final String font_name : Constants.DEFAULT_FONT_CHOICES ) {
200 if ( Arrays.binarySearch( Util.getAvailableFontFamiliesSorted(), font_name ) >= 0 ) {
201 DEFAULT_FONT_FAMILY = font_name;
205 if ( ForesterUtil.isEmpty( DEFAULT_FONT_FAMILY ) ) {
206 DEFAULT_FONT_FAMILY = Constants.DEFAULT_FONT_CHOICES[ Constants.DEFAULT_FONT_CHOICES.length - 1 ];
210 Configuration( final String cf, final boolean is_url, final boolean is_applet ) {
211 if ( ForesterUtil.isEmpty( cf ) ) {
212 config_filename = default_config_filename;
215 config_filename = cf;
217 setWebLinks( new TreeMap<String, WebLink>() );
218 setDisplayColors( new TreeMap<String, Color>() );
219 config_filename = config_filename.trim();
222 // If URL, open accordingly
224 u = new URL( config_filename );
226 final InputStreamReader isr = new InputStreamReader( u.openStream() );
227 final BufferedReader bf = new BufferedReader( isr );
230 ForesterUtil.programMessage( Constants.PRG_NAME, "successfully read from configuration url ["
231 + config_filename + "]" );
233 catch ( final Exception e ) {
234 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "failed to read configuration from ["
235 + config_filename + "]: " + e.getLocalizedMessage() );
238 catch ( final Exception e ) {
239 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "cannot find or open configuration url ["
240 + config_filename + "]" );
244 // Otherwise, open as a file
245 File f = new File( config_filename );
247 f = new File( config_filename + ".txt" );
249 if ( f.exists() && f.canRead() ) {
251 final BufferedReader bf = new BufferedReader( new FileReader( f ) );
255 catch ( final Exception e ) {
256 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "failed to read configuration from ["
257 + config_filename + "]: " + e );
261 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "cannot find or open configuration file ["
262 + config_filename + "]" );
267 private void createWebLink( final String url_str, final String desc, final String source_identifier ) {
268 WebLink weblink = null;
271 weblink = new WebLink( new URL( url_str.trim() ), desc.trim(), source_identifier.trim() );
273 catch ( final MalformedURLException e ) {
274 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not create URL from [" + url_str + "]" );
277 if ( !ex && ( weblink != null ) ) {
278 getWebLinks().put( weblink.getSourceIdentifier().toLowerCase(), weblink );
282 Color getGuiBackgroundColor() {
283 return _gui_background_color;
286 Color getGuiCheckboxTextColor() {
287 return _gui_checkbox_text_color;
290 Color getGuiCheckboxAndButtonActiveColor() {
291 return _gui_checkbox_and_button_active_color;
294 Color getGuiButtonTextColor() {
295 return _gui_button_text_color;
298 Color getGuiButtonBackgroundColor() {
299 return _gui_button_background_color;
302 Color getGuiMenuBackgroundColor() {
303 return _gui_menu_background_color;
306 Color getGuiMenuTextColor() {
307 return _gui_menu_text_color;
310 Color getGuiButtonBorderColor() {
311 return _gui_button_border_color;
314 boolean displaySequenceRelations() {
315 return _display_sequence_relations;
318 boolean doCheckOption( final int which ) {
319 return ( display_options[ which ][ 2 ].equalsIgnoreCase( "yes" ) )
320 || ( display_options[ which ][ 2 ].equalsIgnoreCase( "true" ) );
323 boolean doDisplayClickToOption( final int which ) {
324 return clickto_options[ which ][ 1 ].equalsIgnoreCase( "display" );
327 boolean doDisplayOption( final int which ) {
328 return display_options[ which ][ 1 ].equalsIgnoreCase( "display" );
332 * Will attempt to use the phylogeny to determine whether to check
333 * this or not (e.g. phylogram)
336 boolean doGuessCheckOption( final int which ) {
337 return display_options[ which ][ 2 ].equals( "?" );
340 Map<String, Color> getAnnotationColors() {
341 if ( _annotation_colors == null ) {
342 _annotation_colors = new Hashtable<String, Color>();
344 return _annotation_colors;
347 public String getBaseFontFamilyName() {
348 return _base_font_family_name;
351 int getBaseFontSize() {
352 return _base_font_size;
355 CLADOGRAM_TYPE getCladogramType() {
356 return _cladogram_type;
359 private int getClickToIndex( final String name ) {
361 if ( name.equals( "edit_info" ) ) {
362 index = Configuration.display_node_data;
364 .printWarningMessage( Constants.PRG_NAME,
365 "configuration key [edit_info] is deprecated, use [display node data] instead" );
367 else if ( name.equals( "display_node_data" ) ) {
368 index = Configuration.display_node_data;
370 else if ( name.equals( "collapse_uncollapse" ) ) {
371 index = Configuration.collapse_uncollapse;
373 else if ( name.equals( "reroot" ) ) {
374 index = Configuration.reroot;
376 else if ( name.equals( "subtree" ) ) {
377 index = Configuration.subtree;
379 else if ( name.equals( "swap" ) ) {
380 index = Configuration.swap;
382 else if ( name.equals( "display_sequences" ) ) {
384 .printWarningMessage( Constants.PRG_NAME, "configuration key [display_sequences] is deprecated" );
387 else if ( name.equals( "open_seq_web" ) ) {
388 index = Configuration.open_seq_web;
390 else if ( name.equals( "open_tax_web" ) ) {
391 index = Configuration.open_tax_web;
393 else if ( name.equals( "cut_subtree" ) ) {
394 index = Configuration.cut_subtree;
396 else if ( name.equals( "copy_subtree" ) ) {
397 index = Configuration.copy_subtree;
399 else if ( name.equals( "paste_subtree" ) ) {
400 index = Configuration.paste_subtree;
402 else if ( name.equals( "delete" ) ) {
403 index = Configuration.delete_subtree_or_node;
405 else if ( name.equals( "add_new_node" ) ) {
406 index = Configuration.add_new_node;
408 else if ( name.equals( "edit_node_data" ) ) {
409 index = Configuration.edit_node_data;
411 else if ( name.equals( "display_node_popup" ) ) {
412 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
413 "configuration key [display_node_popup] is deprecated" );
416 else if ( name.equals( "custom_option" ) ) {
417 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "configuration key [custom_option] is deprecated" );
420 else if ( name.equals( "color_subtree" ) ) {
421 index = Configuration.color_subtree;
423 else if ( name.equals( "go_to_swiss_prot" ) ) {
424 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "configuration key [go_to_swiss_prot] is deprecated" );
430 int getClickToOptionsCount() {
431 return clickto_options.length;
434 String getClickToTitle( final int which ) {
435 return clickto_options[ which ][ 0 ];
438 int getDefaultDisplayClicktoOption() {
439 return default_clickto;
442 SortedMap<String, Color> getDisplayColors() {
443 return _display_colors;
446 String getDisplayTitle( final int which ) {
447 return display_options[ which ][ 0 ];
450 Map<String, Color> getDomainColors() {
451 if ( _domain_colors == null ) {
452 _domain_colors = new Hashtable<String, Color>();
454 return _domain_colors;
457 int getGraphicsExportX() {
458 return _graphics_export_x;
461 int getGraphicsExportY() {
462 return _graphics_export_y;
465 int getDefaultBootstrapSamples() {
466 return _default_bootstrap_samples;
469 double getMinConfidenceValue() {
470 return _min_confidence_value;
473 NODE_LABEL_DIRECTION getNodeLabelDirection() {
474 return _node_label_direction;
477 short getNumberOfDigitsAfterCommaForBranchLengthValues() {
478 return _number_of_digits_after_comma_for_branch_length_values;
481 short getNumberOfDigitsAfterCommaForConfidenceValues() {
482 return _number_of_digits_after_comma_for_confidence_values;
485 short getOvMaxHeight() {
486 return _ov_max_height;
489 short getOvMaxWidth() {
490 return _ov_max_width;
493 OVERVIEW_PLACEMENT_TYPE getOvPlacement() {
494 return _ov_placement;
497 PHYLOGENY_GRAPHICS_TYPE getPhylogenyGraphicsType() {
498 return _phylogeny_graphics_type;
501 float getPrintLineWidth() {
502 return _print_line_width;
505 Hashtable<String, Color> getSpeciesColors() {
506 if ( _species_colors == null ) {
507 _species_colors = new Hashtable<String, Color>();
509 return _species_colors;
512 TreeColorSet getTreeColorSet() {
516 TreeFontSet getTreeFontSet() {
520 WebLink getWebLink( final String source ) {
521 return getWebLinks().get( source );
524 Map<String, WebLink> getWebLinks() {
528 boolean isAntialiasScreen() {
529 return _antialias_screen;
532 public boolean isBackgroundColorGradient() {
533 return _background_color_gradient;
537 * Convenience method.
539 * @return true if value in configuration file was 'yes'
541 boolean isDrawAsPhylogram() {
542 return doCheckOption( display_as_phylogram );
545 boolean isEditable() {
549 boolean isExtractPfamTaxonomyCodesInNhParsing() {
550 return _nh_parsing_extract_pfam_taxonomy_codes;
553 boolean isHasWebLink( final String source ) {
554 return getWebLinks().containsKey( source );
558 * Only used by ArchaeoptryxE.
561 boolean isHideControlPanelAndMenubar() {
562 return _hide_controls_and_menus;
565 boolean isInternalNumberAreConfidenceForNhParsing() {
566 return _internal_number_are_confidence_for_nh_parsing;
569 boolean isReplaceUnderscoresInNhParsing() {
570 return _nh_parsing_replace_underscores;
573 boolean isShowBranchLengthValues() {
574 return _show_branch_length_values;
577 boolean isShowOverview() {
578 return _show_overview;
581 boolean isShowScale() {
585 final boolean isUseNativeUI() {
586 if ( ( _use_native_ui == null ) || ( _use_native_ui == TRIPLET.UNKNOWN ) ) {
587 if ( ( _native_ui == TRIPLET.UNKNOWN ) && Util.isMac() && Util.isJava15() ) {
588 _use_native_ui = TRIPLET.TRUE;
590 else if ( _native_ui == TRIPLET.TRUE ) {
591 _use_native_ui = TRIPLET.TRUE;
594 _use_native_ui = TRIPLET.FALSE;
597 return _use_native_ui == TRIPLET.TRUE;
601 * Only used by ArchaeoptryxE.
604 boolean isUseTabbedDisplay() {
605 return _use_tabbed_display;
608 boolean isValidatePhyloXmlAgainstSchema() {
609 return _validate_against_phyloxml_xsd_schema;
612 private boolean parseBoolean( final String str ) {
613 final String my_str = str.trim().toLowerCase();
614 if ( my_str.equals( "yes" ) || my_str.equals( "true" ) ) {
617 else if ( my_str.equals( "no" ) || my_str.equals( "false" ) ) {
621 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse boolean value from [" + str + "]" );
626 private double parseDouble( final String str ) {
629 d = Double.parseDouble( str );
631 catch ( final Exception e ) {
632 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse double from [" + str + "]" );
638 private float parseFloat( final String str ) {
641 f = Float.parseFloat( str );
643 catch ( final Exception e ) {
644 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse float from [" + str + "]" );
650 private int parseInt( final String str ) {
653 i = Integer.parseInt( str );
655 catch ( final Exception e ) {
656 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse integer from [" + str + "]" );
662 private short parseShort( final String str ) {
665 i = Short.parseShort( str );
667 catch ( final Exception e ) {
668 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse short from [" + str + "]" );
674 private void processFontFamily( final StringTokenizer st ) {
675 setBaseFontFamilyName( "" );
676 final String font_str = ( ( String ) st.nextElement() ).trim();
677 final String[] fonts = font_str.split( ",+" );
678 for( String font : fonts ) {
679 font = font.replace( '_', ' ' ).trim();
680 if ( Arrays.binarySearch( Util.getAvailableFontFamiliesSorted(), font ) >= 0 ) {
681 setBaseFontFamilyName( font );
688 * read each line of config file, process non-comment lines
689 * @throws IOException
691 private void readConfig( final BufferedReader conf_in ) throws IOException {
694 line = conf_in.readLine();
695 if ( line != null ) {
697 // skip comments and blank lines
698 if ( !line.startsWith( "#" ) && ( !ForesterUtil.isEmpty( line ) ) ) {
699 // convert runs of spaces to tabs
700 line = line.replaceAll( "\\s+", "\t" );
701 final StringTokenizer st = new StringTokenizer( line, "\t" );
705 } while ( line != null );
708 private void setAntialiasScreen( final boolean antialias_screen ) {
709 _antialias_screen = antialias_screen;
712 public void setBackgroundColorGradient( final boolean background_color_gradient ) {
713 _background_color_gradient = background_color_gradient;
716 private void setBaseFontFamilyName( final String base_font_family_name ) {
717 _base_font_family_name = base_font_family_name;
720 private void setBaseFontSize( final int base_font_size ) {
721 _base_font_size = base_font_size;
724 private void setShowDomainLabels( final boolean show_domain_labels ) {
725 _show_domain_labels = show_domain_labels;
728 private void setAbbreviateScientificTaxonNames( final boolean abbreviate_scientific_names ) {
729 _abbreviate_scientific_names = abbreviate_scientific_names;
732 private void setColorLabelsSameAsParentBranch( final boolean color_labels_same_as_parent_branch ) {
733 _color_labels_same_as_parent_branch = color_labels_same_as_parent_branch;
736 private void setCladogramType( final CLADOGRAM_TYPE cladogram_type ) {
737 _cladogram_type = cladogram_type;
740 void setDisplayColors( final SortedMap<String, Color> display_colors ) {
741 _display_colors = display_colors;
744 private void setDisplaySequenceRelations( final boolean display_sequence_relations ) {
745 _display_sequence_relations = display_sequence_relations;
748 private void setEditable( final boolean editable ) {
749 _editable = editable;
752 private void setExtractPfamTaxonomyCodesInNhParsing( final boolean nh_parsing_extract_pfam_taxonomy_codes ) {
753 _nh_parsing_extract_pfam_taxonomy_codes = nh_parsing_extract_pfam_taxonomy_codes;
756 private void setGraphicsExportX( final int graphics_export_x ) {
757 _graphics_export_x = graphics_export_x;
760 private void setGraphicsExportY( final int graphics_export_y ) {
761 _graphics_export_y = graphics_export_y;
764 private void setDefaultBootstrapSamples( final int default_bootstrap_samples ) {
765 _default_bootstrap_samples = default_bootstrap_samples;
768 private void setInternalNumberAreConfidenceForNhParsing( final boolean internal_number_are_confidence_for_nh_parsing ) {
769 _internal_number_are_confidence_for_nh_parsing = internal_number_are_confidence_for_nh_parsing;
773 * Set a key-value(s) tuple
775 private void setKeyValue( final StringTokenizer st ) {
776 String key = ( String ) st.nextElement();
777 key = key.replace( ':', ' ' );
779 key = key.toLowerCase();
780 // Handle single value settings first:
781 if ( key.equals( "default_click_to" ) ) {
782 final String clickto_name = ( String ) st.nextElement();
783 default_clickto = getClickToIndex( clickto_name );
784 if ( default_clickto == -1 ) {
785 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "invalid value [" + clickto_name
786 + "] for [default_click_to]" );
789 else if ( default_clickto == DEPRECATED ) {
793 else if ( key.equals( "native_ui" ) ) {
794 final String my_str = ( ( String ) st.nextElement() ).trim().toLowerCase();
795 if ( my_str.equals( "yes" ) || my_str.equals( "true" ) ) {
796 _native_ui = TRIPLET.TRUE;
798 else if ( my_str.equals( "no" ) || my_str.equals( "false" ) ) {
799 _native_ui = TRIPLET.FALSE;
801 else if ( my_str.equals( "?" ) ) {
802 _native_ui = TRIPLET.UNKNOWN;
805 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse yes/no/? value from [" + my_str
807 _native_ui = TRIPLET.FALSE;
810 else if ( key.equals( VALIDATE_AGAINST_PHYLOXML_XSD_SCHEMA ) ) {
811 setValidatePhyloXmlAgainstSchema( parseBoolean( ( String ) st.nextElement() ) );
813 else if ( key.equals( "antialias_screen" ) ) {
814 setAntialiasScreen( parseBoolean( ( String ) st.nextElement() ) );
816 else if ( key.equals( "phylogeny_graphics_type" ) ) {
817 final String type_str = ( ( String ) st.nextElement() ).trim();
818 if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.CONVEX.toString() ) ) {
819 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.CONVEX );
821 else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.CURVED.toString() ) ) {
822 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.CURVED );
824 else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.EURO_STYLE.toString() ) ) {
825 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.EURO_STYLE );
827 else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.ROUNDED.toString() ) ) {
828 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.ROUNDED );
830 else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR.toString() ) ) {
831 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR );
833 else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.TRIANGULAR.toString() ) ) {
834 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.TRIANGULAR );
836 else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.UNROOTED.toString() ) ) {
837 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.UNROOTED );
839 else if ( type_str.equalsIgnoreCase( PHYLOGENY_GRAPHICS_TYPE.CIRCULAR.toString() ) ) {
840 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.CIRCULAR );
843 setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR );
844 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + type_str
845 + "] for [phylogeny_graphics_type]" );
848 else if ( key.equals( "min_confidence_value" ) ) {
849 final String mcv_str = ( ( String ) st.nextElement() ).trim();
850 final double d = parseDouble( mcv_str );
851 setMinConfidenceValue( d );
853 else if ( key.equals( "font_family" ) ) {
854 processFontFamily( st );
856 else if ( key.equals( "font_size" ) ) {
857 final String size_str = ( ( String ) st.nextElement() ).trim();
858 final int i = parseInt( size_str );
859 setBaseFontSize( i );
861 else if ( key.equals( "graphics_export_x" ) ) {
862 final String str = ( ( String ) st.nextElement() ).trim();
863 final int i = parseInt( str );
864 setGraphicsExportX( i );
866 else if ( key.equals( "graphics_export_y" ) ) {
867 final String str = ( ( String ) st.nextElement() ).trim();
868 final int i = parseInt( str );
869 setGraphicsExportY( i );
871 else if ( key.equals( "pdf_export_line_width" ) ) {
872 final String str = ( ( String ) st.nextElement() ).trim();
873 final float f = parseFloat( str );
875 setPrintLineWidth( f );
878 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
879 "value for [pdf_export_line_width] cannot be zero or negative" );
882 else if ( key.equals( "default_number_of_bootstrap_resamples" ) ) {
883 final String str = ( ( String ) st.nextElement() ).trim();
884 final int i = parseInt( str );
886 setDefaultBootstrapSamples( i );
890 .printWarningMessage( Constants.PRG_NAME,
891 "value for [default_number_of_bootstrap_resamples] cannot be negative" );
894 else if ( key.equals( "show_scale" ) ) {
895 setShowScale( parseBoolean( ( String ) st.nextElement() ) );
897 else if ( key.equals( "show_overview" ) ) {
898 setShowOverview( parseBoolean( ( String ) st.nextElement() ) );
900 else if ( key.equals( "show_branch_length_values" ) ) {
901 setShowBranchLengthValues( parseBoolean( ( String ) st.nextElement() ) );
903 else if ( key.equals( "background_gradient" ) ) {
904 setBackgroundColorGradient( parseBoolean( ( String ) st.nextElement() ) );
906 else if ( key.equals( "color_labels_same_as_branch_length_values" ) ) {
907 setColorLabelsSameAsParentBranch( parseBoolean( ( String ) st.nextElement() ) );
909 else if ( key.equals( "show_domain_labels" ) ) {
910 setShowDomainLabels( parseBoolean( ( String ) st.nextElement() ) );
912 else if ( key.equals( "abbreviate_scientific_names" ) ) {
913 setAbbreviateScientificTaxonNames( parseBoolean( ( String ) st.nextElement() ) );
915 else if ( key.equals( "cladogram_type" ) ) {
916 final String type_str = ( ( String ) st.nextElement() ).trim();
917 if ( type_str.equalsIgnoreCase( Options.CLADOGRAM_TYPE.NON_LINED_UP.toString() ) ) {
918 setCladogramType( Options.CLADOGRAM_TYPE.NON_LINED_UP );
920 else if ( type_str.equalsIgnoreCase( Options.CLADOGRAM_TYPE.EXT_NODE_SUM_DEP.toString() ) ) {
921 setCladogramType( Options.CLADOGRAM_TYPE.EXT_NODE_SUM_DEP );
923 else if ( type_str.equalsIgnoreCase( Options.CLADOGRAM_TYPE.TOTAL_NODE_SUM_DEP.toString() ) ) {
924 setCladogramType( Options.CLADOGRAM_TYPE.TOTAL_NODE_SUM_DEP );
927 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + type_str
928 + "] for [cladogram_type]" );
931 else if ( key.equals( "non_lined_up_cladogram" ) ) {
933 .printWarningMessage( Constants.PRG_NAME,
934 "configuration key [non_lined_up_cladogram] is deprecated, use [cladogram_type] instead" );
936 else if ( key.equals( "hide_controls_and_menus" ) ) {
937 _hide_controls_and_menus = parseBoolean( ( String ) st.nextElement() );
939 else if ( key.equals( "use_tabbed_display" ) ) {
940 _use_tabbed_display = parseBoolean( ( String ) st.nextElement() );
942 else if ( key.equals( "overview_width" ) ) {
943 final short i = parseShort( ( ( String ) st.nextElement() ).trim() );
946 else if ( key.equals( "overview_height" ) ) {
947 final short i = parseShort( ( ( String ) st.nextElement() ).trim() );
950 else if ( key.equals( "overview_placement_type" ) ) {
951 final String type_str = ( ( String ) st.nextElement() ).trim();
952 if ( type_str.equalsIgnoreCase( OVERVIEW_PLACEMENT_TYPE.UPPER_LEFT.toTag() ) ) {
953 setOvPlacement( OVERVIEW_PLACEMENT_TYPE.UPPER_LEFT );
955 else if ( type_str.equalsIgnoreCase( OVERVIEW_PLACEMENT_TYPE.UPPER_RIGHT.toTag() ) ) {
956 setOvPlacement( OVERVIEW_PLACEMENT_TYPE.UPPER_RIGHT );
958 else if ( type_str.equalsIgnoreCase( OVERVIEW_PLACEMENT_TYPE.LOWER_LEFT.toTag() ) ) {
959 setOvPlacement( OVERVIEW_PLACEMENT_TYPE.LOWER_LEFT );
961 else if ( type_str.equalsIgnoreCase( OVERVIEW_PLACEMENT_TYPE.LOWER_RIGHT.toTag() ) ) {
962 setOvPlacement( OVERVIEW_PLACEMENT_TYPE.LOWER_RIGHT );
965 setOvPlacement( OVERVIEW_PLACEMENT_TYPE.UPPER_LEFT );
966 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + type_str
967 + "] for [overview_placement_type]" );
970 else if ( key.equals( "node_label_direction" ) ) {
971 final String type_str = ( ( String ) st.nextElement() ).trim();
972 if ( type_str.equalsIgnoreCase( NODE_LABEL_DIRECTION.HORIZONTAL.toString() ) ) {
973 setNodeLabelDirection( NODE_LABEL_DIRECTION.HORIZONTAL );
975 else if ( type_str.equalsIgnoreCase( NODE_LABEL_DIRECTION.RADIAL.toString() ) ) {
976 setNodeLabelDirection( NODE_LABEL_DIRECTION.RADIAL );
979 setNodeLabelDirection( NODE_LABEL_DIRECTION.HORIZONTAL );
980 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + type_str
981 + "] for [node_label_direction]" );
984 else if ( key.equals( "branch_length_value_digits" ) ) {
985 final short i = parseShort( ( ( String ) st.nextElement() ).trim() );
987 setNumberOfDigitsAfterCommaForBranchLengthValue( i );
990 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "illegal value [" + i
991 + "] for [branch_length_value_digits]" );
994 else if ( key.equals( "confidence_value_digits" ) ) {
995 final short i = parseShort( ( ( String ) st.nextElement() ).trim() );
997 setNumberOfDigitsAfterCommaForConfidenceValues( i );
1000 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "illegal value [" + i
1001 + "] for [confidence_value_digits]" );
1004 else if ( key.equals( "allow_editing" ) ) {
1005 setEditable( parseBoolean( ( String ) st.nextElement() ) );
1007 else if ( key.equals( "display_sequence_relations" ) ) {
1008 setDisplaySequenceRelations( parseBoolean( ( String ) st.nextElement() ) );
1010 else if ( key.equals( "replace_underscores_in_nh_parsing" ) ) {
1011 final boolean r = parseBoolean( ( String ) st.nextElement() );
1012 if ( r && isExtractPfamTaxonomyCodesInNhParsing() ) {
1014 .printWarningMessage( Constants.PRG_NAME,
1015 "attempt to extract taxonomies and replace underscores at the same time" );
1018 setReplaceUnderscoresInNhParsing( r );
1021 else if ( key.equals( "extract_taxonomy_codes_in_nh_parsing" ) ) {
1022 final boolean e = parseBoolean( ( String ) st.nextElement() );
1023 if ( e && isReplaceUnderscoresInNhParsing() ) {
1025 .printWarningMessage( Constants.PRG_NAME,
1026 "attempt to extract taxonomies and replace underscores at the same time" );
1029 setExtractPfamTaxonomyCodesInNhParsing( e );
1032 else if ( key.equals( "internal_labels_are_confidence_values" ) ) {
1033 setInternalNumberAreConfidenceForNhParsing( parseBoolean( ( String ) st.nextElement() ) );
1035 else if ( key.equals( "gui_background_color" ) ) {
1036 _gui_background_color = Color.decode( ( String ) st.nextElement() );
1038 else if ( key.equals( "gui_checkbox_text_color" ) ) {
1039 _gui_checkbox_text_color = Color.decode( ( String ) st.nextElement() );
1041 else if ( key.equals( "gui_checkbox_and_button_active_color" ) ) {
1042 _gui_checkbox_and_button_active_color = Color.decode( ( String ) st.nextElement() );
1044 else if ( key.equals( "gui_button_text_color" ) ) {
1045 _gui_button_text_color = Color.decode( ( String ) st.nextElement() );
1047 else if ( key.equals( "gui_button_background_color" ) ) {
1048 _gui_button_background_color = Color.decode( ( String ) st.nextElement() );
1050 else if ( key.equals( "gui_menu_background_color" ) ) {
1051 _gui_menu_background_color = Color.decode( ( String ) st.nextElement() );
1053 else if ( key.equals( "gui_menu_text_color" ) ) {
1054 _gui_menu_text_color = Color.decode( ( String ) st.nextElement() );
1056 else if ( key.equals( "gui_button_border_color" ) ) {
1057 _gui_button_border_color = Color.decode( ( String ) st.nextElement() );
1059 else if ( key.equals( "domain_structure_font_color" ) ) {
1060 _domain_structure_font_color = Color.decode( ( String ) st.nextElement() );
1062 else if ( key.equals( "domain_structure_base_color" ) ) {
1063 _domain_structure_base_color = Color.decode( ( String ) st.nextElement() );
1065 else if ( st.countTokens() >= 2 ) { // counts the tokens that are not
1068 if ( key.equals( "use_real_br_lengths" ) || key.equals( "phylogram" ) ) {
1069 key_index = Configuration.display_as_phylogram;
1070 if ( key.equals( "use_real_br_lengths" ) ) {
1072 .printWarningMessage( Constants.PRG_NAME,
1073 "configuration key [use_real_br_lengths] is deprecated, use [phylogram] instead" );
1076 else if ( key.equals( "rollover" ) ) {
1077 key_index = Configuration.node_data_popup;
1079 else if ( key.equals( "color_according_to_species" ) ) {
1080 key_index = Configuration.color_according_to_species;
1082 else if ( key.equals( "show_node_names" ) ) {
1083 key_index = Configuration.show_node_names;
1085 else if ( key.equals( "show_taxonomy" ) || key.equals( "show_taxonomy_code" ) ) {
1086 key_index = Configuration.show_tax_code;
1087 if ( key.equals( "show_taxonomy" ) ) {
1089 .printWarningMessage( Constants.PRG_NAME,
1090 "configuration key [show_taxonomy] is deprecated, use [show_taxonomy_code] instead" );
1093 else if ( key.equals( "write_br_length_values" ) ) {
1094 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
1095 "configuration key [write_br_length_values] is deprecated" );
1096 key_index = DEPRECATED;
1098 else if ( key.equals( "write_bootstrap_values" ) || key.equals( "write_confidence_values" ) ) {
1099 key_index = Configuration.write_confidence_values;
1100 if ( key.equals( "write_bootstrap_values" ) ) {
1102 .printWarningMessage( Constants.PRG_NAME,
1103 "configuration key [write_bootstrap_values] is deprecated, use [write_confidence_values] instead" );
1106 else if ( key.equals( "write_events" ) || key.equals( "write_dup_spec" ) ) {
1107 key_index = Configuration.write_events;
1108 if ( key.equals( "write_dup_spec" ) ) {
1110 .printWarningMessage( Constants.PRG_NAME,
1111 "configuration key [write_dup_spec] is deprecated, use [write_events] instead" );
1114 else if ( key.equals( "color_branches" ) ) {
1115 key_index = Configuration.color_branches;
1117 else if ( key.equals( "width_branches" ) ) {
1118 key_index = Configuration.width_branches;
1120 else if ( key.equals( "color_orthologous" ) ) {
1121 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
1122 "configuration key [color_orthologous] is deprecated" );
1124 else if ( key.equals( "color_subtree_neighbors" ) ) {
1125 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
1126 "configuration key [color_subtree_neighbors] is deprecated" );
1128 else if ( key.equals( "color_super_orthologous" ) ) {
1129 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
1130 "configuration key [color_super_orthologous] is deprecated" );
1132 else if ( key.equals( "mark_nodes_with_box" ) ) {
1133 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
1134 "configuration key [mark_nodes_with_box] is deprecated" );
1135 key_index = DEPRECATED;
1137 else if ( key.equals( "show_domain_architectures" ) ) {
1138 key_index = Configuration.show_domain_architectures;
1140 else if ( key.equals( "show_annotations" ) ) {
1141 key_index = Configuration.show_annotation;
1143 else if ( key.equals( "show_binary_characters" ) ) {
1144 key_index = Configuration.show_binary_characters;
1146 else if ( key.equals( "show_binary_character_counts" ) ) {
1147 key_index = Configuration.show_binary_character_counts;
1149 else if ( key.equals( "show_gene_names" ) ) {
1150 key_index = Configuration.show_gene_names;
1152 else if ( key.equals( "show_gene_symbols" ) ) {
1153 key_index = Configuration.show_gene_symbols;
1155 else if ( key.equals( "show_sequence_acc" ) ) {
1156 key_index = Configuration.show_sequence_acc;
1158 else if ( key.equals( "show_node_ids" ) ) {
1160 .printWarningMessage( Constants.PRG_NAME, "configuration key [show_node_ids] is deprecated" );
1161 key_index = DEPRECATED;
1163 else if ( key.equals( "display_internal_data" ) ) {
1164 key_index = Configuration.display_internal_data;
1166 else if ( key.equals( "dynamically_hide_data" ) ) {
1167 key_index = Configuration.dynamically_hide_data;
1169 else if ( key.equals( "show_taxonomy_names" ) ) {
1170 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
1171 "configuration key [show_taxonomy_names] is deprecated" );
1172 key_index = DEPRECATED;
1174 else if ( key.equals( "show_taxonomy_scientific_names" ) ) {
1175 key_index = Configuration.show_taxonomy_scientific_names;
1177 else if ( key.equals( "show_taxonomy_common_names" ) ) {
1178 key_index = Configuration.show_taxonomy_common_names;
1180 else if ( key.equals( "show_taxonomy_images" ) ) {
1181 key_index = Configuration.show_taxonomy_images;
1183 else if ( key.equals( "color_according_to_annotation" ) ) {
1184 key_index = Configuration.color_according_to_annotation;
1186 else if ( key.equals( "show_property" ) ) {
1187 key_index = Configuration.show_property;
1189 else if ( key.equals( "show_vector_data" ) ) {
1190 key_index = Configuration.show_vector_data;
1192 else if ( key.equals( "show_relation_confidence" ) ) {
1193 key_index = Configuration.show_relation_confidence;
1195 // If we've found the key, set the values
1196 if ( key_index >= 0 ) {
1197 display_options[ key_index ][ 1 ] = ( String ) st.nextElement();
1198 display_options[ key_index ][ 2 ] = ( String ) st.nextElement();
1199 // otherwise, keep looking
1202 if ( key_index == DEPRECATED ) {
1205 else if ( key.equals( "click_to" ) ) {
1206 final String click_to_name = ( String ) st.nextElement();
1207 key_index = getClickToIndex( click_to_name );
1208 if ( key_index >= 0 ) {
1209 clickto_options[ key_index ][ 1 ] = ( String ) st.nextElement();
1211 else if ( key_index == DEPRECATED ) {
1215 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown click-to option: "
1219 else if ( key.equals( "species_color" ) ) {
1220 getSpeciesColors().put( ( String ) st.nextElement(), Color.decode( ( String ) st.nextElement() ) );
1222 else if ( key.equals( "domain_color" ) ) {
1223 getDomainColors().put( ( String ) st.nextElement(), Color.decode( ( String ) st.nextElement() ) );
1225 else if ( key.equals( "annotation_color" ) ) {
1226 getAnnotationColors()
1227 .put( ( String ) st.nextElement(), Color.decode( ( String ) st.nextElement() ) );
1229 else if ( key.equals( "function_color" ) ) {
1230 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
1231 "configuration key [function_color] is deprecated" );
1233 else if ( key.equals( DISPLAY_COLOR_KEY ) ) {
1234 getDisplayColors().put( ( String ) st.nextElement(), Color.decode( ( String ) st.nextElement() ) );
1236 else if ( key.equals( WEB_LINK_KEY ) ) {
1237 if ( st.countTokens() == 3 ) {
1238 createWebLink( ( String ) st.nextElement(), ( String ) st.nextElement(), ( String ) st
1242 ForesterUtil.printWarningMessage( Constants.PRG_NAME,
1243 "illegal format in configuration file for key [" + key + "]" );
1247 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown configuration key [" + key
1248 + "] in: " + config_filename );
1253 ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown configuration key [" + key + "] in: "
1254 + config_filename );
1258 private void setMinConfidenceValue( final double min_confidence_value ) {
1259 _min_confidence_value = min_confidence_value;
1262 void setNodeLabelDirection( final NODE_LABEL_DIRECTION node_label_direction ) {
1263 _node_label_direction = node_label_direction;
1266 private void setNumberOfDigitsAfterCommaForBranchLengthValue( final short _number_of_digits_after_comma_for_branch_length_values ) {
1267 this._number_of_digits_after_comma_for_branch_length_values = _number_of_digits_after_comma_for_branch_length_values;
1270 private void setNumberOfDigitsAfterCommaForConfidenceValues( final short _number_of_digits_after_comma_for_confidence_values ) {
1271 this._number_of_digits_after_comma_for_confidence_values = _number_of_digits_after_comma_for_confidence_values;
1274 private void setOvMaxHeight( final short ov_max_height ) {
1275 _ov_max_height = ov_max_height;
1278 private void setOvMaxWidth( final short ov_max_width ) {
1279 _ov_max_width = ov_max_width;
1282 private void setOvPlacement( final OVERVIEW_PLACEMENT_TYPE ov_placement ) {
1283 _ov_placement = ov_placement;
1286 void setPhylogenyGraphicsType( final PHYLOGENY_GRAPHICS_TYPE phylogeny_graphics_type ) {
1287 _phylogeny_graphics_type = phylogeny_graphics_type;
1290 private void setPrintLineWidth( final float print_line_width ) {
1291 _print_line_width = print_line_width;
1294 private void setReplaceUnderscoresInNhParsing( final boolean nh_parsing_replace_underscores ) {
1295 _nh_parsing_replace_underscores = nh_parsing_replace_underscores;
1298 private void setShowBranchLengthValues( final boolean show_branch_length_values ) {
1299 _show_branch_length_values = show_branch_length_values;
1302 private void setShowOverview( final boolean show_overview ) {
1303 _show_overview = show_overview;
1306 private void setShowScale( final boolean show_scale ) {
1307 _show_scale = show_scale;
1310 private void setValidatePhyloXmlAgainstSchema( final boolean validate_against_phyloxml_xsd_schema ) {
1311 _validate_against_phyloxml_xsd_schema = validate_against_phyloxml_xsd_schema;
1314 void setWebLinks( final SortedMap<String, WebLink> weblinks ) {
1315 _weblinks = weblinks;
1318 static String getDefaultFontFamilyName() {
1319 return DEFAULT_FONT_FAMILY;
1322 static enum TRIPLET {
1323 TRUE, FALSE, UNKNOWN
1326 public Color getDomainStructureFontColor() {
1327 return _domain_structure_font_color;
1330 public Color getDomainStructureBaseColor() {
1331 return _domain_structure_base_color;
1334 public boolean isColorLabelsSameAsParentBranch() {
1335 return _color_labels_same_as_parent_branch;
1338 public boolean isShowDomainLabels() {
1339 return _show_domain_labels;
1342 public boolean isAbbreviateScientificTaxonNames() {
1343 return _abbreviate_scientific_names;