moved to: https://sites.google.com/site/cmzmasek/home/software/forester
[jalview.git] / forester / java / src / org / forester / archaeopteryx / Options.java
index 083a6b1..43b8fec 100644 (file)
 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
 //
 // Contact: phylosoft @ gmail . com
-// WWW: www.phylosoft.org/forester
+// WWW: https://sites.google.com/site/cmzmasek/home/software/forester
 
 package org.forester.archaeopteryx;
 
 import java.awt.Font;
 
+import org.forester.io.parsers.nhx.NHXParser.TAXONOMY_EXTRACTION;
+import org.forester.phylogeny.PhylogenyNode.NH_CONVERSION_SUPPORT_VALUE_STYLE;
+import org.forester.phylogeny.data.NodeData;
+import org.forester.phylogeny.data.NodeData.NODE_DATA;
 import org.forester.phylogeny.data.NodeVisualization;
 import org.forester.phylogeny.data.NodeVisualization.NodeFill;
 import org.forester.phylogeny.data.NodeVisualization.NodeShape;
@@ -37,44 +41,47 @@ import org.forester.util.ForesterUtil;
  */
 final public class Options {
 
-    static final double                 MIN_CONFIDENCE_DEFAULT = 0.0;
-    private boolean                     _show_branch_length_values;
-    private boolean                     _internal_number_are_confidence_for_nh_parsing;
-    private boolean                     _show_scale;
-    private boolean                     _show_overview;
-    private boolean                     _antialias_screen;
-    private boolean                     _antialias_print;
-    private boolean                     _graphics_export_visible_only;
-    private int                         _print_size_x;
-    private int                         _print_size_y;
-    private double                      _min_confidence_value;
-    private boolean                     _print_black_and_white;
-    private boolean                     _print_using_actual_size;
-    private boolean                     _graphics_export_using_actual_size;
-    private PHYLOGENY_GRAPHICS_TYPE     _phylogeny_graphics_type;
-    private CLADOGRAM_TYPE              _cladogram_type;
-    private OVERVIEW_PLACEMENT_TYPE     _ov_placement;
-    private NODE_LABEL_DIRECTION        _node_label_direction;
-    private Font                        _base_font;
-    private boolean                     _match_whole_terms_only;
-    private boolean                     _search_case_sensitive;
-    private float                       _print_line_width;
-    private boolean                     _inverse_search_result;
-    private double                      _scale_bar_length;
-    private short                       _number_of_digits_after_comma_for_confidence_values;
-    private short                       _number_of_digits_after_comma_for_branch_length_values;
-    private boolean                     _nh_parsing_replace_underscores;
-    private boolean                     _nh_parsing_extract_pfam_taxonomy_codes;
-    private boolean                     _editable;
-    private boolean                     _background_color_gradient;
-    private boolean                     _show_domain_labels;
-    private boolean                     _color_labels_same_as_parent_branch;
-    private boolean                     _abbreviate_scientific_names;
-    private NodeVisualization.NodeShape _default_node_shape;
-    private NodeVisualization.NodeFill  _default_node_fill;
-    private short                       _default_node_shape_size;
-    private boolean                     _taxonomy_colorize_node_shapes;
-    private boolean                     _show_default_node_shapes;
+    static final double                       MIN_CONFIDENCE_DEFAULT = 0.0;
+    private boolean                           _show_branch_length_values;
+    private boolean                           _internal_number_are_confidence_for_nh_parsing;
+    private boolean                           _show_scale;
+    private boolean                           _show_overview;
+    private boolean                           _antialias_screen;
+    private boolean                           _antialias_print;
+    private boolean                           _graphics_export_visible_only;
+    private int                               _print_size_x;
+    private int                               _print_size_y;
+    private double                            _min_confidence_value;
+    private boolean                           _print_black_and_white;
+    private boolean                           _print_using_actual_size;
+    private boolean                           _graphics_export_using_actual_size;
+    private PHYLOGENY_GRAPHICS_TYPE           _phylogeny_graphics_type;
+    private CLADOGRAM_TYPE                    _cladogram_type;
+    private OVERVIEW_PLACEMENT_TYPE           _ov_placement;
+    private NODE_LABEL_DIRECTION              _node_label_direction;
+    private Font                              _base_font;
+    private boolean                           _match_whole_terms_only;
+    private boolean                           _search_case_sensitive;
+    private float                             _print_line_width;
+    private boolean                           _inverse_search_result;
+    private double                            _scale_bar_length;
+    private short                             _number_of_digits_after_comma_for_confidence_values;
+    private short                             _number_of_digits_after_comma_for_branch_length_values;
+    private boolean                           _nh_parsing_replace_underscores;
+    private TAXONOMY_EXTRACTION               _taxonomy_extraction;
+    private boolean                           _editable;
+    private boolean                           _background_color_gradient;
+    private boolean                           _show_domain_labels;
+    private boolean                           _color_labels_same_as_parent_branch;
+    private boolean                           _abbreviate_scientific_names;
+    private NodeVisualization.NodeShape       _default_node_shape;
+    private NodeVisualization.NodeFill        _default_node_fill;
+    private short                             _default_node_shape_size;
+    private boolean                           _taxonomy_colorize_node_shapes;
+    private boolean                           _show_default_node_shapes;
+    private boolean                           _show_confidence_stddev;
+    private NH_CONVERSION_SUPPORT_VALUE_STYLE _nh_conversion_support_value_style;
+    private NODE_DATA                         _ext_desc_data_to_return;
 
     private Options() {
         init();
@@ -154,7 +161,7 @@ final public class Options {
         _editable = true;
         _background_color_gradient = false;
         _show_default_node_shapes = false;
-        if ( Util.isUsOrCanada() ) {
+        if ( AptxUtil.isUsOrCanada() ) {
             _print_size_x = Constants.US_LETTER_SIZE_X;
             _print_size_y = Constants.US_LETTER_SIZE_Y;
         }
@@ -179,11 +186,30 @@ final public class Options {
         _number_of_digits_after_comma_for_branch_length_values = Constants.NUMBER_OF_DIGITS_AFTER_COMMA_FOR_BRANCH_LENGTH_VALUES_DEFAULT;
         _number_of_digits_after_comma_for_confidence_values = Constants.NUMBER_OF_DIGITS_AFTER_COMMA_FOR_CONFIDENCE_VALUES_DEFAULT;
         _nh_parsing_replace_underscores = false;
-        _nh_parsing_extract_pfam_taxonomy_codes = false;
+        _taxonomy_extraction = TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY;
         _cladogram_type = Constants.CLADOGRAM_TYPE_DEFAULT;
         _show_domain_labels = true;
         setAbbreviateScientificTaxonNames( false );
         _color_labels_same_as_parent_branch = false;
+        _show_confidence_stddev = true;
+        _nh_conversion_support_value_style = NH_CONVERSION_SUPPORT_VALUE_STYLE.NONE;
+        _ext_desc_data_to_return = NODE_DATA.UNKNOWN;
+    }
+
+    boolean isShowConfidenceStddev() {
+        return _show_confidence_stddev;
+    }
+
+    void setShowConfidenceStddev( final boolean show_confidence_stddev ) {
+        _show_confidence_stddev = show_confidence_stddev;
+    }
+
+    NH_CONVERSION_SUPPORT_VALUE_STYLE getNhConversionSupportValueStyle() {
+        return _nh_conversion_support_value_style;
+    }
+
+    void setNhConversionSupportValueStyle( final NH_CONVERSION_SUPPORT_VALUE_STYLE nh_conversion_support_value_style ) {
+        _nh_conversion_support_value_style = nh_conversion_support_value_style;
     }
 
     final boolean isAbbreviateScientificTaxonNames() {
@@ -214,8 +240,8 @@ final public class Options {
         return _editable;
     }
 
-    final boolean isExtractPfamTaxonomyCodesInNhParsing() {
-        return _nh_parsing_extract_pfam_taxonomy_codes;
+    final TAXONOMY_EXTRACTION getTaxonomyExtraction() {
+        return _taxonomy_extraction;
     }
 
     final boolean isGraphicsExportUsingActualSize() {
@@ -318,8 +344,8 @@ final public class Options {
         _editable = editable;
     }
 
-    final void setExtractPfamTaxonomyCodesInNhParsing( final boolean nh_parsing_extract_pfam_taxonomy_codes ) {
-        _nh_parsing_extract_pfam_taxonomy_codes = nh_parsing_extract_pfam_taxonomy_codes;
+    final void setTaxonomyExtractio( final TAXONOMY_EXTRACTION taxonomy_extraction ) {
+        _taxonomy_extraction = taxonomy_extraction;
     }
 
     final void setGraphicsExportUsingActualSize( final boolean graphics_export_using_actual_size ) {
@@ -456,7 +482,7 @@ final public class Options {
                 instance.setNumberOfDigitsAfterCommaForConfidenceValues( configuration
                         .getNumberOfDigitsAfterCommaForConfidenceValues() );
             }
-            instance.setExtractPfamTaxonomyCodesInNhParsing( configuration.isExtractPfamTaxonomyCodesInNhParsing() );
+            instance.setTaxonomyExtractio( configuration.getTaxonomyExtraction() );
             instance.setReplaceUnderscoresInNhParsing( configuration.isReplaceUnderscoresInNhParsing() );
             instance.setInternalNumberAreConfidenceForNhParsing( configuration
                     .isInternalNumberAreConfidenceForNhParsing() );
@@ -494,15 +520,18 @@ final public class Options {
             }
             instance.setTaxonomyColorizeNodeShapes( configuration.isTaxonomyColorizeNodeShapes() );
             instance.setShowDefaultNodeShapes( configuration.isShowDefaultNodeShapes() );
+            if ( configuration.getExtDescNodeDataToReturn() != null ) {
+                instance.setExtDescNodeDataToReturn( configuration.getExtDescNodeDataToReturn() );
+            }
         }
         return instance;
     }
 
-    static enum CLADOGRAM_TYPE {
+    public static enum CLADOGRAM_TYPE {
         NON_LINED_UP, EXT_NODE_SUM_DEP, TOTAL_NODE_SUM_DEP;
     }
 
-    static enum NODE_LABEL_DIRECTION {
+    public static enum NODE_LABEL_DIRECTION {
         HORIZONTAL, RADIAL;
     }
 
@@ -528,7 +557,15 @@ final public class Options {
         }
     }
 
-    static enum PHYLOGENY_GRAPHICS_TYPE {
+    public static enum PHYLOGENY_GRAPHICS_TYPE {
         RECTANGULAR, TRIANGULAR, EURO_STYLE, ROUNDED, CONVEX, CURVED, UNROOTED, CIRCULAR;
     }
+
+    public NodeData.NODE_DATA getExtDescNodeDataToReturn() {
+        return _ext_desc_data_to_return;
+    }
+
+    public void setExtDescNodeDataToReturn( final NODE_DATA ext_desc_data_to_return ) {
+        _ext_desc_data_to_return = ext_desc_data_to_return;
+    }
 }