import java.awt.Font;
+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;
/*
*/
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 NodeShape _default_node_shape;
- private short _default_node_shape_size;
- private boolean _taxonomy_colorize_node_shapes_instead_of_labels;
-
- enum NodeShape {
- NONE,
- CIRCLE_WITH_GRADIENT,
- CIRCLE_SOLID,
- CIRCLE_HOLLOW,
- RECTANGLE_WITH_GRADIENT,
- RECTANGLE_SOLID,
- RECTANGLE_HOLLOW;
- }
+ 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;
private Options() {
init();
return _cladogram_type;
}
+ final NodeFill getDefaultNodeFill() {
+ return _default_node_fill;
+ }
+
+ final NodeShape getDefaultNodeShape() {
+ return _default_node_shape;
+ }
+
+ final short getDefaultNodeShapeSize() {
+ return _default_node_shape_size;
+ }
+
final double getMinConfidenceValue() {
return _min_confidence_value;
}
}
final private void init() {
- _default_node_shape = NodeShape.RECTANGLE_WITH_GRADIENT;
+ _default_node_shape = NodeShape.CIRCLE;
+ _default_node_fill = NodeFill.GRADIENT;
+ _default_node_shape_size = Constants.DEFAULT_NODE_SHAPE_SIZE_DEFAULT;
+ _taxonomy_colorize_node_shapes = false;
_show_branch_length_values = false;
_internal_number_are_confidence_for_nh_parsing = false;
_show_scale = false;
_graphics_export_visible_only = false;
_editable = true;
_background_color_gradient = false;
+ _show_default_node_shapes = false;
if ( Util.isUsOrCanada() ) {
_print_size_x = Constants.US_LETTER_SIZE_X;
_print_size_y = Constants.US_LETTER_SIZE_Y;
_color_labels_same_as_parent_branch = false;
}
+ final boolean isAbbreviateScientificTaxonNames() {
+ return _abbreviate_scientific_names;
+ }
+
+ boolean isAllowMagnificationOfTaxonomyImages() {
+ return true;
+ }
+
final boolean isAntialiasPrint() {
return _antialias_print;
}
return _background_color_gradient;
}
- public final boolean isShowDomainLabels() {
- return _show_domain_labels;
- }
-
final boolean isColorLabelsSameAsParentBranch() {
return _color_labels_same_as_parent_branch;
}
return _show_branch_length_values;
}
- final NodeShape getDefaultNodeShape() {
- return _default_node_shape;
+ public final boolean isShowDomainLabels() {
+ return _show_domain_labels;
}
final boolean isShowOverview() {
return _show_scale;
}
+ boolean isTaxonomyColorizeNodeShapes() {
+ return _taxonomy_colorize_node_shapes;
+ }
+
+ final void setAbbreviateScientificTaxonNames( final boolean abbreviate_scientific_names ) {
+ _abbreviate_scientific_names = abbreviate_scientific_names;
+ }
+
final void setAntialiasPrint( final boolean antialias_print ) {
_antialias_print = antialias_print;
}
_background_color_gradient = background_color_gradient;
}
- public void setShowDomainLabels( final boolean show_domain_labels ) {
- _show_domain_labels = show_domain_labels;
+ final void setBaseFont( final Font base_font ) {
+ _base_font = base_font;
+ }
+
+ final void setCladogramType( final CLADOGRAM_TYPE cladogram_type ) {
+ _cladogram_type = cladogram_type;
}
public void setColorLabelsSameAsParentBranch( final boolean color_labels_same_as_parent_branch ) {
_color_labels_same_as_parent_branch = color_labels_same_as_parent_branch;
}
- final void setBaseFont( final Font base_font ) {
- _base_font = base_font;
+ final void setDefaultNodeFill( final NodeFill default_node_fill ) {
+ _default_node_fill = default_node_fill;
}
- final void setCladogramType( final CLADOGRAM_TYPE cladogram_type ) {
- _cladogram_type = cladogram_type;
+ final void setDefaultNodeShape( final NodeShape default_node_shape ) {
+ _default_node_shape = default_node_shape;
+ }
+
+ final void setDefaultNodeShapeSize( final short default_node_shape_size ) {
+ _default_node_shape_size = default_node_shape_size;
}
final void setEditable( final boolean editable ) {
_show_branch_length_values = show_branch_length_values;
}
- final void setDefaultNodeShape( final NodeShape default_node_shape ) {
- _default_node_shape = default_node_shape;
+ public void setShowDomainLabels( final boolean show_domain_labels ) {
+ _show_domain_labels = show_domain_labels;
}
final void setShowOverview( final boolean show_overview ) {
_show_scale = show_scale;
}
+ void setTaxonomyColorizeNodeShapes( final boolean taxonomy_colorize_node_shapes ) {
+ _taxonomy_colorize_node_shapes = taxonomy_colorize_node_shapes;
+ }
+
final static Options createDefaultInstance() {
return new Options();
}
- final static Options createInstance( final Configuration configuration ) {
+ boolean isShowDefaultNodeShapes() {
+ return _show_default_node_shapes;
+ }
+
+ void setShowDefaultNodeShapes( final boolean show_default_node_shapes ) {
+ _show_default_node_shapes = show_default_node_shapes;
+ }
+
+ public final static Options createInstance( final Configuration configuration ) {
final Options instance = createDefaultInstance();
if ( configuration != null ) {
instance.setAntialiasScreen( configuration.isAntialiasScreen() );
if ( configuration.getPhylogenyGraphicsType() != null ) {
instance.setPhylogenyGraphicsType( configuration.getPhylogenyGraphicsType() );
}
+ if ( configuration.getDefaultNodeFill() != null ) {
+ instance.setDefaultNodeFill( configuration.getDefaultNodeFill() );
+ }
+ if ( configuration.getDefaultNodeShape() != null ) {
+ instance.setDefaultNodeShape( configuration.getDefaultNodeShape() );
+ }
+ if ( configuration.getDefaultNodeShapeSize() >= 0 ) {
+ instance.setDefaultNodeShapeSize( configuration.getDefaultNodeShapeSize() );
+ }
+ instance.setTaxonomyColorizeNodeShapes( configuration.isTaxonomyColorizeNodeShapes() );
+ instance.setShowDefaultNodeShapes( configuration.isShowDefaultNodeShapes() );
}
return instance;
}
- final void setAbbreviateScientificTaxonNames( final boolean abbreviate_scientific_names ) {
- _abbreviate_scientific_names = abbreviate_scientific_names;
- }
-
- final boolean isAbbreviateScientificTaxonNames() {
- return _abbreviate_scientific_names;
- }
-
static enum CLADOGRAM_TYPE {
NON_LINED_UP, EXT_NODE_SUM_DEP, TOTAL_NODE_SUM_DEP;
}
static enum PHYLOGENY_GRAPHICS_TYPE {
RECTANGULAR, TRIANGULAR, EURO_STYLE, ROUNDED, CONVEX, CURVED, UNROOTED, CIRCULAR;
}
-
- boolean isAllowMagnificationOfTaxonomyImages() {
- return true;
- }
-
- int getDefaultNodeBoxSize() {
- // TODO make variable ~~
- return 8;
- }
}