import org.forester.archaeopteryx.Options.NODE_LABEL_DIRECTION;
import org.forester.archaeopteryx.Options.OVERVIEW_PLACEMENT_TYPE;
import org.forester.archaeopteryx.Options.PHYLOGENY_GRAPHICS_TYPE;
+import org.forester.phylogeny.data.NodeVisualization;
+import org.forester.phylogeny.data.NodeVisualization.NodeFill;
+import org.forester.phylogeny.data.NodeVisualization.NodeShape;
import org.forester.util.ForesterUtil;
public final class Configuration {
private boolean _abbreviate_scientific_names = false;
private boolean _color_labels_same_as_parent_branch = false;
private int _default_bootstrap_samples = -1;
+ private boolean _show_default_node_shapes = false;
+ private NodeShape _default_node_shape = NodeShape.CIRCLE;
+ private NodeFill _default_node_fill = NodeFill.GRADIENT;
+ private short _default_node_shape_size = Constants.DEFAULT_NODE_SHAPE_SIZE_DEFAULT;
+ private boolean _taxonomy_colorize_node_shapes = false;
final static int display_as_phylogram = 0;
final static int show_node_names = 1;
final static int show_tax_code = 2;
final static int color_according_to_species = 6;
final static int color_branches = 7;
final static int width_branches = 8;
- final static int show_domain_architectures = 9;
- final static int show_binary_characters = 10;
- final static int show_binary_character_counts = 11;
- final static int show_gene_names = 12;
- final static int show_sequence_acc = 13;
- final static int display_internal_data = 14;
- final static int dynamically_hide_data = 15;
- final static int show_taxonomy_scientific_names = 16;
- final static int show_taxonomy_common_names = 17;
- final static int color_according_to_annotation = 18;
- final static int show_property = 19;
- final static int show_gene_symbols = 20;
- final static int node_data_popup = 21;
- final static int show_relation_confidence = 22;
- final static int show_vector_data = 23;
- final static int show_taxonomy_images = 24;
+ final static int show_custom_node_shapes = 9;
+ final static int show_domain_architectures = 10;
+ final static int show_binary_characters = 11;
+ final static int show_binary_character_counts = 12;
+ final static int show_gene_names = 13;
+ final static int show_sequence_acc = 14;
+ final static int display_internal_data = 15;
+ final static int dynamically_hide_data = 16;
+ final static int show_taxonomy_scientific_names = 17;
+ final static int show_taxonomy_common_names = 18;
+ final static int color_according_to_annotation = 19;
+ final static int show_property = 20;
+ final static int show_gene_symbols = 21;
+ final static int node_data_popup = 22;
+ final static int show_relation_confidence = 23;
+ final static int show_vector_data = 24;
+ final static int show_taxonomy_images = 25;
// ------------------
// Click-to options
// ------------------
{ "Phylogram", "display", "?" }, { "Node Name", "display", "yes" }, { "Taxonomy Code", "display", "yes" },
{ "Annotation", "nodisplay", "no" }, { "Confidence Value", "display", "?" }, { "Event", "display", "?" },
{ "Taxonomy Colorize", "display", "yes" }, { "Colorize Branches", "display", "no" },
- { "Use Branch-Width", "nodisplay", "no" }, { "Domains", "nodisplay", "no" },
- { "Binary Characters", "nodisplay", "no" }, { "Binary Char Counts", "nodisplay", "no" },
- { "Prot/Gene Name", "display", "no" }, { "Prot/Gene Acc", "display", "no" },
- { "Show Internal Data", "display", "yes" }, { "Dyna Hide", "display", "yes" },
- { "Taxonomy Scientific", "display", "yes" }, { "Taxonomy Common", "display", "no" },
- { "Annotation Colorize", "nodisplay", "no" }, { "Property", "nodisplay", "no" },
- { "Prot/Gene Symbol", "display", "no" }, { "Rollover", "display", "yes" },
- { "Relation Confidence", "display", "no" }, { "Vector Data", "display", "no" },
- { "Taxonomy Images", "display", "no" } };
+ { "Use Branch-Widths", "display", "no" }, { "Show Custom Nodes", "display", "yes" },
+ { "Domains", "nodisplay", "no" }, { "Binary Characters", "nodisplay", "no" },
+ { "Binary Char Counts", "nodisplay", "no" }, { "Prot/Gene Name", "display", "yes" },
+ { "Prot/Gene Acc", "display", "no" }, { "Show Internal Data", "display", "yes" },
+ { "Dyna Hide", "display", "yes" }, { "Taxonomy Scientific", "display", "yes" },
+ { "Taxonomy Common", "display", "no" }, { "Annotation Colorize", "nodisplay", "no" },
+ { "Property", "nodisplay", "no" }, { "Prot/Gene Symbol", "display", "yes" },
+ { "Rollover", "display", "yes" }, { "Relation Confidence", "display", "no" },
+ { "Vector Data", "display", "no" }, { "Taxonomy Images", "display", "no" } };
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", "nodisplay" }, { "Open Taxonomy Web", "nodisplay" }, { "Cut 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", "display" } };
+ { "Add New Node", "display" }, { "Edit Node Data", "display" }, { "Blast", "nodisplay" } };
// This option is selected in the dropdown
int default_clickto = Configuration.display_node_data;
// --------------
}
}
- Configuration( final String cf, final boolean is_url, final boolean is_applet ) {
+ public Configuration( final String cf, final boolean is_url, final boolean is_applet ) {
if ( ForesterUtil.isEmpty( cf ) ) {
config_filename = default_config_filename;
}
return _graphics_export_y;
}
- int getDefaultBootstrapSamples() {
+ public int getDefaultBootstrapSamples() {
return _default_bootstrap_samples;
}
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" ) ) {
+ setShowDefaultNodeShapes( parseBoolean( ( ( String ) st.nextElement() ).trim() ) );
+ }
+ else if ( key.equals( "default_node_size" ) ) {
+ final short i = parseShort( ( ( String ) st.nextElement() ).trim() );
+ setDefaultNodeShapeSize( i );
+ }
+ else if ( key.equals( "default_node_fill" ) ) {
+ final String fill_str = ( ( String ) st.nextElement() ).trim();
+ if ( fill_str.equalsIgnoreCase( NodeVisualization.NodeFill.NONE.toString() ) ) {
+ setDefaultNodeFill( NodeFill.NONE );
+ }
+ else if ( fill_str.equalsIgnoreCase( NodeVisualization.NodeFill.GRADIENT.toString() ) ) {
+ setDefaultNodeFill( NodeFill.GRADIENT );
+ }
+ else if ( fill_str.equalsIgnoreCase( NodeVisualization.NodeFill.SOLID.toString() ) ) {
+ setDefaultNodeFill( NodeFill.SOLID );
+ }
+ else {
+ ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + fill_str
+ + "] for [default_node_fill]" );
+ }
+ }
+ else if ( key.equals( "default_node_shape" ) ) {
+ final String shape_str = ( ( String ) st.nextElement() ).trim();
+ if ( shape_str.equalsIgnoreCase( NodeVisualization.NodeShape.CIRCLE.toString() ) ) {
+ setDefaultNodeShape( NodeShape.CIRCLE );
+ }
+ else if ( shape_str.equalsIgnoreCase( NodeVisualization.NodeShape.RECTANGLE.toString() ) ) {
+ setDefaultNodeShape( NodeShape.RECTANGLE );
+ }
+ else {
+ ForesterUtil.printWarningMessage( Constants.PRG_NAME, "unknown value [" + shape_str
+ + "] for [default_node_shape]" );
+ }
+ }
+ else if ( key.equals( "taxonomy_colorize_node_shapes" ) ) {
+ setTaxonomyColorizeNodeShapes( parseBoolean( ( String ) st.nextElement() ) );
+ }
else if ( st.countTokens() >= 2 ) { // counts the tokens that are not
// yet retrieved!
int key_index = -1;
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();
public boolean isAbbreviateScientificTaxonNames() {
return _abbreviate_scientific_names;
}
+
+ public NodeShape getDefaultNodeShape() {
+ return _default_node_shape;
+ }
+
+ private void setDefaultNodeShape( final NodeShape default_node_shape ) {
+ _default_node_shape = default_node_shape;
+ }
+
+ private void setDefaultNodeFill( final NodeFill default_node_fill ) {
+ _default_node_fill = default_node_fill;
+ }
+
+ public NodeFill getDefaultNodeFill() {
+ return _default_node_fill;
+ }
+
+ private void setDefaultNodeShapeSize( final short default_node_shape_size ) {
+ _default_node_shape_size = default_node_shape_size;
+ }
+
+ public short getDefaultNodeShapeSize() {
+ return _default_node_shape_size;
+ }
+
+ private void setTaxonomyColorizeNodeShapes( final boolean taxonomy_colorize_node_shapes ) {
+ _taxonomy_colorize_node_shapes = taxonomy_colorize_node_shapes;
+ }
+
+ public boolean isTaxonomyColorizeNodeShapes() {
+ return _taxonomy_colorize_node_shapes;
+ }
+
+ public boolean isShowDefaultNodeShapes() {
+ return _show_default_node_shapes;
+ }
+
+ private void setShowDefaultNodeShapes( final boolean show_default_node_shapes ) {
+ _show_default_node_shapes = show_default_node_shapes;
+ }
}