private JMenuItem _gsdi_item;
private JMenuItem _gsdir_item;
private Phylogeny _species_tree;
+
+ private JCheckBoxMenuItem _right_line_up_domains_cbmi;
+ private JCheckBoxMenuItem _line_up_renderable_data_cbmi;
+
@Override
public void actionPerformed( final ActionEvent e ) {
else if ( o == _color_by_taxonomic_group_cbmi ) {
updateOptions( getOptions() );
}
+ else if ( o == _right_line_up_domains_cbmi ) {
+ updateOptions( getOptions() );
+ }
+ else if ( o == _line_up_renderable_data_cbmi ) {
+ updateOptions( getOptions() );
+ }
+
+
repaint();
}
.add( _show_default_node_shapes_external_cbmi = new JCheckBoxMenuItem( MainFrame.DISPLAY_NODE_BOXES_LABEL_EXT ) );
if ( getConfiguration().doDisplayOption( Configuration.show_domain_architectures ) ) {
_options_jmenu.add( _show_domain_labels = new JCheckBoxMenuItem( MainFrame.SHOW_DOMAIN_LABELS_LABEL ) );
+ _options_jmenu.add( _right_line_up_domains_cbmi = new JCheckBoxMenuItem( MainFrame.RIGHT_LINE_UP_DOMAINS ) );
}
+ _options_jmenu.add( _line_up_renderable_data_cbmi = new JCheckBoxMenuItem( MainFrame.LINE_UP_RENDERABLE_DATA ) );
_options_jmenu.add( _show_annotation_ref_source = new JCheckBoxMenuItem( MainFrame.SHOW_ANN_REF_SOURCE_LABEL ) );
_options_jmenu.add( _show_confidence_stddev_cbmi = new JCheckBoxMenuItem( MainFrame.SHOW_CONF_STDDEV_LABEL ) );
_options_jmenu
if ( ( _color_by_taxonomic_group_cbmi != null ) && _color_by_taxonomic_group_cbmi.isEnabled() ) {
options.setColorByTaxonomicGroup( _color_by_taxonomic_group_cbmi.isSelected() );
}
+
+
+ if ( ( _right_line_up_domains_cbmi != null ) && _right_line_up_domains_cbmi.isEnabled() ) {
+ options.setRightLineUpDomains( _right_line_up_domains_cbmi.isSelected() );
+ }
+
+
+ if ( ( _line_up_renderable_data_cbmi != null ) && _line_up_renderable_data_cbmi.isEnabled() ) {
+ options.setLineUpRendarableNodeData( _line_up_renderable_data_cbmi.isSelected() );
+ }
+
}
void updateTypeCheckboxes( final Options options, final Object o ) {
import java.util.NoSuchElementException;\r
\r
import javax.swing.Box;\r
+import javax.swing.Icon;\r
import javax.swing.JApplet;\r
import javax.swing.JCheckBoxMenuItem;\r
import javax.swing.JFrame;\r
static final String USE_BRACKETS_FOR_CONF_IN_NH_LABEL = "Use Brackets for Confidence Values";\r
static final String USE_INTERNAL_NAMES_FOR_CONF_IN_NH_LABEL = "Use Internal Node Names for Confidence Values";\r
static final String SHOW_BASIC_TREE_INFORMATION_LABEL = "Basic Tree Information";\r
+ static final String RIGHT_LINE_UP_DOMAINS = "Right-align Domain Architectures";\r
+ static final String LINE_UP_RENDERABLE_DATA = "Line Up Node Diagrams";\r
JMenuBar _jmenubar;\r
JMenu _file_jmenu;\r
JMenu _tools_menu;\r
JMenuItem _cycle_node_fill_mi;\r
JMenuItem _choose_node_size_mi;\r
JCheckBoxMenuItem _show_confidence_stddev_cbmi;\r
+ JCheckBoxMenuItem _right_line_up_domains_cbmi;\r
+ JCheckBoxMenuItem _line_up_renderable_data_cbmi;\r
// _ print\r
JCheckBoxMenuItem _graphics_export_visible_only_cbmi;\r
JCheckBoxMenuItem _antialias_print_cbmi;\r
getCurrentTreePanel().updateOvSizes();\r
}\r
}\r
+ else if ( o == _line_up_renderable_data_cbmi ) {\r
+ updateOptions( getOptions() );\r
+ }\r
+ else if ( o == _right_line_up_domains_cbmi ) {\r
+ updateOptions( getOptions() );\r
+ }\r
+ \r
+ \r
else if ( ( o == _rectangular_type_cbmi ) || ( o == _triangular_type_cbmi ) || ( o == _curved_type_cbmi )\r
|| ( o == _convex_type_cbmi ) || ( o == _euro_type_cbmi ) || ( o == _rounded_type_cbmi )\r
|| ( o == _unrooted_type_cbmi ) || ( o == _circular_type_cbmi ) ) {\r
else if ( ( _circular_type_cbmi != null ) && _circular_type_cbmi.isSelected() ) {\r
options.setPhylogenyGraphicsType( PHYLOGENY_GRAPHICS_TYPE.CIRCULAR );\r
}\r
+ if ( ( _right_line_up_domains_cbmi != null ) && _right_line_up_domains_cbmi.isEnabled() ) {\r
+ options.setRightLineUpDomains( _right_line_up_domains_cbmi.isSelected() );\r
+ }\r
+ \r
+ \r
+ if ( ( _line_up_renderable_data_cbmi != null ) && _line_up_renderable_data_cbmi.isEnabled() ) {\r
+ options.setLineUpRendarableNodeData( _line_up_renderable_data_cbmi.isSelected() );\r
+ }\r
}\r
\r
void updateTypeCheckboxes( final Options options, final Object o ) {\r
private File _seqs_file = null;\r
JMenuItem _read_values_jmi;\r
JMenuItem _read_seqs_jmi;\r
+ \r
\r
private MainFrameApplication( final Phylogeny[] phys, final Configuration config ) {\r
_configuration = config;\r
.add( _show_default_node_shapes_external_cbmi = new JCheckBoxMenuItem( DISPLAY_NODE_BOXES_LABEL_EXT ) );\r
if ( getConfiguration().doDisplayOption( Configuration.show_domain_architectures ) ) {\r
_options_jmenu.add( _show_domain_labels = new JCheckBoxMenuItem( SHOW_DOMAIN_LABELS_LABEL ) );\r
- }\r
+ _options_jmenu.add( _right_line_up_domains_cbmi = new JCheckBoxMenuItem( MainFrame.RIGHT_LINE_UP_DOMAINS ) );\r
+ }\r
+ _options_jmenu.add( _line_up_renderable_data_cbmi = new JCheckBoxMenuItem( MainFrame.LINE_UP_RENDERABLE_DATA ) );\r
+ \r
_options_jmenu.add( _show_annotation_ref_source = new JCheckBoxMenuItem( SHOW_ANN_REF_SOURCE_LABEL ) );\r
_options_jmenu.add( _show_confidence_stddev_cbmi = new JCheckBoxMenuItem( SHOW_CONF_STDDEV_LABEL ) );\r
_options_jmenu.add( _color_by_taxonomic_group_cbmi = new JCheckBoxMenuItem( COLOR_BY_TAXONOMIC_GROUP ) );\r
.getNhConversionSupportValueStyle() == NH_CONVERSION_SUPPORT_VALUE_STYLE.IN_SQUARE_BRACKETS );\r
customizeCheckBoxMenuItem( _use_internal_names_for_conf_in_nh_export_cbmi, getOptions()\r
.getNhConversionSupportValueStyle() == NH_CONVERSION_SUPPORT_VALUE_STYLE.AS_INTERNAL_NODE_NAMES );\r
+ \r
+ \r
+ customizeCheckBoxMenuItem( _line_up_renderable_data_cbmi, getOptions().isLineUpRendarableNodeData()\r
+ );\r
+ \r
+ customizeCheckBoxMenuItem( _right_line_up_domains_cbmi, getOptions().isRightLineUpDomains() );\r
_jmenubar.add( _options_jmenu );\r
}\r
\r
import org.forester.phylogeny.data.NodeVisualData.NodeFill;
import org.forester.phylogeny.data.NodeVisualData.NodeShape;
import org.forester.util.ForesterUtil;
+import org.omg.stub.java.rmi._Remote_Stub;
/*
* This is to hold changeable options.
private boolean _show_overview;
private boolean _show_scale;
private TAXONOMY_EXTRACTION _taxonomy_extraction;
+ private boolean _line_up_renderable_node_data;
+ private boolean _right_align_domains;
private Options() {
init();
_show_confidence_stddev = true;
_nh_conversion_support_value_style = NH_CONVERSION_SUPPORT_VALUE_STYLE.NONE;
_ext_desc_data_to_return = NODE_DATA.UNKNOWN;
+ _line_up_renderable_node_data = false;
+ _right_align_domains = false;
}
final private void setNumberOfDigitsAfterCommaForBranchLength( final short number_of_digits_after_comma_for_branch_length_values ) {
return toString().replaceAll( " ", "_" );
}
}
+
+ 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;
+ }
+
}
final int h = y < default_height ? ForesterUtil.roundToInt( y ) : default_height;
rds.setRenderingHeight( h > 1 ? h : 2 );
if ( getControlPanel().isDrawPhylogram() ) {
- rds.render( node.getXcoord() + x, node.getYcoord() - ( h / 2 ), g, this, to_pdf );
+ if ( getOptions().isLineUpRendarableNodeData() ) {
+ length_of_longest_text = calcLengthOfLongestText();
+
+ rds.render( getMaxDistanceToRoot() * getXcorrectionFactor() + length_of_longest_text, node.getYcoord() - ( h / 2 ), g, this, to_pdf );
+ }
+ else {
+ rds.render( node.getXcoord() + x, node.getYcoord() - ( h / 2 ), g, this, to_pdf );
+ }
}
else {
length_of_longest_text = calcLengthOfLongestText();
}\r
return max;\r
}\r
+ \r
+ public static PhylogenyNode calculateNodeWithMaxDistanceToRoot( final Phylogeny phy ) {\r
+ double max = 0.0;\r
+ PhylogenyNode max_node = phy.getFirstExternalNode();\r
+ for( final PhylogenyNodeIterator iter = phy.iteratorExternalForward(); iter.hasNext(); ) {\r
+ final PhylogenyNode node = iter.next();\r
+ final double d = node.calculateDistanceToRoot();\r
+ if ( d > max ) {\r
+ max = d;\r
+ max_node = node;\r
+ }\r
+ }\r
+ return max_node;\r
+ }\r
\r
public static int calculateNumberOfExternalNodesWithoutTaxonomy( final PhylogenyNode node ) {\r
final List<PhylogenyNode> descs = node.getAllExternalDescendants();\r