X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FSeqPanel.java;h=f9612123aaa89f0c0bee3ff80ab7cdace3e611ea;hb=23304093bd85722ad85393516357e565616cbf0b;hp=ade0afd3585298a6efe92a7da083e5f167868de1;hpb=362f2db1b01f3562784864a1d6ac5f7b9be0a18a;p=jalview.git diff --git a/src/jalview/appletgui/SeqPanel.java b/src/jalview/appletgui/SeqPanel.java index ade0afd..f961212 100644 --- a/src/jalview/appletgui/SeqPanel.java +++ b/src/jalview/appletgui/SeqPanel.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6) - * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7) + * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle * * This file is part of Jalview. * @@ -458,7 +458,7 @@ public class SeqPanel extends Panel implements MouseMotionListener, SequenceI sequence = av.alignment.getSequenceAt(findSeq(evt)); if (evt.getClickCount() > 1) { - if (av.getSelectionGroup().getSize() == 1 + if (av.getSelectionGroup()!=null && av.getSelectionGroup().getSize() == 1 && av.getSelectionGroup().getEndRes() - av.getSelectionGroup().getStartRes() < 2) { @@ -1774,8 +1774,8 @@ public class SeqPanel extends Panel implements MouseMotionListener, } if (repaint) { + ap.scalePanelHolder.repaint(); ap.repaint(); - //ap.paintAlignment(false); } } @@ -1791,5 +1791,25 @@ public class SeqPanel extends Panel implements MouseMotionListener, column = column<0 ? ap.av.startRes : column; ap.scrollTo(row, row, column, true, true); } + /** + * scroll to the given row - or nearest visible location + * @param row + */ + public void scrollToRow(int row) + { + + row = row<0 ? ap.av.startSeq : row; + ap.scrollTo(row, row, ap.av.startRes, true, true); + } + /** + * scroll to the given column - or nearest visible location + * @param column + */ + public void scrollToColumn(int column) + { + + column = column<0 ? ap.av.startRes : column; + ap.scrollTo(ap.av.startRes, ap.av.startRes, column, true, true); + } }