Use AAFrequency final keys
[jalview.git] / src / jalview / gui / AlignFrame.java
index 79f1e8b..27503f9 100755 (executable)
@@ -115,7 +115,7 @@ public class AlignFrame
   {
     this.setDropTarget(new java.awt.dnd.DropTarget(this, this));
 
-    if (viewport.vconsensus == null)
+    if (viewport.hconsensus == null)
     {
       //Out of memory calculating consensus.
       BLOSUM62Colour.setEnabled(false);
@@ -415,6 +415,9 @@ public class AlignFrame
       tabbedPane.addTab(ap.av.viewName==null?"Original":ap.av.viewName, ap);
     }
 
+    ap.av.updateConsensus(ap);
+    ap.av.updateConservation(ap);
+
 
     ap.av.addPropertyChangeListener(new PropertyChangeListener()
     {
@@ -832,7 +835,7 @@ public class AlignFrame
    */
   void updateEditMenuBar()
   {
-    if (historyList.size() > 0)
+  /*  if (historyList.size() > 0)
     {
       undoMenuItem.setEnabled(true);
 
@@ -856,7 +859,7 @@ public class AlignFrame
     {
       redoMenuItem.setEnabled(false);
       redoMenuItem.setText("Redo");
-    }
+    }*/
   }
 
   /**
@@ -1614,10 +1617,11 @@ public class AlignFrame
    if (av.padGaps)
        av.getAlignment().padGaps();
 
-     if (av.vconsensus != null && av.autoCalculateConsensus)
+     if (av.hconsensus != null && av.autoCalculateConsensus)
      {
-       av.updateConsensus();
-       av.updateConservation();
+       av.updateConsensus(ap);
+       av.updateConservation(ap);
+       ap.annotationPanel.repaint();
      }
 
      resetAllColourSchemes();
@@ -1643,7 +1647,7 @@ public class AlignFrame
                           viewport.alignment.getWidth());
       }
 
-      cs.setConsensus(viewport.vconsensus);
+      cs.setConsensus(viewport.hconsensus);
       if (cs.conservationApplied())
       {
         Alignment al = (Alignment) viewport.alignment;
@@ -2089,7 +2093,7 @@ public class AlignFrame
         cs.setConservation(null);
       }
 
-      cs.setConsensus(viewport.vconsensus);
+      cs.setConsensus(viewport.hconsensus);
     }
 
     viewport.setGlobalColourScheme(cs);
@@ -2747,16 +2751,26 @@ public class AlignFrame
   {
     return ShowNewickTree(nf,title,600,500,4,5);
   }
+  public TreePanel ShowNewickTree(NewickFile nf, String title, AlignmentView input)
+  {
+    return ShowNewickTree(nf,title, input, 600,500,4,5);
+  }
+  public TreePanel ShowNewickTree(NewickFile nf, String title, int w,int h,int x, int y) {
+    return ShowNewickTree(nf, title, null, w, h, x, y);
+  }
   /**
-   * DOCUMENT ME!
-   *
-   * @param nf DOCUMENT ME!
-   * @param title DOCUMENT ME!
+   * Add a treeviewer for the tree extracted from a newick file object to the current alignment view 
    *
-   * @return DOCUMENT ME!
+   * @param nf the tree
+   * @param title tree viewer title
+   * @param input Associated alignment input data (or null)
+   * @param w width
+   * @param h height
+   * @param x position
+   * @param y position
+   * @return TreePanel handle
    */
-  public TreePanel ShowNewickTree(NewickFile nf, String title, int w,int h,int x, int y)
-  {
+  public TreePanel ShowNewickTree(NewickFile nf, String title, AlignmentView input, int w,int h,int x, int y) {
     TreePanel tp = null;
 
     try
@@ -2768,7 +2782,7 @@ public class AlignFrame
         tp = new TreePanel(alignPanel,
                            "FromFile",
                            title,
-                           nf);
+                           nf, input);
 
         tp.setSize(w,h);
 
@@ -2884,7 +2898,7 @@ public class AlignFrame
               if (msa.getSequences().length == 1)
               {
                 // Single Sequence prediction
-                new jalview.ws.JPredClient(sh, title, false, msa, af);
+                new jalview.ws.JPredClient(sh, title, false, msa, af, true);
               }
               else
               {
@@ -2892,7 +2906,7 @@ public class AlignFrame
                 {
                   // Sequence profile based prediction
                   new jalview.ws.JPredClient(sh,
-                      title, true, msa, af);
+                      title, true, msa, af, true);
                 }
               }
             }
@@ -3210,4 +3224,4 @@ public void drop(DropTargetDropEvent evt)
   {
     return viewport;
   }
-}
+}
\ No newline at end of file