GPL license added
[jalview.git] / src / jalview / jbgui / GAlignmentPanel.java
1 /*
2 * Jalview - A Sequence Alignment Editor and Viewer
3 * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
18 */
19
20 package jalview.jbgui;
21
22 import java.awt.*;
23 import javax.swing.*;
24 import javax.swing.border.*;
25
26 public class GAlignmentPanel extends JPanel
27 {
28   protected JPanel sequenceHolderPanel = new JPanel();
29   protected JScrollBar vscroll = new JScrollBar();
30   protected  JScrollBar hscroll = new JScrollBar();
31   protected JPanel seqPanelHolder = new JPanel();
32   BorderLayout borderLayout1 = new BorderLayout();
33   BorderLayout borderLayout3 = new BorderLayout();
34   protected JPanel scalePanelHolder = new JPanel();
35   protected JPanel idPanelHolder = new JPanel();
36   BorderLayout borderLayout5 = new BorderLayout();
37   protected JPanel idSpaceFillerPanel1 = new JPanel();
38   public JPanel annotationSpaceFillerHolder = new JPanel();
39   BorderLayout borderLayout6 = new BorderLayout();
40   ButtonGroup buttonGroup1 = new ButtonGroup();
41   BorderLayout borderLayout7 = new BorderLayout();
42   JPanel hscrollHolder = new JPanel();
43   BorderLayout borderLayout10 = new BorderLayout();
44   protected JPanel hscrollFillerPanel = new JPanel();
45   BorderLayout borderLayout11 = new BorderLayout();
46   public JScrollPane annotationScroller = new JScrollPane();
47   Border border1;
48   BorderLayout borderLayout4 = new BorderLayout();
49
50   public GAlignmentPanel()
51   {
52     try
53     {
54       jbInit();
55     }
56     catch(Exception e)
57     {
58       e.printStackTrace();
59     }
60   }
61   private void jbInit() throws Exception
62   {
63     border1 = BorderFactory.createLineBorder(Color.gray,1);
64     idPanelHolder.setBorder(null);
65     idPanelHolder.setPreferredSize(new Dimension(70, 10));
66     this.setLayout(borderLayout7);
67     sequenceHolderPanel.setMaximumSize(new Dimension(2147483647, 2147483647));
68     sequenceHolderPanel.setMinimumSize(new Dimension(150, 150));
69     sequenceHolderPanel.setPreferredSize(new Dimension(150, 150));
70     sequenceHolderPanel.setLayout(borderLayout3);
71     seqPanelHolder.setLayout(borderLayout1);
72     scalePanelHolder.setBackground(Color.white);
73     scalePanelHolder.setMinimumSize(new Dimension(10, 80));
74     scalePanelHolder.setPreferredSize(new Dimension(10, 30));
75     scalePanelHolder.setLayout(borderLayout6);
76     idPanelHolder.setLayout(borderLayout5);
77     idSpaceFillerPanel1.setBackground(Color.white);
78     idSpaceFillerPanel1.setPreferredSize(new Dimension(10, 30));
79     idSpaceFillerPanel1.setLayout(borderLayout11);
80     annotationSpaceFillerHolder.setBackground(Color.white);
81     annotationSpaceFillerHolder.setPreferredSize(new Dimension(10, 80));
82     annotationSpaceFillerHolder.setLayout(borderLayout4);
83     hscroll.setOrientation(JScrollBar.HORIZONTAL);
84     hscrollHolder.setLayout(borderLayout10);
85     hscrollFillerPanel.setBackground(Color.white);
86     hscrollFillerPanel.setPreferredSize(new Dimension(70, 10));
87     hscrollHolder.setBackground(Color.white);
88     annotationScroller.setBorder(null);
89     annotationScroller.setPreferredSize(new Dimension(10, 80));
90     this.setPreferredSize(new Dimension(220, 166));
91     this.setRequestFocusEnabled(true);
92     sequenceHolderPanel.add(scalePanelHolder,  BorderLayout.NORTH);
93     sequenceHolderPanel.add(seqPanelHolder,  BorderLayout.CENTER);
94     seqPanelHolder.add(vscroll, BorderLayout.EAST);
95     sequenceHolderPanel.add(annotationScroller, BorderLayout.SOUTH);
96   //  jPanel3.add(secondaryPanelHolder,  BorderLayout.SOUTH);
97     this.add(idPanelHolder, BorderLayout.WEST);
98     idPanelHolder.add(idSpaceFillerPanel1,  BorderLayout.NORTH);
99     idPanelHolder.add(annotationSpaceFillerHolder, BorderLayout.SOUTH);
100     this.add(hscrollHolder,  BorderLayout.SOUTH);
101     hscrollHolder.add(hscroll, BorderLayout.CENTER);
102     hscrollHolder.add(hscrollFillerPanel,  BorderLayout.WEST);
103     this.add(sequenceHolderPanel,  BorderLayout.CENTER);
104   }
105
106
107 }