873d2b5d56148c63001d0280f69e17800753c17f
[jalview.git] / src / jalview / gui / TreeCalculationFrame.java
1 package jalview.gui;
2
3 import java.awt.event.FocusAdapter;
4 import java.awt.event.FocusEvent;
5
6 import javax.swing.JInternalFrame;
7
8 public class TreeCalculationFrame extends JInternalFrame // extends
9                                                          // OptsAndParamsPage?
10 {
11   private AlignFrame af;
12
13   private TreeCalculationPanel treeCalcPanel;
14
15   public TreeCalculationFrame(AlignFrame alignFrame)
16   {
17     af = alignFrame;
18     treeCalcPanel = new TreeCalculationPanel(af);
19     init();
20     af.alignPanel.setTreeCalcPanel(this);
21
22
23   }
24
25   private void init()
26   {
27     this.setContentPane(treeCalcPanel);
28     this.addFocusListener(new FocusAdapter()
29     {
30
31       @Override
32       public void focusGained(FocusEvent e)
33       {
34         revalidateInput();
35       }
36     });
37
38     Desktop.addInternalFrame(
39             this, "Phylogenetic inference chooser", 400, 400, false
40     );
41
42
43
44   }
45
46   public void revalidateInput()
47   {
48     int nrSeqsChosen = af.getViewport().getAlignment().getHeight();
49     if (af.getViewport().getSelectionGroup() != null)
50     {
51       nrSeqsChosen = af.getViewport().getSelectionGroup().getSize();
52     }
53
54
55   }
56
57   public TreeCalculationPanel getTreeCalcPanel()
58   {
59     return treeCalcPanel;
60   }
61
62   public void setTreeCalcPanel(TreeCalculationPanel treeCalcPanel)
63   {
64     this.treeCalcPanel = treeCalcPanel;
65   }
66
67 }