JAL-4367 Limit right and top adjustments
[jalview.git] / src / jalview / jbgui / GAlignmentPanel.java
index cc3d68f..2d6f569 100755 (executable)
@@ -1,63 +1,57 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
- * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
  * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * This file is part of Jalview.
  * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
  * 
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
  */
 package jalview.jbgui;
 
-import java.awt.*;
-import javax.swing.*;
-import javax.swing.border.*;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
 
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.JPanel;
+import javax.swing.JScrollBar;
+import javax.swing.JScrollPane;
+import javax.swing.border.Border;
+
+@SuppressWarnings("serial")
 public class GAlignmentPanel extends JPanel
 {
-  protected JPanel sequenceHolderPanel = new JPanel();
-
   protected JScrollBar vscroll = new JScrollBar();
 
   protected JScrollBar hscroll = new JScrollBar();
 
-  protected JPanel seqPanelHolder = new JPanel();
-
   BorderLayout borderLayout1 = new BorderLayout();
 
   BorderLayout borderLayout3 = new BorderLayout();
 
-  protected JPanel scalePanelHolder = new JPanel();
-
-  protected JPanel idPanelHolder = new JPanel();
-
   BorderLayout borderLayout5 = new BorderLayout();
 
-  protected JPanel idSpaceFillerPanel1 = new JPanel();
-
-  public JPanel annotationSpaceFillerHolder = new JPanel();
-
   BorderLayout borderLayout6 = new BorderLayout();
 
   ButtonGroup buttonGroup1 = new ButtonGroup();
 
   BorderLayout borderLayout7 = new BorderLayout();
 
-  JPanel hscrollHolder = new JPanel();
-
   BorderLayout borderLayout10 = new BorderLayout();
 
-  protected JPanel hscrollFillerPanel = new JPanel();
-
   BorderLayout borderLayout11 = new BorderLayout();
 
   public JScrollPane annotationScroller = new JScrollPane();
@@ -66,6 +60,32 @@ public class GAlignmentPanel extends JPanel
 
   BorderLayout borderLayout4 = new BorderLayout();
 
+  static JPanel newJPanel()
+  { // BH 2019
+    JPanel p = new JPanel();
+    // leaving this in, as it prevents
+    // the checkerboard business, despite how
+    // funky that looks. Remove if you want to.
+    p.setBackground(Color.white);
+    return p;
+  }
+
+  protected JPanel sequenceHolderPanel = newJPanel();
+
+  protected JPanel seqPanelHolder = newJPanel();
+
+  protected JPanel scalePanelHolder = newJPanel();
+
+  public JPanel idPanelHolder = newJPanel();
+
+  protected JPanel idSpaceFillerPanel1 = newJPanel();
+
+  public JPanel annotationSpaceFillerHolder = newJPanel();
+
+  protected JPanel hscrollFillerPanel = newJPanel();
+
+  JPanel hscrollHolder = newJPanel();
+
   public GAlignmentPanel()
   {
     try
@@ -79,6 +99,8 @@ public class GAlignmentPanel extends JPanel
 
   private void jbInit() throws Exception
   {
+    // annotationScroller.setBackground(Color.white); // BH 2019
+
     border1 = BorderFactory.createLineBorder(Color.gray, 1);
     idPanelHolder.setBorder(null);
     idPanelHolder.setPreferredSize(new Dimension(70, 10));
@@ -123,4 +145,9 @@ public class GAlignmentPanel extends JPanel
     hscrollHolder.add(hscrollFillerPanel, BorderLayout.WEST);
     this.add(sequenceHolderPanel, BorderLayout.CENTER);
   }
+
+  public JPanel getIdSpaceFillerPanel1()
+  {
+    return idSpaceFillerPanel1;
+  }
 }