X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fappletgui%2FAlignmentPanel.java;h=a90425f3694fa586cd5a2e1386694d71ddec6bf3;hb=cf82c19425ee457a01c3f1a04aabfb0d9817af6f;hp=3214e70bee4dc267fbb4cd6781dcbf2fb086664e;hpb=7335eb77076ba83a2faebeaf45f0aa03407fdcd1;p=jalview.git
diff --git a/src/jalview/appletgui/AlignmentPanel.java b/src/jalview/appletgui/AlignmentPanel.java
index 3214e70..a90425f 100644
--- a/src/jalview/appletgui/AlignmentPanel.java
+++ b/src/jalview/appletgui/AlignmentPanel.java
@@ -1,30 +1,44 @@
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1)
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
* Copyright (C) 2014 The Jalview Authors
*
* This file is part of Jalview.
*
* 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.
+ * 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 Jalview. If not, see .
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see .
* The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.appletgui;
-import java.awt.*;
-import java.awt.event.*;
-
import jalview.api.AlignmentViewPanel;
-import jalview.datamodel.*;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.SearchResults;
+import jalview.datamodel.SequenceI;
import jalview.structure.StructureSelectionManager;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.FontMetrics;
+import java.awt.Frame;
+import java.awt.Graphics;
+import java.awt.Panel;
+import java.awt.Scrollbar;
+import java.awt.event.AdjustmentEvent;
+import java.awt.event.AdjustmentListener;
+import java.awt.event.ComponentAdapter;
+import java.awt.event.ComponentEvent;
+
public class AlignmentPanel extends Panel implements AdjustmentListener,
AlignmentViewPanel
{
@@ -433,7 +447,9 @@ public class AlignmentPanel extends Panel implements AdjustmentListener,
{
annotationSpaceFillerHolder.setVisible(b);
annotationPanelHolder.setVisible(b);
- } else {
+ }
+ else
+ {
annotationSpaceFillerHolder.setVisible(false);
annotationPanelHolder.setVisible(false);
}
@@ -484,10 +500,12 @@ public class AlignmentPanel extends Panel implements AdjustmentListener,
if (adjustPanelHeight)
{
- // NOTE: this logic is different in the application. Need a better algorithm to define behaviour
+ // NOTE: this logic is different in the application. Need a better
+ // algorithm to define behaviour
// sets initial preferred height
// try and set height according to alignment
- float sscaling = (float) ((av.getCharHeight() * av.getAlignment().getHeight())/(1.0*mheight));
+ float sscaling = (float) ((av.getCharHeight() * av.getAlignment()
+ .getHeight()) / (1.0 * mheight));
if (sscaling > 0.5)
{
// if the alignment is too big then
@@ -496,7 +514,7 @@ public class AlignmentPanel extends Panel implements AdjustmentListener,
}
else
{
- // otherwise just set the panel so that one row of sequence is visible
+ // otherwise just set the panel so that one row of sequence is visible
height = -av.getCharHeight() * 1
+ (int) (seqandannot * (1 - sscaling));
}
@@ -547,13 +565,13 @@ public class AlignmentPanel extends Panel implements AdjustmentListener,
annotationPanelHolder.setVisible(true);
annotationSpaceFillerHolder.setVisible(true);
}
-
+
idSpaceFillerPanel1.setVisible(!wrap);
fontChanged(); // This is so that the scalePanel is resized correctly
validate();
- sequenceHolderPanel.revalidate();
+ sequenceHolderPanel.validate();
repaint();
}
@@ -823,7 +841,7 @@ public class AlignmentPanel extends Panel implements AdjustmentListener,
seqPanel.seqCanvas.repaint();
idPanel.idCanvas.repaint();
- if (!av.wrapAlignment)
+ if (!av.wrapAlignment)
{
if (av.showAnnotation)
{
@@ -832,7 +850,7 @@ public class AlignmentPanel extends Panel implements AdjustmentListener,
}
scalePanel.repaint();
}
-
+
}
protected Panel sequenceHolderPanel = new Panel();
@@ -959,6 +977,12 @@ public class AlignmentPanel extends Panel implements AdjustmentListener,
}
@Override
+ public String getViewName()
+ {
+ return getName();
+ }
+
+ @Override
public StructureSelectionManager getStructureSelectionManager()
{
return StructureSelectionManager