From: jprocter Date: Tue, 30 Aug 2011 15:12:04 +0000 (+0100) Subject: patch for JAL-729 - NPE avoided and cut and paste import pane is opened X-Git-Tag: Release_2_7~60 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ca812007f560910bab66a186420d8fde7cb461cf;p=jalview.git patch for JAL-729 - NPE avoided and cut and paste import pane is opened --- diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index d2b04f9..7030637 100644 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -1032,7 +1032,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, private Hashtable getDisplayedFeatureCols() { - if (alignPanel.getFeatureRenderer() != null) + if (alignPanel.getFeatureRenderer() != null && viewport.featuresDisplayed!=null) { FeatureRenderer fr = alignPanel.getFeatureRenderer(); Hashtable fcols = new Hashtable(); @@ -1065,12 +1065,25 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, if (displayTextbox) { - CutAndPasteTransfer cap = new CutAndPasteTransfer(false, this); + boolean frimport=false; + if (features==null || features.equals("No Features Visible")) + { + features = "# No features visible - paste some and import them here."; + frimport=true; + } + + CutAndPasteTransfer cap = new CutAndPasteTransfer(frimport, this); + if (frimport) + { + cap.setAnnotationImport(); + } Frame frame = new Frame(); frame.add(cap); jalview.bin.JalviewLite.addFrame(frame, "Features", 600, 500); - cap.setText(features); + } else { + if (features==null) + features = ""; } return features;