applied copyright 2008
[jalview.git] / src / jalview / jbgui / GAlignmentPanel.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
3  * Copyright (C) 2008 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 package jalview.jbgui;
20
21 import java.awt.*;
22 import javax.swing.*;
23 import javax.swing.border.*;
24
25 public class GAlignmentPanel
26     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
62   private void jbInit()
63       throws Exception
64   {
65     border1 = BorderFactory.createLineBorder(Color.gray, 1);
66     idPanelHolder.setBorder(null);
67     idPanelHolder.setPreferredSize(new Dimension(70, 10));
68     this.setLayout(borderLayout7);
69     sequenceHolderPanel.setMaximumSize(new Dimension(2147483647, 2147483647));
70     sequenceHolderPanel.setMinimumSize(new Dimension(150, 150));
71     sequenceHolderPanel.setPreferredSize(new Dimension(150, 150));
72     sequenceHolderPanel.setLayout(borderLayout3);
73     seqPanelHolder.setLayout(borderLayout1);
74     scalePanelHolder.setBackground(Color.white);
75     scalePanelHolder.setMinimumSize(new Dimension(10, 80));
76     scalePanelHolder.setPreferredSize(new Dimension(10, 30));
77     scalePanelHolder.setLayout(borderLayout6);
78     idPanelHolder.setLayout(borderLayout5);
79     idSpaceFillerPanel1.setBackground(Color.white);
80     idSpaceFillerPanel1.setPreferredSize(new Dimension(10, 30));
81     idSpaceFillerPanel1.setLayout(borderLayout11);
82     annotationSpaceFillerHolder.setBackground(Color.white);
83     annotationSpaceFillerHolder.setPreferredSize(new Dimension(10, 80));
84     annotationSpaceFillerHolder.setLayout(borderLayout4);
85     hscroll.setOrientation(JScrollBar.HORIZONTAL);
86     hscrollHolder.setLayout(borderLayout10);
87     hscrollFillerPanel.setBackground(Color.white);
88     hscrollFillerPanel.setPreferredSize(new Dimension(70, 10));
89     hscrollHolder.setBackground(Color.white);
90     annotationScroller.setBorder(null);
91     annotationScroller.setPreferredSize(new Dimension(10, 80));
92     this.setPreferredSize(new Dimension(220, 166));
93
94     sequenceHolderPanel.add(scalePanelHolder, BorderLayout.NORTH);
95     sequenceHolderPanel.add(seqPanelHolder, BorderLayout.CENTER);
96     seqPanelHolder.add(vscroll, BorderLayout.EAST);
97     sequenceHolderPanel.add(annotationScroller, BorderLayout.SOUTH);
98
99     //  jPanel3.add(secondaryPanelHolder,  BorderLayout.SOUTH);
100     this.add(idPanelHolder, BorderLayout.WEST);
101     idPanelHolder.add(idSpaceFillerPanel1, BorderLayout.NORTH);
102     idPanelHolder.add(annotationSpaceFillerHolder, BorderLayout.SOUTH);
103     this.add(hscrollHolder, BorderLayout.SOUTH);
104     hscrollHolder.add(hscroll, BorderLayout.CENTER);
105     hscrollHolder.add(hscrollFillerPanel, BorderLayout.WEST);
106     this.add(sequenceHolderPanel, BorderLayout.CENTER);
107   }
108 }