From 1413363ab19270cf3ec7ac5e940c00352404b04e Mon Sep 17 00:00:00 2001 From: jprocter Date: Tue, 8 Jun 2010 14:27:20 +0000 Subject: [PATCH] trim hidden regions outside selection when copying selected region to clipboard * JAL-573 --- src/jalview/gui/AlignFrame.java | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index dcb1a09..2d1fc1e 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -531,10 +531,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, @Override public void run() { - System.err.println("Change support JWS1: build services again."); + System.err + .println("Change support JWS1: build services again."); BuildWebServiceMenu(); } - + }); } } @@ -545,9 +546,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { public void propertyChange(PropertyChangeEvent evt) { - System.err.println("Change support JWS2: build services again."); - BuildWebServiceMenu(); - } + System.err + .println("Change support JWS2: build services again."); + BuildWebServiceMenu(); + } }); addInternalFrameListener(new javax.swing.event.InternalFrameAdapter() { @@ -1552,15 +1554,18 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, if (viewport.hasHiddenColumns) { hiddenColumns = new Vector(); - int hiddenOffset = viewport.getSelectionGroup().getStartRes(); + int hiddenOffset = viewport.getSelectionGroup().getStartRes(), hiddenCutoff = viewport + .getSelectionGroup().getEndRes(); for (int i = 0; i < viewport.getColumnSelection().getHiddenColumns() .size(); i++) { int[] region = (int[]) viewport.getColumnSelection() .getHiddenColumns().elementAt(i); - - hiddenColumns.addElement(new int[] - { region[0] - hiddenOffset, region[1] - hiddenOffset }); + if (region[0] >= hiddenOffset && region[1] <= hiddenCutoff) + { + hiddenColumns.addElement(new int[] + { region[0] - hiddenOffset, region[1] - hiddenOffset }); + } } } -- 1.7.10.2