- String getDisplayTitle( final int which ) {
- return display_options[ which ][ 0 ];
- }
-
- Map<String, Color> getDomainColors() {
- if ( _domain_colors == null ) {
- _domain_colors = new Hashtable<String, Color>();
- }
- return _domain_colors;
- }
-
- int getGraphicsExportX() {
- return _graphics_export_x;
- }
-
- int getGraphicsExportY() {
- return _graphics_export_y;
- }
-
- Color getGuiBackgroundColor() {
- return _gui_background_color;
- }
-
- Color getGuiButtonBackgroundColor() {
- return _gui_button_background_color;
- }
-
- Color getGuiButtonBorderColor() {
- return _gui_button_border_color;
- }
-
- Color getGuiButtonTextColor() {
- return _gui_button_text_color;
- }
-
- Color getGuiCheckboxAndButtonActiveColor() {
- return _gui_checkbox_and_button_active_color;
- }
-
- Color getGuiCheckboxTextColor() {
- return _gui_checkbox_text_color;
- }
-
- Color getGuiMenuBackgroundColor() {
- return _gui_menu_background_color;
- }
-
- Color getGuiMenuTextColor() {
- return _gui_menu_text_color;
- }
-
- int getMaxBaseFontSize() {
- return _max_base_font_size;
- }
-
- int getMinBaseFontSize() {
- return _min_base_font_size;
- }
-
- double getMinConfidenceValue() {
- return _min_confidence_value;
- }
-
- NODE_LABEL_DIRECTION getNodeLabelDirection() {
- return _node_label_direction;
- }
-
- short getNumberOfDigitsAfterCommaForBranchLengthValues() {
- return _number_of_digits_after_comma_for_branch_length_values;
- }
-
- short getNumberOfDigitsAfterCommaForConfidenceValues() {
- return _number_of_digits_after_comma_for_confidence_values;
- }
-
- short getOvMaxHeight() {
- return _ov_max_height;
- }
-
- short getOvMaxWidth() {
- return _ov_max_width;
- }
-
- OVERVIEW_PLACEMENT_TYPE getOvPlacement() {
- return _ov_placement;
- }
-
- PHYLOGENY_GRAPHICS_TYPE getPhylogenyGraphicsType() {
- return _phylogeny_graphics_type;
- }
-
- float getPrintLineWidth() {
- return _print_line_width;
- }
-
- Hashtable<String, Color> getSpeciesColors() {
- if ( _species_colors == null ) {
- _species_colors = new Hashtable<String, Color>();
- }
- return _species_colors;
- }
-
- final TAXONOMY_EXTRACTION getTaxonomyExtraction() {
- return _taxonomy_extraction;
- }
-
- boolean isAntialiasScreen() {
- if ( ForesterUtil.isMac() ) {
- //Apple Macintosh graphics are slow, turn off anti-alias.
- return false;
- }
- return _antialias_screen;
- }
-
- /**
- * Convenience method.
- *
- * @return true if value in configuration file was 'yes'
- */
- boolean isDrawAsPhylogram() {
- return doCheckOption( display_as_phylogram );
- }
-
- boolean isEditable() {
- return _editable;
- }
-
- /**
- * Only used by ArchaeoptryxE.
- *
- */
- boolean isHideControlPanelAndMenubar() {
- return _hide_controls_and_menus;
- }
-
- boolean isInternalNumberAreConfidenceForNhParsing() {
- return _internal_number_are_confidence_for_nh_parsing;
- }
-
- boolean isReplaceUnderscoresInNhParsing() {
- return _nh_parsing_replace_underscores;
- }
-
- boolean isShowBranchLengthValues() {
- return _show_branch_length_values;
- }
-
- boolean isShowOverview() {
- return _show_overview;
- }
-
- boolean isShowScale() {
- return _show_scale;
- }
-
- final boolean isUseNativeUI() {
- if ( ( _ui == UI.UNKNOWN ) && ForesterUtil.isMac() ) {
- _ui = UI.NATIVE;
- }
- return _ui == UI.NATIVE;
- }
-
- /**
- * Only used by ArchaeoptryxE.
- *
- */
- boolean isUseTabbedDisplay() {
- return _use_tabbed_display;
- }
-
- boolean isValidatePhyloXmlAgainstSchema() {
- return _validate_against_phyloxml_xsd_schema;
- }
-
- final void setTaxonomyExtraction( final TAXONOMY_EXTRACTION taxonomy_extraction ) {
- _taxonomy_extraction = taxonomy_extraction;
- }
-
- private int getClickToIndex( final String name ) {
- int index = -1;
- if ( name.equals( "edit_info" ) ) {
- index = Configuration.display_node_data;
- ForesterUtil
- .printWarningMessage( Constants.PRG_NAME,
- "configuration key [edit_info] is deprecated, use [display node data] instead" );
- }
- else if ( name.equals( "display_node_data" ) ) {
- index = Configuration.display_node_data;
- }
- else if ( name.equals( "collapse_uncollapse" ) ) {
- index = Configuration.collapse_uncollapse;
- }
- else if ( name.equals( "reroot" ) ) {
- index = Configuration.reroot;
- }
- else if ( name.equals( "subtree" ) ) {
- index = Configuration.subtree;
- }
- else if ( name.equals( "swap" ) ) {
- index = Configuration.swap;
- }
- else if ( name.equals( "sort_descendants" ) ) {
- index = Configuration.sort_descendents;
- }
- else if ( name.equals( "get_ext_descendents_data" ) ) {
- index = Configuration.get_ext_desc_data;
- }
- else if ( name.equals( "display_sequences" ) ) {
- ForesterUtil
- .printWarningMessage( Constants.PRG_NAME, "configuration key [display_sequences] is deprecated" );
- return DEPRECATED;
- }
- else if ( name.equals( "open_seq_web" ) ) {
- index = Configuration.open_seq_web;
- }
- else if ( name.equals( "open_pdb_web" ) ) {
- index = Configuration.open_pdb_web;
- }
- else if ( name.equals( "open_tax_web" ) ) {
- index = Configuration.open_tax_web;
- }
- else if ( name.equals( "blast" ) ) {
- index = Configuration.blast;
- }
- else if ( name.equals( "cut_subtree" ) ) {
- index = Configuration.cut_subtree;
- }
- else if ( name.equals( "copy_subtree" ) ) {
- index = Configuration.copy_subtree;
- }
- else if ( name.equals( "paste_subtree" ) ) {
- index = Configuration.paste_subtree;
- }
- else if ( name.equals( "delete" ) ) {
- index = Configuration.delete_subtree_or_node;
- }
- else if ( name.equals( "add_new_node" ) ) {
- index = Configuration.add_new_node;
- }
- else if ( name.equals( "edit_node_data" ) ) {
- index = Configuration.edit_node_data;
- }
- else if ( name.equals( "select_nodes" ) ) {
- index = Configuration.select_nodes;
- }
- else if ( name.equals( "display_node_popup" ) ) {
- ForesterUtil.printWarningMessage( Constants.PRG_NAME,
- "configuration key [display_node_popup] is deprecated" );
- return DEPRECATED;
- }
- else if ( name.equals( "custom_option" ) ) {
- ForesterUtil.printWarningMessage( Constants.PRG_NAME, "configuration key [custom_option] is deprecated" );
- return DEPRECATED;
- }
- else if ( name.equals( "color_subtree" ) ) {
- index = Configuration.color_subtree;
- }
-
- else if ( name.equals( "change_node_font" ) ) {
- index = Configuration.change_node_font;
- }
-
- else if ( name.equals( "color_node_font" ) ) {
- index = Configuration.color_node_font;
- }
-
- else if ( name.equals( "color_subtree" ) ) {
- index = Configuration.color_subtree;
- }
-
-
- return index;
- }
-
- private boolean parseBoolean( final String str ) {
- final String my_str = str.trim().toLowerCase();
- if ( my_str.equals( "yes" ) || my_str.equals( "true" ) ) {
- return true;
- }
- else if ( my_str.equals( "no" ) || my_str.equals( "false" ) ) {
- return false;
- }
- else {
- ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse boolean value from [" + str + "]" );
- return false;
- }
- }
-
- private double parseDouble( final String str ) {
- double d = 0.0;
- try {
- d = Double.parseDouble( str.trim() );
- }
- catch ( final Exception e ) {
- ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse double from [" + str + "]" );
- d = 0.0;
- }
- return d;
- }
-
- private float parseFloat( final String str ) {
- float f = 0.0f;
- try {
- f = Float.parseFloat( str.trim() );
- }
- catch ( final Exception e ) {
- ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse float from [" + str + "]" );
- f = 0.0f;
- }
- return f;
- }
-
- private int parseInt( final String str ) {
- int i = -1;
- try {
- i = Integer.parseInt( str.trim() );
- }
- catch ( final Exception e ) {
- ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse integer from [" + str + "]" );
- i = -1;
- }
- return i;
- }
-
- private short parseShort( final String str ) {
- short i = -1;
- try {
- i = Short.parseShort( str.trim() );
- }
- catch ( final Exception e ) {
- ForesterUtil.printWarningMessage( Constants.PRG_NAME, "could not parse short from [" + str + "]" );
- i = -1;
- }
- return i;
- }
-
- private void processFontFamily( final StringTokenizer st ) {
- setBaseFontFamilyName( "" );
- final String font_str = ( ( String ) st.nextElement() ).trim();
- final String[] fonts = font_str.split( ",+" );
- for( String font : fonts ) {
- font = font.replace( '_', ' ' ).trim();
- if ( Arrays.binarySearch( AptxUtil.getAvailableFontFamiliesSorted(), font ) >= 0 ) {
- setBaseFontFamilyName( font );
- break;
- }
- }
- }
-
- /**
- * read each line of config file, process non-comment lines
- * @throws IOException
- */
- private void readConfig( final BufferedReader conf_in ) throws IOException {
- String line;
- do {
- line = conf_in.readLine();
- if ( line != null ) {
- line = line.trim();
- // skip comments and blank lines
- if ( !line.startsWith( "#" ) && ( !ForesterUtil.isEmpty( line ) ) ) {
- // convert runs of spaces to tabs
- line = line.replaceAll( "\\s+", "\t" );
- final StringTokenizer st = new StringTokenizer( line, "\t" );
- setKeyValue( st );
- }
- }
- } while ( line != null );
- }
-
- private void setAntialiasScreen( final boolean antialias_screen ) {
- _antialias_screen = antialias_screen;
- }
-
- private void setCladogramType( final CLADOGRAM_TYPE cladogram_type ) {
- _cladogram_type = cladogram_type;
- }
-
- private void setDefaultBootstrapSamples( final int default_bootstrap_samples ) {
- _default_bootstrap_samples = default_bootstrap_samples;
- }
-
- private void setEditable( final boolean editable ) {
- _editable = editable;
- }
-
- private void setExtNodeDataReturnOn( final EXT_NODE_DATA_RETURN_ON ext_node_data_return_on ) {
- _ext_node_data_return_on = ext_node_data_return_on;