From: amwaterhouse Date: Tue, 25 Jan 2005 17:06:40 +0000 (+0000) Subject: now has key listener X-Git-Tag: Release_2_0~722 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=f509c8fc7c3e5e87038c7856f1761e60601fe1e6;p=jalview.git now has key listener --- diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index 3f7a781..9d6467a 100755 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -20,7 +20,7 @@ public class AlignmentPanel extends GAlignmentPanel implements AdjustmentListene ScalePanel scalePanel; ScorePanel scorePanel; - public AlignmentPanel(AlignFrame af, AlignViewport av) + public AlignmentPanel(AlignFrame af, final AlignViewport av) { alignFrame = af; this.av = av; @@ -48,6 +48,24 @@ public class AlignmentPanel extends GAlignmentPanel implements AdjustmentListene RefreshPanels(); } }); + + hscroll.setFocusable(false); + vscroll.setFocusable(false); + setFocusable(true); + + addKeyListener(new KeyAdapter() + { + public void keyPressed(KeyEvent evt) + { + if(evt.getKeyCode()==27) + { + av.setRubberbandGroup(null); + RefreshPanels(); + } + } + }); + + } public void highlightSearchResults(int [] results) @@ -128,7 +146,7 @@ public class AlignmentPanel extends GAlignmentPanel implements AdjustmentListene public void RefreshPanels() { - + requestFocus(); invalidate(); seqPanel.seqCanvas.paintFlag = true; idPanel.idCanvas.paintFlag = true; @@ -140,6 +158,7 @@ public class AlignmentPanel extends GAlignmentPanel implements AdjustmentListene validate(); repaint(); + } int hextent = 0;