JAL-2009 added programmatic custom feature setting to show insertion position for...
[jalview.git] / src / jalview / gui / CutAndPasteTransfer.java
index c0e59a4..76f1041 100644 (file)
@@ -23,6 +23,7 @@ package jalview.gui;
 import jalview.api.AlignViewportI;
 import jalview.api.AlignmentViewPanel;
 import jalview.api.ComplexAlignFile;
+import jalview.api.FeatureSettingsModelI;
 import jalview.api.FeaturesDisplayedI;
 import jalview.api.FeaturesSourceI;
 import jalview.bin.Jalview;
@@ -253,12 +254,19 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer
     {
       String title = MessageManager.formatMessage(
               "label.input_cut_paste_params", new String[] { format });
+      FeatureSettingsModelI proxyColourScheme = source
+              .getFeatureColourScheme();
+
       /*
        * if the view panel was closed its alignment is nulled
        * and this is an orphaned cut and paste window
        */
       if (viewport != null && viewport.getAlignment() != null)
       {
+        if (proxyColourScheme != null)
+        {
+          viewport.applyFeaturesStyle(proxyColourScheme);
+        }
         ((AlignViewport) viewport).addAlignment(al, title);
       }
       else
@@ -297,7 +305,10 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer
             af.getViewport().setShowSequenceFeatures(true);
           }
         }
-
+        if (proxyColourScheme != null)
+        {
+          af.getViewport().applyFeaturesStyle(proxyColourScheme);
+        }
         af.currentFileFormat = format;
         Desktop.addInternalFrame(af, title, AlignFrame.DEFAULT_WIDTH,
                 AlignFrame.DEFAULT_HEIGHT);