import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
import jalview.ext.treeviewer.ExternalTreeViewerBindingI;
+import jalview.gui.Desktop;
+import jalview.gui.JvOptionPane;
import jalview.gui.PaintRefresher;
import jalview.structure.SelectionSource;
import jalview.structure.StructureSelectionManager;
+import jalview.util.MessageManager;
import jalview.viewmodel.AlignmentViewport;
import java.awt.event.ActionEvent;
import java.util.Map;
import java.util.Set;
-import javax.swing.JTabbedPane;
import javax.swing.SwingUtilities;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
import org.forester.archaeopteryx.MainFrame;
import org.forester.phylogeny.Phylogeny;
private AlignmentViewport parentAvport;
- private JTabbedPane treeTabs;
private final StructureSelectionManager ssm;
final Map<SequenceI, PhylogenyNode> alignMappedToNodes,
final Map<PhylogenyNode, SequenceI> nodesMappedToAlign)
{
+
+ if (archaeopteryx.getMainPanel().getTabbedPane().getTabCount() > 1)
+ {
+ JvOptionPane.showMessageDialog(Desktop.desktop,
+ MessageManager.getString("label.tabs_detected_archaeopteryx"),
+ MessageManager.getString("label.problem_reading_tree_file"),
+ JvOptionPane.WARNING_MESSAGE);
+ ;
+ }
+
// deal with/prohibit null values here as that will cause problems
parentAvport = jalviewAlignmentViewport;
sequencesBoundToNodes = alignMappedToNodes;
nodesBoundToSequences = nodesMappedToAlign;
treeView = archaeopteryx.getMainPanel().getCurrentTreePanel();
- treeTabs = archaeopteryx.getMainPanel().getTabbedPane();
ssm = parentAvport.getStructureSelectionManager();
+
// archaeopteryx.getMainPanel().getControlPanel().setColorBranches(true);
ssm.addSelectionListener(this);
PaintRefresher.Register(treeView, parentAvport.getSequenceSetId());
- treeTabs.addChangeListener(new ChangeListener()
- {
-
- @Override
- public void stateChanged(ChangeEvent e)
- {
-
- SwingUtilities.invokeLater(new Runnable()
- {
-
- @Override
- /**
- * Resend the selection to the tree view when tabs get switched, this
- * has to be buried in invokeLater as Forester first resets the tree
- * view on switching tabs, without invokeLater this would get called
- * before Forester resets which would nullify the selection.
- */
- public void run()
- {
- parentAvport.sendSelection();
- // PaintRefresher.Refresh(treeView,
- // parentAvport.getSequenceSetId());
-
- }
- });
-
- }
-
- });
+ // treeTabs.addChangeListener(new ChangeListener()
+ // {
+ //
+ // @Override
+ // public void stateChanged(ChangeEvent e)
+ // {
+ //
+ // SwingUtilities.invokeLater(new Runnable()
+ // {
+ //
+ // @Override
+ // /**
+ // * Resend the selection to the tree view when tabs get switched, this
+ // * has to be buried in invokeLater as Forester first resets the tree
+ // * view on switching tabs, without invokeLater this would get called
+ // * before Forester resets which would nullify the selection.
+ // */
+ // public void run()
+ // {
+ // treeView = archaeopteryx.getMainPanel().getCurrentTreePanel();
+ // parentAvport.sendSelection();
+ // // PaintRefresher.Refresh(treeView,
+ // // parentAvport.getSequenceSetId());
+ //
+ // }
+ // });
+ //
+ // }
+ //
+ // });
}
}
-
+ /**
+ * may or may not need an extra repaint on the alignment view (check what kira
+ * does)
+ */
@Override
public void showNodeSelectionOnAlign(final PhylogenyNode node)
{
showMatchingSequence(node);
}
+ PaintRefresher.Refresh(treeView, parentAvport.getSequenceSetId());
}