cleanup
[jalview.git] / forester / java / src / org / forester / archaeopteryx / Configuration.java
index 72c5753..ea48459 100644 (file)
@@ -62,6 +62,9 @@ public final class Configuration {
     private boolean                         _use_tabbed_display                                    = false;
     private boolean                         _hide_controls_and_menus                               = false;
     private CLADOGRAM_TYPE                  _cladogram_type                                        = Constants.CLADOGRAM_TYPE_DEFAULT;
+    private File                            _mafft                                                 = null;
+    private File                            _clustalo                                              = null;
+    private File                            _fastme                                                = null;
     private SortedMap<String, WebLink>      _weblinks                                              = null;
     private SortedMap<String, Color>        _display_colors                                        = null;
     private boolean                         _antialias_screen                                      = true;
@@ -133,13 +136,14 @@ public final class Configuration {
     final static int                        color_subtree                                          = 5;
     final static int                        open_seq_web                                           = 6;
     final static int                        open_tax_web                                           = 7;
-    final static int                        cut_subtree                                            = 8;
-    final static int                        copy_subtree                                           = 9;
-    final static int                        paste_subtree                                          = 10;
-    final static int                        delete_subtree_or_node                                 = 11;
-    final static int                        add_new_node                                           = 12;
-    final static int                        edit_node_data                                         = 13;
-    final static int                        blast                                                  = 14;
+    final static int                        blast                                                  = 8;
+    final static int                        cut_subtree                                            = 9;
+    final static int                        copy_subtree                                           = 10;
+    final static int                        paste_subtree                                          = 11;
+    final static int                        delete_subtree_or_node                                 = 12;
+    final static int                        add_new_node                                           = 13;
+    final static int                        edit_node_data                                         = 14;
+    final static int                        sort_descendents                                       = 15;
     // ---------------------------
     // Display options for trees
     // ---------------------------
@@ -151,7 +155,7 @@ public final class Configuration {
     String                                  default_config_filename                                = Constants.DEFAULT_CONFIGURATION_FILE_NAME;
     final static String                     display_options[][]                                    = {
             { "Phylogram", "display", "?" }, { "Node Name", "display", "yes" }, { "Taxonomy Code", "display", "yes" },
-            { "Annotation", "nodisplay", "no" }, { "Confidence Value", "display", "?" }, { "Event", "display", "?" },
+            { "Annotation", "nodisplay", "no" }, { "Confidence Values", "display", "?" }, { "Event", "display", "?" },
             { "Taxonomy Colorize", "display", "no" }, { "Colorize Branches", "display", "no" },
             { "Use Branch-Widths", "display", "no" }, { "Show Custom Nodes", "display", "yes" },
             { "Domains", "nodisplay", "no" }, { "Binary Characters", "nodisplay", "no" },
@@ -165,9 +169,10 @@ public final class Configuration {
     final static String                     clickto_options[][]                                    = {
             { "Display Node Data", "display" }, { "Collapse/Uncollapse", "display" }, { "Root/Reroot", "display" },
             { "Sub/Super Tree", "display" }, { "Swap Descendants", "display" }, { "Colorize Subtree", "display" },
-            { "Open Sequence Web", "display" }, { "Open Taxonomy Web", "display" }, { "Cut Subtree", "display" },
-            { "Copy Subtree", "display" }, { "Paste Subtree", "display" }, { "Delete Subtree/Node", "display" },
-            { "Add New Node", "display" }, { "Edit Node Data", "display" }, { "Blast", "nodisplay" } };
+            { "Open Sequence Web", "display" }, { "Open Taxonomy Web", "display" }, { "Blast", "display" },
+            { "Cut Subtree", "display" }, { "Copy Subtree", "display" }, { "Paste Subtree", "display" },
+            { "Delete Subtree/Node", "display" }, { "Add New Node", "display" }, { "Edit Node Data", "display" },
+            { "Sort Descendants", "display" }                                                     };
     // This option is selected in the dropdown
     int                                     default_clickto                                        = Configuration.display_node_data;
     // --------------
@@ -363,6 +368,9 @@ public final class Configuration {
         else if ( name.equals( "swap" ) ) {
             index = Configuration.swap;
         }
+        else if ( name.equals( "sort_descendants" ) ) {
+            index = Configuration.sort_descendents;
+        }
         else if ( name.equals( "display_sequences" ) ) {
             ForesterUtil
                     .printWarningMessage( Constants.PRG_NAME, "configuration key [display_sequences] is deprecated" );
@@ -374,6 +382,9 @@ public final class Configuration {
         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;
         }
@@ -781,6 +792,10 @@ public final class Configuration {
         _cladogram_type = cladogram_type;
     }
 
+    public void setColorizeBranches( final boolean b ) {
+        display_options[ color_branches ][ 2 ] = b ? "yes" : "no";
+    }
+
     public void setColorLabelsSameAsParentBranch( final boolean color_labels_same_as_parent_branch ) {
         _color_labels_same_as_parent_branch = color_labels_same_as_parent_branch;
     }
@@ -801,14 +816,62 @@ public final class Configuration {
         _default_node_shape_size = default_node_shape_size;
     }
 
+    public void setDisplayAsPhylogram( final boolean b ) {
+        display_options[ display_as_phylogram ][ 2 ] = b ? "yes" : "no";
+    }
+
     public void setDisplayColors( final SortedMap<String, Color> display_colors ) {
         _display_colors = display_colors;
     }
 
+    public void setDisplayConfidenceValues( final boolean b ) {
+        display_options[ write_confidence_values ][ 2 ] = b ? "yes" : "no";
+    }
+
+    public void setDisplayInternalData( final boolean b ) {
+        display_options[ display_internal_data ][ 2 ] = b ? "yes" : "no";
+    }
+
+    public void setDisplayNodeNames( final boolean b ) {
+        display_options[ show_node_names ][ 2 ] = b ? "yes" : "no";
+    }
+
+    public void setDisplaySequenceAcc( final boolean b ) {
+        display_options[ show_sequence_acc ][ 2 ] = b ? "yes" : "no";
+    }
+
+    public void setDisplaySequenceNames( final boolean b ) {
+        display_options[ show_gene_names ][ 2 ] = b ? "yes" : "no";
+    }
+
     public void setDisplaySequenceRelations( final boolean display_sequence_relations ) {
         _display_sequence_relations = display_sequence_relations;
     }
 
+    public void setDisplaySequenceSymbols( final boolean b ) {
+        display_options[ show_gene_symbols ][ 2 ] = b ? "yes" : "no";
+    }
+
+    public void setDisplayTaxonomyCode( final boolean b ) {
+        display_options[ show_tax_code ][ 2 ] = b ? "yes" : "no";
+    }
+
+    public void setDisplayTaxonomyCommonNames( final boolean b ) {
+        display_options[ show_taxonomy_common_names ][ 2 ] = b ? "yes" : "no";
+    }
+
+    public void setDisplayTaxonomyImages( final boolean b ) {
+        display_options[ show_taxonomy_images ][ 2 ] = b ? "yes" : "no";
+    }
+
+    public void setDisplayTaxonomyScientificNames( final boolean b ) {
+        display_options[ show_taxonomy_scientific_names ][ 2 ] = b ? "yes" : "no";
+    }
+
+    public void setDynamicallyHideData( final boolean b ) {
+        display_options[ dynamically_hide_data ][ 2 ] = b ? "yes" : "no";
+    }
+
     private void setEditable( final boolean editable ) {
         _editable = editable;
     }
@@ -867,6 +930,18 @@ public final class Configuration {
                 _ui = UI.UNKNOWN;
             }
         }
+        else if ( key.equals( "path_to_mafft" ) ) {
+            setPathToMafft( new File( ( String ) st.nextElement() ) );
+        }
+        else if ( key.equals( "path_to_clustalo" ) ) {
+            setPathToClustalOmega( new File( ( String ) st.nextElement() ) );
+        }
+        else if ( key.equals( "path_to_fastme" ) ) {
+            setPathToFastME( new File( ( String ) st.nextElement() ) );
+        }
+        else if ( key.equals( "path_to_mafft" ) ) {
+            setPathToMafft( new File( ( String ) st.nextElement() ) );
+        }
         else if ( key.equals( VALIDATE_AGAINST_PHYLOXML_XSD_SCHEMA ) ) {
             setValidatePhyloXmlAgainstSchema( parseBoolean( ( String ) st.nextElement() ) );
         }
@@ -1418,10 +1493,18 @@ public final class Configuration {
         _show_scale = show_scale;
     }
 
+    public void setTaxonomyColorize( final boolean b ) {
+        display_options[ color_according_to_species ][ 2 ] = b ? "yes" : "no";
+    }
+
     public void setTaxonomyColorizeNodeShapes( final boolean taxonomy_colorize_node_shapes ) {
         _taxonomy_colorize_node_shapes = taxonomy_colorize_node_shapes;
     }
 
+    public void setUseBranchesWidths( final boolean b ) {
+        display_options[ width_branches ][ 2 ] = b ? "yes" : "no";
+    }
+
     private void setValidatePhyloXmlAgainstSchema( final boolean validate_against_phyloxml_xsd_schema ) {
         _validate_against_phyloxml_xsd_schema = validate_against_phyloxml_xsd_schema;
     }
@@ -1434,6 +1517,30 @@ public final class Configuration {
         return DEFAULT_FONT_FAMILY;
     }
 
+    public File getPathToMafft() {
+        return _mafft;
+    }
+
+    public File getPathToClustalOmega() {
+        return _clustalo;
+    }
+
+    public File getPathToFastME() {
+        return _fastme;
+    }
+
+    public void setPathToMafft( final File mafft ) {
+        _mafft = mafft;
+    }
+
+    public void setPathToClustalOmega( final File clustalo ) {
+        _clustalo = clustalo;
+    }
+
+    public void setPathToFastME( final File fastme ) {
+        _fastme = fastme;
+    }
+
     static enum TRIPLET {
         TRUE, FALSE, UNKNOWN
     }