JAL-1665 refactored Sequence.getSequenceFeatures
[jalview.git] / src / jalview / bin / JalviewLite.java
index 833dd7e..447a9ea 100644 (file)
@@ -709,8 +709,8 @@ public class JalviewLite extends Applet implements
    */
   public void loadAnnotationFrom(AlignFrame alf, String annotation)
   {
-    if (new AnnotationFile().readAnnotationFile(alf.getAlignViewport()
-            .getAlignment(), annotation, AppletFormatAdapter.PASTE))
+    if (new AnnotationFile().annotateAlignmentView(alf.getAlignViewport(),
+            annotation, AppletFormatAdapter.PASTE))
     {
       alf.alignPanel.fontChanged();
       alf.alignPanel.setScrollValues(0, 0);
@@ -1875,6 +1875,7 @@ public class JalviewLite extends Applet implements
       if ((al != null) && (al.getHeight() > 0))
       {
         dbgMsg("Successfully loaded file.");
+        al.setDataset(null); // create dataset sequences
         newAlignFrame = new AlignFrame(al, applet, file, embedded);
         if (initialAlignFrame == null)
         {
@@ -1999,8 +2000,8 @@ public class JalviewLite extends Applet implements
         {
           param = setProtocolState(param);
 
-          if (new AnnotationFile().readAnnotationFile(
-                  newAlignFrame.viewport.getAlignment(), param, protocol))
+          if (new AnnotationFile().annotateAlignmentView(
+                  newAlignFrame.viewport, param, protocol))
           {
             newAlignFrame.alignPanel.fontChanged();
             newAlignFrame.alignPanel.setScrollValues(0, 0);
@@ -2024,6 +2025,12 @@ public class JalviewLite extends Applet implements
                     param, protocol);
             JnetAnnotationMaker.add_annotation(predictions,
                     newAlignFrame.viewport.getAlignment(), 0, false); // false==do
+            SequenceI repseq = newAlignFrame.viewport.getAlignment()
+                    .getSequenceAt(0);
+            newAlignFrame.viewport.getAlignment().setSeqrep(repseq);
+            ColumnSelection cs = new ColumnSelection();
+            cs.hideInsertionsFor(repseq);
+            newAlignFrame.viewport.setColumnSelection(cs);
             // not
             // add
             // sequence