package jalview.gui;
-import java.awt.BorderLayout;
+import java.awt.event.FocusAdapter;
+import java.awt.event.FocusEvent;
import javax.swing.JInternalFrame;
public class TreeCalculationFrame extends JInternalFrame
{
+ private AlignFrame af;
+
private TreeCalculationPanel treeCalcPanel;
public TreeCalculationFrame(AlignFrame alignFrame)
{
- treeCalcPanel = new TreeCalculationPanel(alignFrame);
+ af = alignFrame;
+ treeCalcPanel = new TreeCalculationPanel(af);
init();
- alignFrame.alignPanel.setTreeCalcPanel(this);
+ af.alignPanel.setTreeCalcPanel(this);
}
private void init()
{
this.setContentPane(treeCalcPanel);
- setLayout(new BorderLayout());
+ this.addFocusListener(new FocusAdapter()
+ {
+
+ @Override
+ public void focusGained(FocusEvent e)
+ {
+ revalidateInput();
+ }
+ });
+
+
+ }
+
+ public void revalidateInput()
+ {
+ int nrSeqsChosen = af.getViewport().getAlignment().getHeight();
+ if (af.getViewport().getSelectionGroup() != null)
+ {
+ nrSeqsChosen = af.getViewport().getSelectionGroup().getSize();
+ }
}
package jalview.gui;
import java.awt.BorderLayout;
+import java.awt.Color;
import javax.swing.JPanel;
private void init()
{
setLayout(new BorderLayout());
+ this.setBackground(Color.WHITE);
}
}