X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Farchaeopteryx%2FMainFrame.java;h=ec2e600888139d4c60330fdb578930e497390a65;hb=04275071ecc44e04eaf6006397eae0b86514cc75;hp=ded33a8514be3336ad9d13a01f2d356ffc2642fe;hpb=f2560d91ad4d0e4fb8b150f5ebeefb405d669bde;p=jalview.git diff --git a/forester/java/src/org/forester/archaeopteryx/MainFrame.java b/forester/java/src/org/forester/archaeopteryx/MainFrame.java index ded33a8..ec2e600 100644 --- a/forester/java/src/org/forester/archaeopteryx/MainFrame.java +++ b/forester/java/src/org/forester/archaeopteryx/MainFrame.java @@ -20,7 +20,7 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA // // Contact: phylosoft @ gmail . com -// WWW: www.phylosoft.org/forester +// WWW: https://sites.google.com/site/cmzmasek/home/software/forester package org.forester.archaeopteryx; @@ -101,7 +101,8 @@ public abstract class MainFrame extends JFrame implements ActionListener { static final String SCREEN_ANTIALIAS_LABEL = "Antialias"; static final String COLOR_LABELS_LABEL = "Colorize Labels Same as Parent Branch"; static final String BG_GRAD_LABEL = "Background Color Gradient"; - static final String DISPLAY_NODE_BOXES_LABEL = "Show Node Shapes"; + static final String DISPLAY_NODE_BOXES_LABEL_EXT = "Show External Node Shapes"; + static final String DISPLAY_NODE_BOXES_LABEL_INT = "Show Internal Node Shapes"; static final String SHOW_OVERVIEW_LABEL = "Show Overview"; static final String FONT_SIZE_MENU_LABEL = "Font Size"; static final String NONUNIFORM_CLADOGRAMS_LABEL = "External Node Sum Dependent Cladograms"; @@ -170,7 +171,8 @@ public abstract class MainFrame extends JFrame implements ActionListener { JCheckBoxMenuItem _color_labels_same_as_parent_branch; JMenuItem _overview_placment_mi; JMenuItem _choose_minimal_confidence_mi; - JCheckBoxMenuItem _show_default_node_shapes_cbmi; + JCheckBoxMenuItem _show_default_node_shapes_internal_cbmi; + JCheckBoxMenuItem _show_default_node_shapes_external_cbmi; JMenuItem _cycle_node_shape_mi; JMenuItem _cycle_node_fill_mi; JMenuItem _choose_node_size_mi; @@ -208,7 +210,6 @@ public abstract class MainFrame extends JFrame implements ActionListener { JCheckBoxMenuItem _circular_type_cbmi; // view as text menu: JMenuItem _view_as_NH_item; - JMenuItem _view_as_NHX_item; JMenuItem _view_as_XML_item; JMenuItem _view_as_nexus_item; JMenuItem _display_basic_information_item; @@ -231,8 +232,6 @@ public abstract class MainFrame extends JFrame implements ActionListener { InferenceManager _inference_manager; final ProcessPool _process_pool; private String _previous_node_annotation_ref; - private String _ext_node_data_buffer = ""; - private int _ext_node_data_buffer_change_counter = 0; MainFrame() { _process_pool = ProcessPool.createInstance(); @@ -299,9 +298,6 @@ public abstract class MainFrame extends JFrame implements ActionListener { else if ( o == _view_as_NH_item ) { viewAsNH(); } - else if ( o == _view_as_NHX_item ) { - viewAsNHX(); - } else if ( o == _view_as_XML_item ) { viewAsXML(); } @@ -372,7 +368,10 @@ public abstract class MainFrame extends JFrame implements ActionListener { else if ( o == _color_labels_same_as_parent_branch ) { updateOptions( getOptions() ); } - else if ( o == _show_default_node_shapes_cbmi ) { + else if ( o == _show_default_node_shapes_internal_cbmi ) { + updateOptions( getOptions() ); + } + else if ( o == _show_default_node_shapes_external_cbmi ) { updateOptions( getOptions() ); } else if ( o == _taxonomy_colorize_node_shapes_cbmi ) { @@ -500,11 +499,15 @@ public abstract class MainFrame extends JFrame implements ActionListener { * @return current external node data as String */ public String getCurrentExternalNodesDataBuffer() { - return _ext_node_data_buffer; + return getCurrentTreePanel().getCurrentExternalNodesDataBufferAsString(); + } + + public int getCurrentExternalNodesDataBufferChangeCounter() { + return getCurrentTreePanel().getCurrentExternalNodesDataBufferChangeCounter(); } - public int getExtNodeDataBufferChangeCounter() { - return _ext_node_data_buffer_change_counter; + public int getCurrentExternalNodesDataBufferLength() { + return getCurrentTreePanel().getCurrentExternalNodesDataBufferAsString().length(); } public InferenceManager getInferenceManager() { @@ -523,10 +526,6 @@ public abstract class MainFrame extends JFrame implements ActionListener { return _process_pool; } - public void increaseExtNodeDataBufferChangeCounter() { - _ext_node_data_buffer_change_counter++; - } - public void showTextFrame( final String s, final String title ) { checkTextFrames(); _textframes.addLast( TextFrame.instantiate( s, title, _textframes ) ); @@ -632,11 +631,9 @@ public abstract class MainFrame extends JFrame implements ActionListener { _view_jmenu.addSeparator(); _view_jmenu.add( _view_as_XML_item = new JMenuItem( "View as phyloXML" ) ); _view_jmenu.add( _view_as_NH_item = new JMenuItem( "View as Newick" ) ); - _view_jmenu.add( _view_as_NHX_item = new JMenuItem( "View as NHX" ) ); _view_jmenu.add( _view_as_nexus_item = new JMenuItem( "View as Nexus" ) ); customizeJMenuItem( _display_basic_information_item ); customizeJMenuItem( _view_as_NH_item ); - customizeJMenuItem( _view_as_NHX_item ); customizeJMenuItem( _view_as_XML_item ); customizeJMenuItem( _view_as_nexus_item ); _jmenubar.add( _view_jmenu ); @@ -891,7 +888,7 @@ public abstract class MainFrame extends JFrame implements ActionListener { sb.append( "Website: " + Constants.PHYLOXML_WEB_SITE + "\n" ); sb.append( "Version: " + ForesterConstants.PHYLO_XML_VERSION + "\n" ); sb.append( "\n" ); - sb.append( "For more information: http://www.phylosoft.org/archaeopteryx/\n" ); + sb.append( "For more information: https://sites.google.com/site/cmzmasek/home/software/archaeopteryx\n" ); sb.append( "Email: " + Constants.AUTHOR_EMAIL + "\n\n" ); TextFrame.instantiate( sb.toString(), "Help", _textframes ); } @@ -966,16 +963,6 @@ public abstract class MainFrame extends JFrame implements ActionListener { _configuration = configuration; } - void setCurrentExternalNodesDataBuffer( final String s ) { - increaseExtNodeDataBufferChangeCounter(); - if ( !ForesterUtil.isEmpty( s ) ) { - _ext_node_data_buffer = s.trim(); - } - else { - _ext_node_data_buffer = ""; - } - } - void setInferenceManager( final InferenceManager i ) { _inference_manager = i; } @@ -1079,8 +1066,10 @@ public abstract class MainFrame extends JFrame implements ActionListener { && _abbreviate_scientific_names.isSelected() ); options.setColorLabelsSameAsParentBranch( ( _color_labels_same_as_parent_branch != null ) && _color_labels_same_as_parent_branch.isSelected() ); - options.setShowDefaultNodeShapes( ( _show_default_node_shapes_cbmi != null ) - && _show_default_node_shapes_cbmi.isSelected() ); + options.setShowDefaultNodeShapesInternal( ( _show_default_node_shapes_internal_cbmi != null ) + && _show_default_node_shapes_internal_cbmi.isSelected() ); + options.setShowDefaultNodeShapesExternal( ( _show_default_node_shapes_external_cbmi != null ) + && _show_default_node_shapes_external_cbmi.isSelected() ); options.setTaxonomyColorizeNodeShapes( ( _taxonomy_colorize_node_shapes_cbmi != null ) && _taxonomy_colorize_node_shapes_cbmi.isSelected() ); if ( ( _non_lined_up_cladograms_rbmi != null ) && ( _non_lined_up_cladograms_rbmi.isSelected() ) ) { @@ -1210,16 +1199,6 @@ public abstract class MainFrame extends JFrame implements ActionListener { } } - void viewAsNHX() { - if ( ( _mainpanel.getCurrentPhylogeny() != null ) && !_mainpanel.getCurrentPhylogeny().isEmpty() ) { - String title = "NHX"; - if ( !ForesterUtil.isEmpty( _mainpanel.getCurrentPhylogeny().getName() ) ) { - title = _mainpanel.getCurrentPhylogeny().getName() + " " + title; - } - showTextFrame( _mainpanel.getCurrentPhylogeny().toNewHampshireX(), title ); - } - } - void viewAsXML() { if ( ( _mainpanel.getCurrentPhylogeny() != null ) && !_mainpanel.getCurrentPhylogeny().isEmpty() ) { String title = "phyloXML"; @@ -1381,7 +1360,7 @@ public abstract class MainFrame extends JFrame implements ActionListener { */ static void about() { final StringBuffer about = new StringBuffer( "Archaeopteryx\nVersion " + Constants.VERSION + "\n" ); - about.append( "Copyright (C) 2007-2012 Christian M. Zmasek\n" ); + about.append( "Copyright (C) 2013 Christian M. Zmasek\n" ); about.append( "All Rights Reserved\n" ); about.append( "License: GNU Lesser General Public License (LGPL)\n" ); about.append( "Last modified: " + Constants.PRG_DATE + "\n" );