X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FIdPanel.java;h=b5fd0c17251e002c84c3198bd211958b692a2b76;hb=d83db1c05bf39e076ce0cd53635bedf7e89afed1;hp=3b9d385d39007231b7cb9619d06ccf9262f1f35c;hpb=3eef76298c55f3def21eed2516b5ace4405bed0a;p=jalview.git diff --git a/src/jalview/gui/IdPanel.java b/src/jalview/gui/IdPanel.java index 3b9d385..b5fd0c1 100755 --- a/src/jalview/gui/IdPanel.java +++ b/src/jalview/gui/IdPanel.java @@ -1,18 +1,18 @@ /* - * 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) + * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle + * * 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 . */ package jalview.gui; @@ -30,7 +30,7 @@ import jalview.util.UrlLink; /** * DOCUMENT ME! - * + * * @author $author$ * @version $Revision$ */ @@ -53,11 +53,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 +78,10 @@ public class IdPanel extends JPanel implements MouseListener, addMouseWheelListener(this); ToolTipManager.sharedInstance().registerComponent(this); } + /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ @@ -92,17 +94,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("" + sequence.getDisplayId(true) + " " - + tip.toString()+""); + + tip.toString() + ""); } } /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ @@ -132,17 +135,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 +233,7 @@ public class IdPanel extends JPanel implements MouseListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ @@ -230,7 +248,7 @@ public class IdPanel extends JPanel implements MouseListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ @@ -256,7 +274,7 @@ public class IdPanel extends JPanel implements MouseListener, /** * DOCUMENT ME! - * + * * @param e * DOCUMENT ME! */ @@ -276,7 +294,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 +339,7 @@ public class IdPanel extends JPanel implements MouseListener, /** * DOCUMENT ME! - * + * * @param seq * DOCUMENT ME! */ @@ -334,7 +353,7 @@ public class IdPanel extends JPanel implements MouseListener, /** * DOCUMENT ME! - * + * * @param start * DOCUMENT ME! * @param end @@ -365,13 +384,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 +410,7 @@ public class IdPanel extends JPanel implements MouseListener, /** * DOCUMENT ME! - * + * * @param list * DOCUMENT ME! */