From f509c8fc7c3e5e87038c7856f1761e60601fe1e6 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Tue, 25 Jan 2005 17:06:40 +0000 Subject: [PATCH] now has key listener --- src/jalview/gui/AlignmentPanel.java | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) 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; -- 1.7.10.2