JAL-845 handling eXpand/Gather split frame views
[jalview.git] / src / jalview / jbgui / GSplitFrame.java
1 package jalview.jbgui;
2
3 import javax.swing.JInternalFrame;
4 import javax.swing.JSplitPane;
5
6 public class GSplitFrame extends JInternalFrame
7 {
8   private static final long serialVersionUID = 1L;
9
10   private GAlignFrame topFrame;
11
12   private GAlignFrame bottomFrame;
13
14   /**
15    * Constructor
16    * 
17    * @param top
18    * @param bottom
19    */
20   public GSplitFrame(GAlignFrame top, GAlignFrame bottom)
21   {
22     this.topFrame = top;
23     this.bottomFrame = bottom;
24     JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, top,
25             bottom);
26     splitPane.setVisible(true);
27     add(splitPane);
28     splitPane.setDividerLocation(0.5d);
29     splitPane.setResizeWeight(0.5d);
30     splitPane.setDividerSize(0);
31   }
32
33   public GAlignFrame getTopFrame()
34   {
35     return topFrame;
36   }
37
38   public GAlignFrame getBottomFrame()
39   {
40     return bottomFrame;
41   }
42 }