import java.io.File;\r
import java.io.IOException;\r
import java.util.ArrayList;\r
-import java.util.HashSet;\r
import java.util.LinkedList;\r
import java.util.List;\r
import java.util.Locale;\r
import java.util.NoSuchElementException;\r
-import java.util.Set;\r
\r
import javax.swing.Box;\r
import javax.swing.JApplet;\r
import org.forester.phylogeny.PhylogenyNode;\r
import org.forester.phylogeny.PhylogenyNode.NH_CONVERSION_SUPPORT_VALUE_STYLE;\r
import org.forester.phylogeny.data.Annotation;\r
+import org.forester.phylogeny.data.NodeDataField;\r
import org.forester.phylogeny.data.NodeVisualData.NodeFill;\r
import org.forester.phylogeny.data.NodeVisualData.NodeShape;\r
import org.forester.phylogeny.iterators.PhylogenyNodeIterator;\r
public abstract class MainFrame extends JFrame implements ActionListener {\r
\r
static final String USE_MOUSEWHEEL_SHIFT_TO_ROTATE = "In this display type, use mousewheel + Shift to rotate [or A and S]";\r
- static final String PHYLOXML_REF_TOOL_TIP = Constants.PHYLOXML_REFERENCE; //TODO //FIXME\r
+ static final String PHYLOXML_REF_TOOL_TIP = Constants.PHYLOXML_REFERENCE; //TODO //FIXME\r
static final String APTX_REF_TOOL_TIP = Constants.APTX_REFERENCE;\r
private static final long serialVersionUID = 3655000897845508358L;\r
final static Font menu_font = new Font( Configuration.getDefaultFontFamilyName(),\r
static final String TRIANGULAR_TYPE_CBMI_LABEL = "Triangular";\r
static final String CONVEX_TYPE_CBMI_LABEL = "Convex";\r
static final String ROUNDED_TYPE_CBMI_LABEL = "Rounded";\r
- static final String UNROOTED_TYPE_CBMI_LABEL = "Unrooted (alpha)"; //TODO\r
- static final String CIRCULAR_TYPE_CBMI_LABEL = "Circular (alpha)"; //TODO\r
+ static final String UNROOTED_TYPE_CBMI_LABEL = "Unrooted (alpha)"; //TODO\r
+ static final String CIRCULAR_TYPE_CBMI_LABEL = "Circular (alpha)"; //TODO\r
static final String OPTIONS_HEADER = "Options";\r
static final String SEARCH_SUBHEADER = "Search:";\r
static final String DISPLAY_SUBHEADER = "Display:";\r
static final String SEARCH_TERMS_ONLY_LABEL = "Match Complete Terms Only";\r
+ static final String SEARCH_REGEX_LABEL = "Search with Regular Expressions";\r
static final String SEARCH_CASE_SENSITIVE_LABEL = "Case Sensitive";\r
static final String INVERSE_SEARCH_RESULT_LABEL = "Negate Result";\r
- static final String DISPLAY_BRANCH_LENGTH_VALUES_LABEL = "Branch Length Values";\r
static final String COLOR_BY_TAXONOMIC_GROUP = "Colorize by Taxonomic Group";\r
static final String DISPLAY_SCALE_LABEL = "Scale";\r
static final String NON_LINED_UP_CLADOGRAMS_LABEL = "Non-Lined Up Cladograms";\r
static final String UNIFORM_CLADOGRAMS_LABEL = "Total Node Sum Dependent Cladograms";\r
static final String LABEL_DIRECTION_LABEL = "Radial Labels";\r
static final String LABEL_DIRECTION_TIP = "To use radial node labels in radial and unrooted display types";\r
+ static final String SEARCH_WITH_REGEX_TIP = "To search using regular expressions (~Java/Perl syntax). For example, use \"^B.+\\d{2,}$\" to search for everything starting with a B and ending with at least two digits.";\r
static final String SCREEN_ANTIALIAS_LABEL = "Antialias";\r
static final String COLOR_LABELS_LABEL = "Colorize Labels Same as Parent Branch";\r
static final String BG_GRAD_LABEL = "Background Color Gradient";\r
- static final String DISPLAY_NODE_BOXES_LABEL_EXT = "External Node Shapes";\r
- static final String DISPLAY_NODE_BOXES_LABEL_INT = "Internal Node Shapes";\r
+ static final String DISPLAY_NODE_BOXES_LABEL_EXT = "Shapes for External Nodes";\r
+ static final String DISPLAY_NODE_BOXES_LABEL_INT = "Shapes for Internal Nodes";\r
+ static final String DISPLAY_NODE_BOXES_LABEL_MARKED = "Shapes for Nodes with Visual Data";\r
static final String SHOW_OVERVIEW_LABEL = "Overview";\r
static final String FONT_SIZE_MENU_LABEL = "Font Size";\r
static final String NONUNIFORM_CLADOGRAMS_LABEL = "External Node Sum Dependent Cladograms";\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 Diagrams (such as Domain Architectures)";\r
JMenuBar _jmenubar;\r
JMenu _file_jmenu;\r
JMenu _tools_menu;\r
JMenuItem _confcolor_item;\r
JMenuItem _color_rank_jmi;\r
JMenuItem _collapse_species_specific_subtrees;\r
- JMenuItem _collapse_below_threshold; //TODO implememt me\r
JMenuItem _obtain_detailed_taxonomic_information_jmi;\r
JMenuItem _obtain_detailed_taxonomic_information_deleting_jmi;\r
JMenuItem _obtain_seq_information_jmi;\r
JRadioButtonMenuItem _non_lined_up_cladograms_rbmi;\r
JRadioButtonMenuItem _uniform_cladograms_rbmi;\r
JRadioButtonMenuItem _ext_node_dependent_cladogram_rbmi;\r
- JCheckBoxMenuItem _show_branch_length_values_cbmi;\r
JCheckBoxMenuItem _color_by_taxonomic_group_cbmi;\r
- JCheckBoxMenuItem _show_scale_cbmi; //TODO fix me\r
+ JCheckBoxMenuItem _show_scale_cbmi; //TODO fix me\r
JCheckBoxMenuItem _show_overview_cbmi;\r
JCheckBoxMenuItem _show_domain_labels;\r
JCheckBoxMenuItem _show_annotation_ref_source;\r
JMenuItem _choose_minimal_confidence_mi;\r
JCheckBoxMenuItem _show_default_node_shapes_internal_cbmi;\r
JCheckBoxMenuItem _show_default_node_shapes_external_cbmi;\r
+ JCheckBoxMenuItem _show_default_node_shapes_for_marked_cbmi;\r
JMenuItem _cycle_node_shape_mi;\r
JMenuItem _cycle_node_fill_mi;\r
JMenuItem _choose_node_size_mi;\r
+ JMenuItem _cycle_data_return;\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
JCheckBoxMenuItem _search_case_senstive_cbmi;\r
JCheckBoxMenuItem _search_whole_words_only_cbmi;\r
JCheckBoxMenuItem _inverse_search_result_cbmi;\r
+ JCheckBoxMenuItem _search_with_regex_cbmi;\r
// type menu:\r
JMenu _type_menu;\r
JCheckBoxMenuItem _rectangular_type_cbmi;\r
// Handy pointers to child components:\r
MainPanel _mainpanel;\r
Container _contentpane;\r
- final LinkedList<TextFrame> _textframes = new LinkedList<TextFrame>(); ;\r
+ final LinkedList<TextFrame> _textframes = new LinkedList<TextFrame>(); ;\r
Configuration _configuration;\r
Options _options;\r
private Phylogeny _species_tree;\r
switchColors();\r
}\r
else if ( o == _display_basic_information_item ) {\r
- displayBasicInformation( getCurrentTreePanel().getTreeFile() );\r
+ if ( getCurrentTreePanel() != null ) {\r
+ displayBasicInformation( getCurrentTreePanel().getTreeFile() );\r
+ }\r
}\r
else if ( o == _view_as_NH_item ) {\r
viewAsNH();\r
MainFrame.cycleOverview( getOptions(), getCurrentTreePanel() );\r
}\r
else if ( o == _cycle_node_fill_mi ) {\r
- MainFrame.cycleNodeFill( getOptions(), getCurrentTreePanel() );\r
+ MainFrame.cycleNodeFill( getOptions() );\r
}\r
else if ( o == _cycle_node_shape_mi ) {\r
- MainFrame.cycleNodeShape( getOptions(), getCurrentTreePanel() );\r
+ MainFrame.cycleNodeShape( getOptions() );\r
+ }\r
+ else if ( o == _cycle_data_return ) {\r
+ MainFrame.cycleNodeDataReturn( getOptions(), getConfiguration() );\r
}\r
else if ( o == _screen_antialias_cbmi ) {\r
updateOptions( getOptions() );\r
else if ( o == _show_default_node_shapes_external_cbmi ) {\r
updateOptions( getOptions() );\r
}\r
+ else if ( o == _show_default_node_shapes_for_marked_cbmi ) {\r
+ updateOptions( getOptions() );\r
+ }\r
else if ( o == _non_lined_up_cladograms_rbmi ) {\r
updateOptions( getOptions() );\r
showWhole();\r
getMainPanel().getControlPanel().search1();\r
}\r
else if ( o == _search_whole_words_only_cbmi ) {\r
+ if ( ( _search_with_regex_cbmi != null ) && _search_whole_words_only_cbmi.isSelected() ) {\r
+ _search_with_regex_cbmi.setSelected( false );\r
+ }\r
updateOptions( getOptions() );\r
getMainPanel().getControlPanel().search0();\r
getMainPanel().getControlPanel().search1();\r
getMainPanel().getControlPanel().search0();\r
getMainPanel().getControlPanel().search1();\r
}\r
- else if ( o == _show_scale_cbmi ) {\r
+ else if ( o == _search_with_regex_cbmi ) {\r
+ if ( ( _search_whole_words_only_cbmi != null ) && _search_with_regex_cbmi.isSelected() ) {\r
+ _search_whole_words_only_cbmi.setSelected( false );\r
+ }\r
+ if ( ( _search_case_senstive_cbmi != null ) && _search_with_regex_cbmi.isSelected() ) {\r
+ _search_case_senstive_cbmi.setSelected( true );\r
+ }\r
updateOptions( getOptions() );\r
+ getMainPanel().getControlPanel().search0();\r
+ getMainPanel().getControlPanel().search1();\r
}\r
- else if ( o == _show_branch_length_values_cbmi ) {\r
+ else if ( o == _show_scale_cbmi ) {\r
updateOptions( getOptions() );\r
}\r
else if ( o == _color_by_taxonomic_group_cbmi ) {\r
getCurrentTreePanel().updateOvSizes();\r
}\r
}\r
+ else if ( o == _line_up_renderable_data_cbmi ) {\r
+ if ( !_line_up_renderable_data_cbmi.isSelected() ) {\r
+ _right_line_up_domains_cbmi.setSelected( false );\r
+ }\r
+ updateOptions( getOptions() );\r
+ }\r
+ else if ( o == _right_line_up_domains_cbmi ) {\r
+ if ( _right_line_up_domains_cbmi.isSelected() ) {\r
+ _line_up_renderable_data_cbmi.setSelected( true );\r
+ }\r
+ updateOptions( getOptions() );\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
about();\r
}\r
else if ( o == _help_item ) {\r
- help();\r
+ try {\r
+ AptxUtil.openWebsite( Constants.APTX_DOC_SITE, is_applet, applet );\r
+ }\r
+ catch ( final IOException e1 ) {\r
+ ForesterUtil.printErrorMessage( Constants.PRG_NAME, e1.toString() );\r
+ }\r
}\r
else if ( o == _website_item ) {\r
try {\r
_contentpane.repaint();\r
}\r
\r
- private void deleteSelectedNodes( boolean delete ) {\r
+ private void deleteSelectedNodes( final boolean delete ) {\r
final Phylogeny phy = getMainPanel().getCurrentPhylogeny();\r
- if ( phy == null || phy.getNumberOfExternalNodes() < 2 ) {\r
+ if ( ( phy == null ) || ( phy.getNumberOfExternalNodes() < 2 ) ) {\r
return;\r
}\r
- List<PhylogenyNode> nodes = null;\r
+ final List<PhylogenyNode> nodes = new ArrayList<PhylogenyNode>();\r
if ( ( getCurrentTreePanel().getFoundNodes0() != null ) || ( getCurrentTreePanel().getFoundNodes1() != null ) ) {\r
- nodes = getCurrentTreePanel().getFoundNodesAsListOfPhylogenyNodes();\r
+ final List<PhylogenyNode> all_selected_nodes = getCurrentTreePanel().getFoundNodesAsListOfPhylogenyNodes();\r
+ for( final PhylogenyNode n : all_selected_nodes ) {\r
+ if ( n.isExternal() ) {\r
+ nodes.add( n );\r
+ }\r
+ }\r
}\r
String function = "Retain";\r
if ( delete ) {\r
}\r
if ( ( nodes == null ) || nodes.isEmpty() ) {\r
JOptionPane\r
- .showMessageDialog( this,\r
- "Need to select external nodes, either via direct selection or via the \"Search\" function",\r
- "No external nodes selected to " + function.toLowerCase(),\r
- JOptionPane.ERROR_MESSAGE );\r
+ .showMessageDialog( this,\r
+ "Need to select external nodes, either via direct selection or via the \"Search\" function",\r
+ "No external nodes selected to " + function.toLowerCase(),\r
+ JOptionPane.ERROR_MESSAGE );\r
return;\r
}\r
final int todo = nodes.size();\r
return;\r
}\r
final int result = JOptionPane.showConfirmDialog( null, function + " " + todo\r
- + " external node(s), from a total of " + ext + " external nodes," + "\nresulting in tree with " + res\r
- + " nodes?", function + " external nodes", JOptionPane.OK_CANCEL_OPTION );\r
+ + " external node(s), from a total of " + ext + " external nodes," + "\nresulting in tree with " + res\r
+ + " nodes?", function + " external nodes", JOptionPane.OK_CANCEL_OPTION );\r
if ( result == JOptionPane.OK_OPTION ) {\r
if ( !delete ) {\r
final List<PhylogenyNode> to_delete = new ArrayList<PhylogenyNode>();\r
* has been selected by the user by clicking the "Return ..."\r
* menu item. This method is expected to be called from Javascript or\r
* something like it.\r
- * \r
+ *\r
* @return current external node data as String\r
*/\r
public String getCurrentExternalNodesDataBuffer() {\r
\r
void buildHelpMenu() {\r
_help_jmenu = createMenu( "Help", getConfiguration() );\r
- _help_jmenu.add( _help_item = new JMenuItem( "Help" ) );\r
+ _help_jmenu.add( _help_item = new JMenuItem( "Documentation" ) );\r
+ _help_jmenu.addSeparator();\r
_help_jmenu.add( _website_item = new JMenuItem( "Archaeopteryx Home" ) );\r
- _aptx_ref_item = new JMenuItem( "Archaeopteryx Reference" );\r
+ _aptx_ref_item = new JMenuItem( "Archaeopteryx Reference" ); //TODO need to add this...\r
_help_jmenu.add( _phyloxml_website_item = new JMenuItem( "phyloXML Home" ) );\r
_help_jmenu.add( _phyloxml_ref_item = new JMenuItem( "phyloXML Reference" ) );\r
_help_jmenu.addSeparator();\r
+ gsdi.getStrippedExternalGeneTreeNodes().size() + "\n"\r
+ "Taxonomy linkage based on: " + gsdi.getTaxCompBase() + "\n"\r
+ "Number of polytomies in species tree used: " + poly + "\n",\r
- "GSDI successfully completed",\r
- JOptionPane.WARNING_MESSAGE );\r
+ "GSDI successfully completed",\r
+ JOptionPane.WARNING_MESSAGE );\r
}\r
else {\r
JOptionPane.showMessageDialog( this,\r
+ gsdi.getStrippedExternalGeneTreeNodes().size() + "\n"\r
+ "Taxonomy linkage based on: " + gsdi.getTaxCompBase() + "\n"\r
+ "Number of polytomies in species tree used: " + poly + "\n",\r
- "GSDI successfully completed",\r
- JOptionPane.INFORMATION_MESSAGE );\r
+ "GSDI successfully completed",\r
+ JOptionPane.INFORMATION_MESSAGE );\r
}\r
}\r
\r
+ gsdir.getStrippedExternalGeneTreeNodes().size() + "\n"\r
+ "Taxonomy linkage based on: " + gsdir.getTaxCompBase() + "\n"\r
+ "Number of polytomies in species tree used: " + poly + "\n",\r
- "GSDIR successfully completed",\r
- JOptionPane.WARNING_MESSAGE );\r
+ "GSDIR successfully completed",\r
+ JOptionPane.WARNING_MESSAGE );\r
}\r
else {\r
JOptionPane.showMessageDialog( this,\r
+ gsdir.getStrippedExternalGeneTreeNodes().size() + "\n"\r
+ "Taxonomy linkage based on: " + gsdir.getTaxCompBase() + "\n"\r
+ "Number of polytomies in species tree used: " + poly + "\n",\r
- "GSDIR successfully completed",\r
- JOptionPane.INFORMATION_MESSAGE );\r
+ "GSDIR successfully completed",\r
+ JOptionPane.INFORMATION_MESSAGE );\r
}\r
}\r
\r
return _species_tree;\r
}\r
\r
- void help() {\r
- final StringBuilder sb = new StringBuilder();\r
- sb.append( "Display options\n" );\r
- sb.append( "-------------------\n" );\r
- sb.append( "Use the checkboxes to select types of information to display on the tree.\n\n" );\r
- sb.append( "Clickable tree nodes\n" );\r
- sb.append( "--------------------\n" );\r
- sb.append( "Tree nodes can be clicked, the action is determined by the 'click on node to' menu\n" );\r
- sb.append( "or by right clicking:\n" );\r
- sb.append( "o Display Node Data -- display information for a node\n" );\r
- sb.append( "o Collapse/Uncollapse -- collapse and uncollapse subtree from clicked node\n" );\r
- sb.append( "o Root/Reroot -- change tree root to clicked node\n" );\r
- sb.append( "o Sub/Super Tree -- toggle between subtree from clicked node and whole tree\n" );\r
- sb.append( "o Swap Descendants -- switch descendant on either side of clicked node\n" );\r
- sb.append( "o Colorize Subtree -- color a subtree\n" );\r
- sb.append( "o Open Sequence Web -- launch a web browser to display sequence information\n" );\r
- sb.append( "o Open Taxonomy Web -- launch a web browser to display taxonomy information\n" );\r
- sb.append( "- there may be additional choices depending on this particular setup\n\n" );\r
- sb.append( "Right clicking on a node always displays the information of a node.\n\n" );\r
- sb.append( "Zooming\n" );\r
- sb.append( "---------\n" );\r
- sb.append( "The mouse wheel and the plus and minus keys control zooming.\n" );\r
- sb.append( "Mouse wheel+Ctrl changes the text size.\n" );\r
- sb.append( "Mouse wheel+Shift controls zooming in vertical direction only.\n" );\r
- sb.append( "Use the buttons on the control panel to zoom the tree in and out, horizontally or vertically.\n" );\r
- sb.append( "The entire tree can be fitted into the window by clicking the \"F\" button, or by pressing F, Delete, or Home.\n" );\r
- sb.append( "The up, down, left, and right keys can be used to move the visible part (if zoomed in).\n" );\r
- sb.append( "Up, down, left, and right+Shift can be used to control zooming horizontally and vertically.\n" );\r
- sb.append( "Plus and minus keys+Ctrl change the text size; F+Ctrl, Delete+Ctrl, or Home+Ctrl resets it.\n\n" );\r
- sb.append( "Quick tree manipulation:\n" );\r
- sb.append( "------------------------\n" );\r
- sb.append( "Order Subtrees -- order the tree by branch length\n" );\r
- sb.append( "Uncollapse All -- uncollapse any and all collapsed branches\n\n" );\r
- sb.append( "Memory problems (Java heap space error)\n" );\r
- sb.append( "---------------------------------------\n" );\r
- sb.append( "Since the Java default memory allocation is quite small, it might by necessary (for trees\n" );\r
- sb.append( "with more than approximately 5000 external nodes) to increase the memory which Java can use, with\n" );\r
- sb.append( "the '-Xmx' Java command line option. For example:\n" );\r
- sb.append( "java -Xmx1024m -cp path\\to\\forester.jar org.forester.archaeopteryx.Archaeopteryx\n\n" );\r
- // + "General remarks\n"\r
- // + "---------------\n"\r
- // +\r
- // "o The application version permits copying to the clipboard \n"\r
- // +\r
- // " in the \"View\"|\"View as ...\" frame (either by control-c or button press).\n"\r
- // +\r
- // "o Changes made to a subtree affect this subtree and its subtrees,\n"\r
- // + " but not any of its parent tree(s).\n"\r
- // +\r
- // "o Archaeopteryx tries to detect whether the numerical values in a NH tree\n"\r
- // +\r
- // " are likely to be bootstrap values instead of branch length values.\n\n"\r
- // +\r
- // " Remarks regarding SDI (Speciation Duplication Inference):\n"\r
- // +\r
- // "o Each external node of the gene tree (in display) needs to be associated with\n"\r
- // +\r
- // " a species: either directly through the \"Species\" field, or the species\n"\r
- // +\r
- // " is part of the sequence name in the form \"XXXX_SPECIES\"\n"\r
- // +\r
- // " (e.g. \"ACON_DROME\" or \"ACON_DROME/123-4489\" which is also acceptable).\n"\r
- // +\r
- // "o A species tree for each species of the gene tree needs to be loaded with\n"\r
- // +\r
- // " \"SDI\"|\"Load species tree\" prior the SDI execution.\n"\r
- // +\r
- // "o !External nodes of the gene tree associated with species not present in\n"\r
- // +\r
- // " the species tree are REMOVED prior to SDI execution!\n"\r
- // +\r
- // "o Both the gene tree and the species tree must be completely binary.\n"\r
- // +\r
- // "o Duplications and speciations are a function of the position of the root.\n"\r
- // +\r
- // " Hence, after each manual \"Root/Reroot\"ing some duplications will be\n"\r
- // + " incorrect and need to be inferred again\n"\r
- // +\r
- // " with: \"SDI\"|\"SDI (Speciation Duplication Inference)\n\n"\r
- sb.append( "phyloXML\n" );\r
- sb.append( "-------------------\n" );\r
- sb.append( "Reference: " + Constants.PHYLOXML_REFERENCE + "\n" );\r
- sb.append( "Website: " + Constants.PHYLOXML_WEB_SITE + "\n" );\r
- sb.append( "Version: " + ForesterConstants.PHYLO_XML_VERSION + "\n" );\r
- sb.append( "\n" );\r
- sb.append( "For more information: https://sites.google.com/site/cmzmasek/home/software/archaeopteryx\n" );\r
- sb.append( "Email: " + Constants.AUTHOR_EMAIL + "\n\n" );\r
- TextFrame.instantiate( sb.toString(), "Help", _textframes );\r
- }\r
-\r
void initializeTypeMenu( final Options options ) {\r
setTypeMenuToAllUnselected();\r
switch ( options.getPhylogenyGraphicsType() ) {\r
if ( getCurrentTreePanel() != null ) {\r
if ( getCurrentTreePanel().isCurrentTreeIsSubtree() ) {\r
JOptionPane\r
- .showMessageDialog( this,\r
- "This operation can only be performed on a complete tree, not on the currently displayed sub-tree only.",\r
- "Operation can not be exectuted on a sub-tree",\r
- JOptionPane.WARNING_MESSAGE );\r
+ .showMessageDialog( this,\r
+ "This operation can only be performed on a complete tree, not on the currently displayed sub-tree only.",\r
+ "Operation can not be exectuted on a sub-tree",\r
+ JOptionPane.WARNING_MESSAGE );\r
return true;\r
}\r
}\r
void updateOptions( final Options options ) {\r
options.setAntialiasScreen( ( _screen_antialias_cbmi != null ) && _screen_antialias_cbmi.isSelected() );\r
options.setBackgroundColorGradient( ( _background_gradient_cbmi != null )\r
- && _background_gradient_cbmi.isSelected() );\r
+ && _background_gradient_cbmi.isSelected() );\r
options.setShowDomainLabels( ( _show_domain_labels != null ) && _show_domain_labels.isSelected() );\r
options.setShowAnnotationRefSource( ( _show_annotation_ref_source != null )\r
- && _show_annotation_ref_source.isSelected() );\r
+ && _show_annotation_ref_source.isSelected() );\r
options.setAbbreviateScientificTaxonNames( ( _abbreviate_scientific_names != null )\r
- && _abbreviate_scientific_names.isSelected() );\r
+ && _abbreviate_scientific_names.isSelected() );\r
options.setColorLabelsSameAsParentBranch( ( _color_labels_same_as_parent_branch != null )\r
- && _color_labels_same_as_parent_branch.isSelected() );\r
+ && _color_labels_same_as_parent_branch.isSelected() );\r
options.setShowDefaultNodeShapesInternal( ( _show_default_node_shapes_internal_cbmi != null )\r
- && _show_default_node_shapes_internal_cbmi.isSelected() );\r
+ && _show_default_node_shapes_internal_cbmi.isSelected() );\r
options.setShowDefaultNodeShapesExternal( ( _show_default_node_shapes_external_cbmi != null )\r
- && _show_default_node_shapes_external_cbmi.isSelected() );\r
+ && _show_default_node_shapes_external_cbmi.isSelected() );\r
+ options.setShowDefaultNodeShapesForMarkedNodes( ( _show_default_node_shapes_for_marked_cbmi != null )\r
+ && _show_default_node_shapes_for_marked_cbmi.isSelected() );\r
if ( ( _non_lined_up_cladograms_rbmi != null ) && ( _non_lined_up_cladograms_rbmi.isSelected() ) ) {\r
options.setCladogramType( CLADOGRAM_TYPE.NON_LINED_UP );\r
}\r
options.setCladogramType( CLADOGRAM_TYPE.EXT_NODE_SUM_DEP );\r
}\r
options.setSearchCaseSensitive( ( _search_case_senstive_cbmi != null )\r
- && _search_case_senstive_cbmi.isSelected() );\r
+ && _search_case_senstive_cbmi.isSelected() );\r
if ( ( _show_scale_cbmi != null ) && _show_scale_cbmi.isEnabled() ) {\r
options.setShowScale( _show_scale_cbmi.isSelected() );\r
}\r
}\r
options.setShowOverview( ( _show_overview_cbmi != null ) && _show_overview_cbmi.isSelected() );\r
options.setShowConfidenceStddev( ( _show_confidence_stddev_cbmi != null )\r
- && _show_confidence_stddev_cbmi.isSelected() );\r
- if ( ( _show_branch_length_values_cbmi != null ) && _show_branch_length_values_cbmi.isEnabled() ) {\r
- options.setShowBranchLengthValues( _show_branch_length_values_cbmi.isSelected() );\r
- }\r
+ && _show_confidence_stddev_cbmi.isSelected() );\r
if ( ( _color_by_taxonomic_group_cbmi != null ) && _color_by_taxonomic_group_cbmi.isEnabled() ) {\r
options.setColorByTaxonomicGroup( _color_by_taxonomic_group_cbmi.isSelected() );\r
}\r
options.setPrintUsingActualSize( ( _print_using_actual_size_cbmi != null )\r
- && ( _print_using_actual_size_cbmi.isSelected() ) );\r
+ && ( _print_using_actual_size_cbmi.isSelected() ) );\r
options.setGraphicsExportUsingActualSize( ( _graphics_export_using_actual_size_cbmi != null )\r
- && ( _graphics_export_using_actual_size_cbmi.isSelected() ) );\r
+ && ( _graphics_export_using_actual_size_cbmi.isSelected() ) );\r
options.setAntialiasPrint( ( _antialias_print_cbmi != null ) && _antialias_print_cbmi.isSelected() );\r
if ( ( _use_brackets_for_conf_in_nh_export_cbmi != null )\r
&& _use_brackets_for_conf_in_nh_export_cbmi.isSelected() ) {\r
options.setNhConversionSupportValueStyle( NH_CONVERSION_SUPPORT_VALUE_STYLE.NONE );\r
}\r
options.setPrintBlackAndWhite( ( _print_black_and_white_cbmi != null )\r
- && _print_black_and_white_cbmi.isSelected() );\r
+ && _print_black_and_white_cbmi.isSelected() );\r
options.setInternalNumberAreConfidenceForNhParsing( ( _internal_number_are_confidence_for_nh_parsing_cbmi != null )\r
- && _internal_number_are_confidence_for_nh_parsing_cbmi.isSelected() );\r
+ && _internal_number_are_confidence_for_nh_parsing_cbmi.isSelected() );\r
if ( ( _extract_taxonomy_pfam_strict_rbmi != null ) && _extract_taxonomy_pfam_strict_rbmi.isSelected() ) {\r
options.setTaxonomyExtraction( TAXONOMY_EXTRACTION.PFAM_STYLE_STRICT );\r
}\r
options.setTaxonomyExtraction( TAXONOMY_EXTRACTION.NO );\r
}\r
options.setReplaceUnderscoresInNhParsing( ( _replace_underscores_cbmi != null )\r
- && _replace_underscores_cbmi.isSelected() );\r
+ && _replace_underscores_cbmi.isSelected() );\r
options.setAllowErrorsInDistanceToParent( ( _allow_errors_in_distance_to_parent_cbmi != null )\r
- && _allow_errors_in_distance_to_parent_cbmi.isSelected() );\r
+ && _allow_errors_in_distance_to_parent_cbmi.isSelected() );\r
options.setMatchWholeTermsOnly( ( _search_whole_words_only_cbmi != null )\r
- && _search_whole_words_only_cbmi.isSelected() );\r
+ && _search_whole_words_only_cbmi.isSelected() );\r
+ options.setSearchWithRegex( ( _search_with_regex_cbmi != null ) && _search_with_regex_cbmi.isSelected() );\r
options.setInverseSearchResult( ( _inverse_search_result_cbmi != null )\r
- && _inverse_search_result_cbmi.isSelected() );\r
+ && _inverse_search_result_cbmi.isSelected() );\r
if ( _graphics_export_visible_only_cbmi != null ) {\r
options.setGraphicsExportVisibleOnly( _graphics_export_visible_only_cbmi.isSelected() );\r
if ( _graphics_export_visible_only_cbmi.isSelected() && ( _graphics_export_using_actual_size_cbmi != null ) ) {\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
+ 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
title = "\"" + getMainPanel().getCurrentPhylogeny().getName() + "\" in " + title;\r
}\r
showTextFrame( _mainpanel.getCurrentPhylogeny().toNewHampshire( getOptions()\r
- .getNhConversionSupportValueStyle() ),\r
- title );\r
+ .getNhConversionSupportValueStyle() ),\r
+ title );\r
}\r
}\r
\r
}\r
if ( ( nodes == null ) || nodes.isEmpty() ) {\r
JOptionPane\r
- .showMessageDialog( this,\r
- "Need to select nodes, either via direct selection or via the \"Search\" function",\r
- "No nodes selected for annotation",\r
- JOptionPane.ERROR_MESSAGE );\r
+ .showMessageDialog( this,\r
+ "Need to select nodes, either via direct selection or via the \"Search\" function",\r
+ "No nodes selected for annotation",\r
+ JOptionPane.ERROR_MESSAGE );\r
return;\r
}\r
final Phylogeny phy = getMainPanel().getCurrentPhylogeny();\r
my_panel,\r
"Enter the sequence annotation(s) for the "\r
+ nodes.size() + " selected nodes",\r
- JOptionPane.OK_CANCEL_OPTION );\r
+ JOptionPane.OK_CANCEL_OPTION );\r
if ( result == JOptionPane.OK_OPTION ) {\r
String ref = ref_field.getText();\r
String desc = desc_filed.getText();\r
for( final PhylogenyNode n : nodes ) {\r
ForesterUtil.ensurePresenceOfSequence( n );\r
final Annotation ann = ForesterUtil.isEmpty( ref ) ? new Annotation()\r
- : new Annotation( ref );\r
+ : new Annotation( ref );\r
if ( !ForesterUtil.isEmpty( desc ) ) {\r
ann.setDesc( desc );\r
}\r
.showInputDialog( this,\r
"Please enter the minimum for confidence values to be displayed.\n"\r
+ "[current value: " + getOptions().getMinConfidenceValue() + "]\n",\r
- "Minimal Confidence Value",\r
- JOptionPane.QUESTION_MESSAGE,\r
- null,\r
- null,\r
- getOptions().getMinConfidenceValue() );\r
+ "Minimal Confidence Value",\r
+ JOptionPane.QUESTION_MESSAGE,\r
+ null,\r
+ null,\r
+ getOptions().getMinConfidenceValue() );\r
if ( !ForesterUtil.isEmpty( s ) ) {\r
boolean success = true;\r
double m = 0.0;\r
*/\r
static void about() {\r
final StringBuffer about = new StringBuffer( "Archaeopteryx\nVersion " + Constants.VERSION + "\n" );\r
- about.append( "Copyright (C) 2013 Christian M. Zmasek\n" );\r
+ about.append( "Copyright (C) 2014 Christian M Zmasek\n" );\r
about.append( "All Rights Reserved\n" );\r
about.append( "License: GNU Lesser General Public License (LGPL)\n" );\r
about.append( "Last modified: " + Constants.PRG_DATE + "\n" );\r
about.append( Constants.PHYLOXML_REFERENCE_SHORT + "\n" );\r
about.append( "For more information & download:\n" );\r
about.append( Constants.APTX_WEB_SITE + "\n" );\r
+ about.append( "Documentation:\n" );\r
+ about.append( Constants.APTX_DOC_SITE + "\n" );\r
about.append( "Comments: " + Constants.AUTHOR_EMAIL );\r
JOptionPane.showMessageDialog( null, about, Constants.PRG_NAME, JOptionPane.PLAIN_MESSAGE );\r
}\r
"Please enter the default size for node shapes.\n"\r
+ "[current value: "\r
+ options.getDefaultNodeShapeSize() + "]\n",\r
- "Node Shape Size",\r
- JOptionPane.QUESTION_MESSAGE,\r
- null,\r
- null,\r
- options.getDefaultNodeShapeSize() );\r
+ "Node Shape Size",\r
+ JOptionPane.QUESTION_MESSAGE,\r
+ null,\r
+ null,\r
+ options.getDefaultNodeShapeSize() );\r
if ( !ForesterUtil.isEmpty( s ) ) {\r
boolean success = true;\r
double m = 0.0;\r
return label;\r
}\r
\r
- static void cycleNodeFill( final Options op, final TreePanel tree_panel ) {\r
+ static void cycleNodeFill( final Options op ) {\r
switch ( op.getDefaultNodeFill() ) {\r
case GRADIENT:\r
op.setDefaultNodeFill( NodeFill.SOLID );\r
}\r
}\r
\r
- static void cycleNodeShape( final Options op, final TreePanel tree_panel ) {\r
+ static void cycleNodeShape( final Options op ) {\r
switch ( op.getDefaultNodeShape() ) {\r
case CIRCLE:\r
op.setDefaultNodeShape( NodeShape.RECTANGLE );\r
}\r
}\r
\r
+ private static void cycleNodeDataReturn( final Options op, Configuration conf ) {\r
+ switch ( op.getExtDescNodeDataToReturn() ) {\r
+ case UNKNOWN:\r
+ op.setExtDescNodeDataToReturn( NodeDataField.DOMAINS_ALL );\r
+ break;\r
+ case DOMAINS_ALL:\r
+ op.setExtDescNodeDataToReturn( NodeDataField.DOMAINS_COLLAPSED_PER_PROTEIN );\r
+ break;\r
+ case DOMAINS_COLLAPSED_PER_PROTEIN:\r
+ op.setExtDescNodeDataToReturn( NodeDataField.SEQ_ANNOTATIONS );\r
+ break;\r
+ case SEQ_ANNOTATIONS:\r
+ op.setExtDescNodeDataToReturn( NodeDataField.GO_TERM_IDS );\r
+ break;\r
+ case GO_TERM_IDS:\r
+ op.setExtDescNodeDataToReturn( NodeDataField.SEQUENCE_MOL_SEQ_FASTA );\r
+ break;\r
+ case SEQUENCE_MOL_SEQ_FASTA:\r
+ if ( conf != null && conf.getExtDescNodeDataToReturn() != null\r
+ && conf.getExtDescNodeDataToReturn() != NodeDataField.DOMAINS_ALL\r
+ && conf.getExtDescNodeDataToReturn() != NodeDataField.DOMAINS_COLLAPSED_PER_PROTEIN\r
+ && conf.getExtDescNodeDataToReturn() != NodeDataField.SEQ_ANNOTATIONS\r
+ && conf.getExtDescNodeDataToReturn() != NodeDataField.GO_TERM_IDS\r
+ && conf.getExtDescNodeDataToReturn() != NodeDataField.SEQUENCE_MOL_SEQ_FASTA\r
+ ) {\r
+ op.setExtDescNodeDataToReturn( conf.getExtDescNodeDataToReturn() );\r
+ }\r
+ else {\r
+ op.setExtDescNodeDataToReturn( NodeDataField.UNKNOWN );\r
+ }\r
+ break; \r
+ default:\r
+ op.setExtDescNodeDataToReturn( NodeDataField.UNKNOWN );\r
+ }\r
+ }\r
+\r
static void cycleOverview( final Options op, final TreePanel tree_panel ) {\r
switch ( op.getOvPlacement() ) {\r
case LOWER_LEFT:\r
}\r
}\r
\r
+ static void setCycleDataReturnMenuItem( final JMenuItem mi, final Options options ) {\r
+ if ( ( options != null ) && ( options.getExtDescNodeDataToReturn() != null ) ) {\r
+ mi.setText( "Cycle Node Return Data... (current: "\r
+ + options.getExtDescNodeDataToReturn().toString() + ")" );\r
+ }\r
+ else {\r
+ mi.setText( "Cycle Node Return Data..." );\r
+ }\r
+ }\r
+\r
static void setOvPlacementColorChooseMenuItem( final JMenuItem mi, final Options options ) {\r
if ( ( options != null ) && ( options.getOvPlacement() != null ) ) {\r
mi.setText( "Cycle Overview Placement... (current: " + options.getOvPlacement() + ")" );\r
static void setTextColorChooseMenuItem( final JMenuItem mi, final TreePanel tree_panel ) {\r
if ( ( tree_panel != null ) && ( tree_panel.getTreeColorSet() != null ) ) {\r
mi.setText( "Select Color Scheme... (current: " + tree_panel.getTreeColorSet().getCurrentColorSchemeName()\r
- + ")" );\r
+ + ")" );\r
}\r
else {\r
mi.setText( "Select Color Scheme..." );\r
mi.setText( "Enter Default Node Shape Size... (current: " + options.getDefaultNodeShapeSize() + ")" );\r
}\r
\r
- static void updateOptionsMenuDependingOnPhylogenyType( final MainPanel main_panel,\r
- final JCheckBoxMenuItem scale,\r
- final JCheckBoxMenuItem branch_lengths,\r
- final JRadioButtonMenuItem non_lined_up,\r
- final JRadioButtonMenuItem uniform_clado,\r
- final JRadioButtonMenuItem nonuniform_clado,\r
- final JCheckBoxMenuItem label_direction_cbmi ) {\r
- final TreePanel tree_panel = main_panel.getCurrentTreePanel();\r
- final ControlPanel control = main_panel.getControlPanel();\r
- final Options options = main_panel.getOptions();\r
- scale.setSelected( options.isShowScale() );\r
- branch_lengths.setSelected( options.isShowBranchLengthValues() );\r
- // non_lined_up.setSelected( options.isNonLinedUpCladogram() );\r
- if ( ( tree_panel != null ) && ( !tree_panel.isPhyHasBranchLengths() ) ) {\r
- scale.setSelected( false );\r
- scale.setEnabled( false );\r
- branch_lengths.setSelected( false );\r
- branch_lengths.setEnabled( false );\r
- }\r
- else if ( ( tree_panel != null ) && !control.isDrawPhylogram() ) {\r
- scale.setSelected( false );\r
- scale.setEnabled( false );\r
- branch_lengths.setEnabled( true );\r
- }\r
- else {\r
- scale.setEnabled( true );\r
- branch_lengths.setEnabled( true );\r
- }\r
- if ( ( tree_panel != null )\r
- && ( ( tree_panel.getPhylogenyGraphicsType() != PHYLOGENY_GRAPHICS_TYPE.ROUNDED )\r
- && ( tree_panel.getPhylogenyGraphicsType() != PHYLOGENY_GRAPHICS_TYPE.EURO_STYLE ) && ( tree_panel\r
- .getPhylogenyGraphicsType() != PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR ) ) ) {\r
- branch_lengths.setSelected( false );\r
- branch_lengths.setEnabled( false );\r
- }\r
- if ( tree_panel != null ) {\r
- if ( ( tree_panel.getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.CIRCULAR )\r
- || ( tree_panel.getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.UNROOTED ) ) {\r
- non_lined_up.setEnabled( false );\r
- uniform_clado.setEnabled( false );\r
- nonuniform_clado.setEnabled( false );\r
- }\r
- else {\r
- non_lined_up.setEnabled( true );\r
- uniform_clado.setEnabled( true );\r
- nonuniform_clado.setEnabled( true );\r
- }\r
- }\r
- else {\r
- if ( ( tree_panel != null )\r
- && ( ( tree_panel.getPhylogenyGraphicsType() != PHYLOGENY_GRAPHICS_TYPE.EURO_STYLE ) && ( tree_panel\r
- .getPhylogenyGraphicsType() != PHYLOGENY_GRAPHICS_TYPE.RECTANGULAR ) ) ) {\r
- branch_lengths.setSelected( false );\r
- branch_lengths.setEnabled( false );\r
- }\r
- if ( ( tree_panel != null )\r
- && ( ( tree_panel.getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.CIRCULAR ) || ( tree_panel\r
- .getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.UNROOTED ) ) ) {\r
- non_lined_up.setEnabled( false );\r
- }\r
- else {\r
- // non_lined_up.setSelected( options.isNonLinedUpCladogram() );\r
- non_lined_up.setEnabled( true );\r
- }\r
- }\r
- label_direction_cbmi.setEnabled( true );\r
- if ( tree_panel != null ) {\r
- if ( ( tree_panel.getPhylogenyGraphicsType() != PHYLOGENY_GRAPHICS_TYPE.UNROOTED )\r
- && ( tree_panel.getPhylogenyGraphicsType() != PHYLOGENY_GRAPHICS_TYPE.CIRCULAR ) ) {\r
- label_direction_cbmi.setEnabled( false );\r
- }\r
- if ( tree_panel.getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.CIRCULAR ) {\r
- scale.setSelected( false );\r
- scale.setEnabled( false );\r
- }\r
- }\r
- }\r
-\r
static void updateScreenTextAntialias( final List<TreePanel> treepanels ) {\r
for( final TreePanel tree_panel : treepanels ) {\r
tree_panel.setTextAntialias();\r