2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.jbgui;
23 import java.awt.BorderLayout;
24 import java.awt.Color;
25 import java.awt.Dimension;
27 import javax.swing.BorderFactory;
28 import javax.swing.ButtonGroup;
29 import javax.swing.JPanel;
30 import javax.swing.JScrollBar;
31 import javax.swing.JScrollPane;
32 import javax.swing.border.Border;
34 @SuppressWarnings("serial")
35 public class GAlignmentPanel extends JPanel
37 protected JScrollBar vscroll = new JScrollBar();
39 protected JScrollBar hscroll = new JScrollBar();
41 BorderLayout borderLayout1 = new BorderLayout();
43 BorderLayout borderLayout3 = new BorderLayout();
45 BorderLayout borderLayout5 = new BorderLayout();
47 BorderLayout borderLayout6 = new BorderLayout();
49 ButtonGroup buttonGroup1 = new ButtonGroup();
51 BorderLayout borderLayout7 = new BorderLayout();
53 BorderLayout borderLayout10 = new BorderLayout();
55 BorderLayout borderLayout11 = new BorderLayout();
57 public JScrollPane annotationScroller = new JScrollPane();
61 BorderLayout borderLayout4 = new BorderLayout();
63 static JPanel newJPanel()
65 JPanel p = new JPanel();
66 // leaving this in, as it prevents
67 // the checkerboard business, despite how
68 // funky that looks. Remove if you want to.
69 p.setBackground(Color.white);
73 protected JPanel sequenceHolderPanel = newJPanel();
75 protected JPanel seqPanelHolder = newJPanel();
77 protected JPanel scalePanelHolder = newJPanel();
79 protected JPanel idPanelHolder = newJPanel();
81 protected JPanel idSpaceFillerPanel1 = newJPanel();
83 public JPanel annotationSpaceFillerHolder = newJPanel();
85 protected JPanel hscrollFillerPanel = newJPanel();
87 JPanel hscrollHolder = newJPanel();
89 public GAlignmentPanel()
100 private void jbInit() throws Exception
102 // annotationScroller.setBackground(Color.white); // BH 2019
104 border1 = BorderFactory.createLineBorder(Color.gray, 1);
105 idPanelHolder.setBorder(null);
106 idPanelHolder.setPreferredSize(new Dimension(70, 10));
107 this.setLayout(borderLayout7);
109 .setMaximumSize(new Dimension(2147483647, 2147483647));
110 sequenceHolderPanel.setMinimumSize(new Dimension(150, 150));
111 sequenceHolderPanel.setPreferredSize(new Dimension(150, 150));
112 sequenceHolderPanel.setLayout(borderLayout3);
113 seqPanelHolder.setLayout(borderLayout1);
114 scalePanelHolder.setBackground(Color.white);
115 scalePanelHolder.setMinimumSize(new Dimension(10, 80));
116 scalePanelHolder.setPreferredSize(new Dimension(10, 30));
117 scalePanelHolder.setLayout(borderLayout6);
118 idPanelHolder.setLayout(borderLayout5);
119 idSpaceFillerPanel1.setBackground(Color.white);
120 idSpaceFillerPanel1.setPreferredSize(new Dimension(10, 30));
121 idSpaceFillerPanel1.setLayout(borderLayout11);
122 annotationSpaceFillerHolder.setBackground(Color.white);
123 annotationSpaceFillerHolder.setPreferredSize(new Dimension(10, 80));
124 annotationSpaceFillerHolder.setLayout(borderLayout4);
125 hscroll.setOrientation(JScrollBar.HORIZONTAL);
126 hscrollHolder.setLayout(borderLayout10);
127 hscrollFillerPanel.setBackground(Color.white);
128 hscrollFillerPanel.setPreferredSize(new Dimension(70, 10));
129 hscrollHolder.setBackground(Color.white);
130 annotationScroller.setBorder(null);
131 annotationScroller.setPreferredSize(new Dimension(10, 80));
132 this.setPreferredSize(new Dimension(220, 166));
134 sequenceHolderPanel.add(scalePanelHolder, BorderLayout.NORTH);
135 sequenceHolderPanel.add(seqPanelHolder, BorderLayout.CENTER);
136 seqPanelHolder.add(vscroll, BorderLayout.EAST);
137 sequenceHolderPanel.add(annotationScroller, BorderLayout.SOUTH);
139 // jPanel3.add(secondaryPanelHolder, BorderLayout.SOUTH);
140 this.add(idPanelHolder, BorderLayout.WEST);
141 idPanelHolder.add(idSpaceFillerPanel1, BorderLayout.NORTH);
142 idPanelHolder.add(annotationSpaceFillerHolder, BorderLayout.SOUTH);
143 this.add(hscrollHolder, BorderLayout.SOUTH);
144 hscrollHolder.add(hscroll, BorderLayout.CENTER);
145 hscrollHolder.add(hscrollFillerPanel, BorderLayout.WEST);
146 this.add(sequenceHolderPanel, BorderLayout.CENTER);