JAL-1503 update version in GPL header
[jalview.git] / src / jalview / gui / IdPanel.java
index 3b9d385..2b87d21 100755 (executable)
@@ -1,19 +1,20 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
- *
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1)
+ * 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
+ * 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
+ *  
+ * 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 <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
  */
 package jalview.gui;
 
@@ -30,7 +31,7 @@ import jalview.util.UrlLink;
 
 /**
  * DOCUMENT ME!
- *
+ * 
  * @author $author$
  * @version $Revision$
  */
@@ -53,11 +54,12 @@ public class IdPanel extends JPanel implements MouseListener,
   int lastid = -1;
 
   boolean mouseDragging = false;
+
   private final SequenceAnnotationReport seqAnnotReport;
 
   /**
    * Creates a new IdPanel object.
-   *
+   * 
    * @param av
    *          DOCUMENT ME!
    * @param parent
@@ -77,9 +79,10 @@ public class IdPanel extends JPanel implements MouseListener,
     addMouseWheelListener(this);
     ToolTipManager.sharedInstance().registerComponent(this);
   }
+
   /**
    * DOCUMENT ME!
-   *
+   * 
    * @param e
    *          DOCUMENT ME!
    */
@@ -92,17 +95,18 @@ public class IdPanel extends JPanel implements MouseListener,
     {
       SequenceI sequence = av.getAlignment().getSequenceAt(seq);
       StringBuffer tip = new StringBuffer();
-      seqAnnotReport.createSequenceAnnotationReport(tip, sequence,
-              av.isShowDbRefs(), av.isShowNpFeats(),
-              sp.seqCanvas.fr.minmax);
+      seqAnnotReport
+              .createSequenceAnnotationReport(tip, sequence,
+                      av.isShowDbRefs(), av.isShowNpFeats(),
+                      sp.seqCanvas.fr.minmax);
       setToolTipText("<html>" + sequence.getDisplayId(true) + " "
-              + tip.toString()+"</html>");
+              + tip.toString() + "</html>");
     }
   }
 
   /**
    * DOCUMENT ME!
-   *
+   * 
    * @param e
    *          DOCUMENT ME!
    */
@@ -132,17 +136,32 @@ public class IdPanel extends JPanel implements MouseListener,
     e.consume();
     if (e.getWheelRotation() > 0)
     {
-      alignPanel.scrollUp(false);
+      if (e.isShiftDown())
+      {
+        alignPanel.scrollRight(true);
+
+      }
+      else
+      {
+        alignPanel.scrollUp(false);
+      }
     }
     else
     {
-      alignPanel.scrollUp(true);
+      if (e.isShiftDown())
+      {
+        alignPanel.scrollRight(false);
+      }
+      else
+      {
+        alignPanel.scrollUp(true);
+      }
     }
   }
 
   /**
    * DOCUMENT ME!
-   *
+   * 
    * @param e
    *          DOCUMENT ME!
    */
@@ -215,7 +234,7 @@ public class IdPanel extends JPanel implements MouseListener,
 
   /**
    * DOCUMENT ME!
-   *
+   * 
    * @param e
    *          DOCUMENT ME!
    */
@@ -230,7 +249,7 @@ public class IdPanel extends JPanel implements MouseListener,
 
   /**
    * DOCUMENT ME!
-   *
+   * 
    * @param e
    *          DOCUMENT ME!
    */
@@ -256,7 +275,7 @@ public class IdPanel extends JPanel implements MouseListener,
 
   /**
    * DOCUMENT ME!
-   *
+   * 
    * @param e
    *          DOCUMENT ME!
    */
@@ -276,7 +295,8 @@ public class IdPanel extends JPanel implements MouseListener,
       // build a new links menu based on the current links + any non-positional
       // features
       Vector nlinks = new Vector(Preferences.sequenceURLLinks);
-      SequenceFeature sf[] = sq==null ? null : sq.getDatasetSequence().getSequenceFeatures();
+      SequenceFeature sf[] = sq == null ? null : sq.getDatasetSequence()
+              .getSequenceFeatures();
       for (int sl = 0; sf != null && sl < sf.length; sl++)
       {
         if (sf[sl].begin == sf[sl].end && sf[sl].begin == 0)
@@ -320,7 +340,7 @@ public class IdPanel extends JPanel implements MouseListener,
 
   /**
    * DOCUMENT ME!
-   *
+   * 
    * @param seq
    *          DOCUMENT ME!
    */
@@ -334,7 +354,7 @@ public class IdPanel extends JPanel implements MouseListener,
 
   /**
    * DOCUMENT ME!
-   *
+   * 
    * @param start
    *          DOCUMENT ME!
    * @param end
@@ -365,13 +385,13 @@ public class IdPanel extends JPanel implements MouseListener,
     for (int i = start; i <= end; i++)
     {
       av.getSelectionGroup().addSequence(
-              av.getAlignment().getSequenceAt(i), true);
+              av.getAlignment().getSequenceAt(i), i == end);
     }
   }
 
   /**
    * DOCUMENT ME!
-   *
+   * 
    * @param e
    *          DOCUMENT ME!
    */
@@ -391,7 +411,7 @@ public class IdPanel extends JPanel implements MouseListener,
 
   /**
    * DOCUMENT ME!
-   *
+   * 
    * @param list
    *          DOCUMENT ME!
    */