THis change is for secondary structure similarity tree panel. Secondary structure providers will be displayed as internal node labels if this menu option is selected. The labels will be displayed only if the node count is greater than 3.
label.protein_matrix = Protein matrix
label.show_bootstrap_values = Show Bootstrap Values
label.show_distances = Show distances
+label.show_secondary_structure_provider = Show Secondary Structure Providers
label.mark_unassociated_leaves = Mark Unassociated Leaves
label.fit_to_window = Fit To Window
label.newick_format = Newick Format
boolean fitToWindow = true;
boolean showDistances = false;
+
+ boolean showSecondaryStructureProvider = false;
boolean showBootstrap = false;
nodeLabel = nodeLabel + String.valueOf(node.bootstrap);
}
- if (node.hasLabel())
+
+ //Display secondary structure providers as labels only if:
+ // ~ node has Label assigned (Secondary structure providers)
+ // ~ node count is greater than 3
+ // ~ showSecondaryStructureProvider option is set to true by the user
+ if ( node.hasLabel() && showSecondaryStructureProvider && node.count > 3)
{
String label = node.getLabel();
// Split the nodeLabel by "|"
String[] lines = nodeLabel.split("\\|");
- // Iterate over the lines and draw each line separately
+ // Iterate over the lines and draw each string separately
String longestLabelString = "";
int i = 0;
for (i = 0; i < lines.length; i++) {
this.showDistances = state;
repaint();
}
+
+ /**
+ * DOCUMENT ME!
+ *
+ * @param state
+ * DOCUMENT ME!
+ */
+ public void setShowSecondaryStructureProvider(boolean state)
+ {
+ this.showSecondaryStructureProvider = state;
+ repaint();
+ }
+
/**
* DOCUMENT ME!
if (similarityParams != null
&& similarityParams.getSecondaryStructureSource() != null)
{
-
+ //setting showSecondaryStructureProviderMenu to true if the
+ //similarity is based on secondary structure
+ showSecondaryStructureProviderMenu.setVisible(true);
addSubtitlePanel(" Secondary Structure Provider : "
+ similarityParams.getSecondaryStructureSource());
+
+ }
+ else {
+ //setting showSecondaryStructureProviderMenu to false if the
+ //similarity is not based on secondary structure
+ showSecondaryStructureProviderMenu.setVisible(false);
}
if (leafAnnotations != null)
{
{
treeCanvas.setShowDistances(distanceMenu.isSelected());
}
+
+ /**
+ * DOCUMENT ME!
+ *
+ * @param e
+ * DOCUMENT ME!
+ */
+ @Override
+ public void showSecondaryStructureProviderMenu_actionPerformed(ActionEvent e)
+ {
+ treeCanvas.setShowSecondaryStructureProvider(showSecondaryStructureProviderMenu.isSelected());
+ }
/**
* DOCUMENT ME!
public JCheckBoxMenuItem bootstrapMenu = new JCheckBoxMenuItem();
public JCheckBoxMenuItem distanceMenu = new JCheckBoxMenuItem();
+
+ //Menu option for the user to select their preference in
+ //displaying secondary structure providers as labels.
+ //Visible only for secondary structure similarity.
+ public JCheckBoxMenuItem showSecondaryStructureProviderMenu = new JCheckBoxMenuItem();
public JCheckBoxMenuItem fitToWindow = new JCheckBoxMenuItem();
distanceMenu_actionPerformed(e);
}
});
+ showSecondaryStructureProviderMenu.setText(MessageManager.getString("label.show_secondary_structure_provider"));
+ showSecondaryStructureProviderMenu.addActionListener(new java.awt.event.ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ showSecondaryStructureProviderMenu_actionPerformed(e);
+ }
+ });
fitToWindow.setSelected(true);
fitToWindow.setText(MessageManager.getString("label.fit_to_window"));
fitToWindow.addActionListener(new java.awt.event.ActionListener()
viewMenu.add(fitToWindow);
viewMenu.add(font);
viewMenu.add(distanceMenu);
+ viewMenu.add(showSecondaryStructureProviderMenu);
viewMenu.add(bootstrapMenu);
viewMenu.add(placeholdersMenu);
viewMenu.add(sortAssocViews);
public void distanceMenu_actionPerformed(ActionEvent e)
{
}
+
+ public void showSecondaryStructureProviderMenu_actionPerformed(ActionEvent e)
+ {
+ }
public void bootstrapMenu_actionPerformed(ActionEvent e)
{