trim hidden regions outside selection when copying selected region to clipboard ...
authorjprocter <Jim Procter>
Tue, 8 Jun 2010 14:27:20 +0000 (14:27 +0000)
committerjprocter <Jim Procter>
Tue, 8 Jun 2010 14:27:20 +0000 (14:27 +0000)
src/jalview/gui/AlignFrame.java

index dcb1a09..2d1fc1e 100755 (executable)
@@ -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 });
+        }
       }
     }