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