X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Farchaeopteryx%2FConfiguration.java;h=5df336a78e219fa8ddb9a5930dc612a8eb24d1cc;hb=226d82be9b70ce0c67b5b1055654d484073ea184;hp=d93368283c15cfca43c9bf754afdffe81925e98f;hpb=cf94cc54e9f35d2c1d28a871d3bcb3e6a0db23e6;p=jalview.git diff --git a/forester/java/src/org/forester/archaeopteryx/Configuration.java b/forester/java/src/org/forester/archaeopteryx/Configuration.java index d933682..5df336a 100644 --- a/forester/java/src/org/forester/archaeopteryx/Configuration.java +++ b/forester/java/src/org/forester/archaeopteryx/Configuration.java @@ -90,18 +90,18 @@ public final class Configuration { // ------------------ final static String display_options[][] = { { "Phylogram", "display", "?" }, { "Node Name", "display", "yes" }, { "Taxonomy Code", "display", "yes" }, - { "Seq Annotations", "nodisplay", "no" }, { "Confidence Values", "display", "?" }, + { "Seq Annotations", "display", "no" }, { "Confidence Values", "display", "?" }, { "Node Events", "display", "?" }, { "Colorize by Taxonomy", "display", "no" }, - { "Visual Styles/Branch Colors", "display", "no" }, { "Branch Widths", "display", "no" }, - { "Show Custom Nodes", "display", "yes" }, { "Protein Domains", "nodisplay", "no" }, + { "Colorize by Sequence", "display", "no" }, { "Visual Styles/Branch Colors", "display", "no" }, + { "Branch Widths", "display", "no" }, { "Domain Architectures", "display", "no" }, { "Binary Characters", "nodisplay", "no" }, { "Binary Char Counts", "nodisplay", "no" }, { "Seq Name", "display", "yes" }, { "Seq Accession", "display", "no" }, { "Show Internal Data", "display", "yes" }, { "Dyna Hide", "display", "yes" }, { "Taxonomy Scientific", "display", "yes" }, { "Taxonomy Common", "display", "no" }, - { "Colorize by Annotation", "nodisplay", "no" }, { "Seq Symbol", "display", "yes" }, + { "Colorize by Annotation", "display", "no" }, { "Seq Symbol", "display", "yes" }, { "Rollover", "display", "yes" }, { "Relation Confidence", "nodisplay", "no" }, { "Vector Data", "nodisplay", "no" }, { "Taxonomy Images", "display", "no" }, - { "Properties", "nodisplay", "no" }, { "Gene Name", "display", "yes" } }; + { "Properties", "display", "no" }, { "Gene Name", "display", "yes" } }; final static int display_as_phylogram = 0; final static int show_node_names = 1; final static int show_tax_code = 2; @@ -109,9 +109,9 @@ public final class Configuration { final static int write_confidence_values = 4; final static int write_events = 5; final static int color_according_to_species = 6; - final static int use_style = 7; - final static int width_branches = 8; - final static int show_custom_node_shapes = 9; + final static int color_according_to_sequence = 7; + final static int use_style = 8; + final static int width_branches = 9; final static int show_domain_architectures = 10; final static int show_binary_characters = 11; final static int show_binary_character_counts = 12; @@ -130,17 +130,9 @@ public final class Configuration { final static int show_properties = 25; final static int show_gene_names = 26; static final String VALIDATE_AGAINST_PHYLOXML_XSD_SCHEMA = "validate_against_phyloxml_xsd_schema"; - // ---------------- - // Function colors - // ---------------- + private static Hashtable _sequence_colors; private static Hashtable _annotation_colors; - // ---------------- - // Domain colors - // ---------------- private static Hashtable _domain_colors; - // ---------------- - // Species colors - // ---------------- private static Hashtable _species_colors; private static String DEFAULT_FONT_FAMILY = ""; private static final int DEPRECATED = -2; @@ -178,8 +170,6 @@ public final class Configuration { private short _default_node_shape_size = Constants.DEFAULT_NODE_SHAPE_SIZE_DEFAULT; private SortedMap _display_colors = null; private boolean _display_sequence_relations = false; - private Color _domain_structure_base_color = Constants.DOMAIN_STRUCTURE_BASE_COLOR_DEFAULT; - private Color _domain_structure_font_color = Constants.DOMAIN_STRUCTURE_FONT_COLOR_DEFAULT; private boolean _editable = true; private NODE_DATA _ext_desc_data_to_return = NODE_DATA.UNKNOWN; private EXT_NODE_DATA_RETURN_ON _ext_node_data_return_on = EXT_NODE_DATA_RETURN_ON.WINODW; @@ -225,6 +215,13 @@ public final class Configuration { private UI _ui = UI.UNKNOWN; private boolean _use_tabbed_display = false; private boolean _validate_against_phyloxml_xsd_schema = Constants.VALIDATE_AGAINST_PHYLOXML_XSD_SCJEMA_DEFAULT; + private Color _vector_data_min_color = Color.BLUE; + private Color _vector_data_max_color = Color.YELLOW; + private Color _vector_data_mean_color = Color.WHITE; + private double _vector_data_height = 12; + private int _vector_data_width = 120; + private boolean _line_up_renderable_node_data; + private boolean _right_align_domains; static { for( final String font_name : Constants.DEFAULT_FONT_CHOICES ) { if ( Arrays.binarySearch( AptxUtil.getAvailableFontFamiliesSorted(), font_name ) >= 0 ) { @@ -321,14 +318,6 @@ public final class Configuration { return _default_node_shape_size; } - public Color getDomainStructureBaseColor() { - return _domain_structure_base_color; - } - - public Color getDomainStructureFontColor() { - return _domain_structure_font_color; - } - public NODE_DATA getExtDescNodeDataToReturn() { return _ext_desc_data_to_return; } @@ -353,7 +342,7 @@ public final class Configuration { return _path_to_local_fastme; } - public File getpathToLocalMafft() { + public File getPathToLocalMafft() { return _path_to_local_mafft; } @@ -401,6 +390,10 @@ public final class Configuration { getDisplayColors().put( key, color ); } + public void setAddTaxonomyImagesCB( final boolean b ) { + display_options[ show_taxonomy_images ][ 1 ] = b ? "yes" : "no"; + } + public void setAbbreviateScientificTaxonNames( final boolean abbreviate_scientific_names ) { _abbreviate_scientific_names = abbreviate_scientific_names; } @@ -441,6 +434,10 @@ public final class Configuration { display_options[ display_as_phylogram ][ 2 ] = b ? "yes" : "no"; } + public void setUseStyle( final boolean b ) { + display_options[ use_style ][ 2 ] = b ? "yes" : "no"; + } + public void setDisplayColors( final SortedMap display_colors ) { _display_colors = display_colors; } @@ -465,6 +462,10 @@ public final class Configuration { display_options[ show_seq_names ][ 2 ] = b ? "yes" : "no"; } + public void setDisplayGeneNames( 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; } @@ -557,14 +558,6 @@ 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 setUseBranchesWidths( final boolean b ) { - display_options[ width_branches ][ 2 ] = b ? "yes" : "no"; - } - boolean displaySequenceRelations() { return _display_sequence_relations; } @@ -724,6 +717,13 @@ public final class Configuration { return _species_colors; } + Hashtable getSequenceColors() { + if ( _sequence_colors == null ) { + _sequence_colors = new Hashtable(); + } + return _sequence_colors; + } + final TAXONOMY_EXTRACTION getTaxonomyExtraction() { return _taxonomy_extraction; } @@ -1377,12 +1377,6 @@ public final class Configuration { else if ( key.equals( "gui_button_border_color" ) ) { _gui_button_border_color = Color.decode( ( String ) st.nextElement() ); } - else if ( key.equals( "domain_structure_font_color" ) ) { - _domain_structure_font_color = Color.decode( ( String ) st.nextElement() ); - } - else if ( key.equals( "domain_structure_base_color" ) ) { - _domain_structure_base_color = Color.decode( ( String ) st.nextElement() ); - } else if ( key.equals( "show_default_node_shapes" ) ) { ForesterUtil .printWarningMessage( Constants.PRG_NAME, @@ -1499,6 +1493,33 @@ public final class Configuration { + "] for [ext_descendents_data_to_return_on]" ); } } + else if ( key.equals( "vector_data_min_color" ) ) { + _vector_data_min_color = Color.decode( ( String ) st.nextElement() ); + } + else if ( key.equals( "vector_data_max_color" ) ) { + _vector_data_max_color = Color.decode( ( String ) st.nextElement() ); + } + else if ( key.equals( "vector_data_mean_color" ) ) { + _vector_data_mean_color = Color.decode( ( String ) st.nextElement() ); + } + else if ( key.equals( "vector_data_width" ) ) { + _vector_data_width = parseShort( ( String ) st.nextElement() ); + if ( _vector_data_width < 1 ) { + _vector_data_width = 120; + } + } + else if ( key.equals( "vector_data_height" ) ) { + _vector_data_height = parseShort( ( String ) st.nextElement() ); + if ( _vector_data_height < 1 ) { + _vector_data_height = 12; + } + } + else if ( key.equals( "line_up_renderable_data" ) ) { + setLineUpRendarableNodeData( parseBoolean( ( String ) st.nextElement() ) ); + } + else if ( key.equals( "right_align_domain_architectures" ) ) { + setRightLineUpDomains( parseBoolean( ( String ) st.nextElement() ) ); + } else if ( st.countTokens() >= 2 ) { // counts the tokens that are not // yet retrieved! int key_index = -1; @@ -1511,6 +1532,9 @@ public final class Configuration { else if ( key.equals( "color_according_to_species" ) ) { key_index = Configuration.color_according_to_species; } + else if ( key.equals( "color_according_to_sequence" ) ) { + key_index = Configuration.color_according_to_sequence; + } else if ( key.equals( "show_node_names" ) ) { key_index = Configuration.show_node_names; } @@ -1586,9 +1610,6 @@ public final class Configuration { else if ( key.equals( "show_relation_confidence" ) ) { key_index = Configuration.show_relation_confidence; } - else if ( key.equals( "show_custom_node_shapes" ) ) { - key_index = Configuration.show_custom_node_shapes; - } // If we've found the key, set the values if ( key_index >= 0 ) { display_options[ key_index ][ 1 ] = ( String ) st.nextElement(); @@ -1617,6 +1638,10 @@ public final class Configuration { getSpeciesColors().put( ( ( String ) st.nextElement() ).replace( '_', ' ' ), Color.decode( ( String ) st.nextElement() ) ); } + else if ( key.equals( "sequence_color" ) ) { + getSequenceColors().put( ( ( String ) st.nextElement() ).replace( '_', ' ' ), + Color.decode( ( String ) st.nextElement() ) ); + } else if ( key.equals( "domain_color" ) ) { getDomainColors().put( ( String ) st.nextElement(), Color.decode( ( String ) st.nextElement() ) ); } @@ -1706,4 +1731,40 @@ public final class Configuration { static enum TRIPLET { FALSE, TRUE, UNKNOWN } + + public Color getVectorDataMinColor() { + return _vector_data_min_color; + } + + public Color getVectorDataMaxColor() { + return _vector_data_max_color; + } + + public Color getVectorDataMeanColor() { + return _vector_data_mean_color; + } + + public double getVectorDataHeight() { + return _vector_data_height; + } + + public int getVectorDataWidth() { + return _vector_data_width; + } + + final public boolean isLineUpRendarableNodeData() { + return _line_up_renderable_node_data; + } + + final public boolean isRightLineUpDomains() { + return _right_align_domains; + } + + final public void setLineUpRendarableNodeData( final boolean line_up_renderable_node_data ) { + _line_up_renderable_node_data = line_up_renderable_node_data; + } + + final public void setRightLineUpDomains( final boolean right_align_domains ) { + _right_align_domains = right_align_domains; + } }