JAL-1551 spotlessApply
[jalview.git] / src / jalview / gui / TreePanel.java
index 9a4f2c4..0e1fd42 100755 (executable)
@@ -53,6 +53,7 @@ import jalview.bin.Console;
 import jalview.commands.CommandI;
 import jalview.commands.OrderCommand;
 import jalview.datamodel.Alignment;
+import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.AlignmentView;
 import jalview.datamodel.BinaryNode;
@@ -123,6 +124,39 @@ public class TreePanel extends GTreePanel
     initTreePanel(alignPanel, null, null, newtree, inputData);
   }
 
+  /**
+   * columnwise tree associated with positions in aa
+   * 
+   * @param alignPanel
+   * @param fin
+   * @param title
+   * @param aa
+   */
+  public TreePanel(AlignmentPanel alignPanel, NewickFile fin,
+          AlignmentAnnotation aa, String title)
+  {
+    super();
+    columnWise = true;
+    assocAnnotation = aa;
+    this.setFrameIcon(null);
+    this.treeTitle = title;
+    initTreePanel(alignPanel, null, null, fin, null);
+  }
+
+  boolean columnWise = false;
+
+  AlignmentAnnotation assocAnnotation = null;
+
+  public boolean isColumnWise()
+  {
+    return columnWise;
+  }
+
+  public AlignmentAnnotation getAssocAnnotation()
+  {
+    return assocAnnotation;
+  }
+
   public AlignmentI getAlignment()
   {
     return getTreeCanvas().getViewport().getAlignment();
@@ -142,6 +176,15 @@ public class TreePanel extends GTreePanel
     this.treeType = type;
     this.scoreModelName = modelName;
 
+    if (columnWise)
+    {
+      bootstrapMenu.setVisible(false);
+      placeholdersMenu.setSelected(false);
+      placeholdersMenu.setVisible(false);
+      fitToWindow.setSelected(false);
+      sortAssocViews.setVisible(false);
+    }
+
     treeCanvas = new TreeCanvas(this, ap, scrollPane);
     scrollPane.setViewportView(treeCanvas);