+ String treeType;
+
+ String scoreModelName; // if tree computed
+
+ String treeTitle; // if tree loaded
+
+ SimilarityParamsI similarityParams;
+
+ private TreeCanvas treeCanvas;
+
+ TreeModel tree;
+
+ private AlignViewport av;
+
+ /**
+ * Creates a new TreePanel object.
+ *
+ * @param ap
+ * @param type
+ * @param modelName
+ * @param options
+ */
+ public TreePanel(AlignmentPanel ap, String type, String modelName,
+ SimilarityParamsI options)
+ {
+ super();
+ this.setFrameIcon(null);
+ this.similarityParams = options;
+ initTreePanel(ap, type, modelName, null, null);
+
+ // We know this tree has distances. JBPNote TODO: prolly should add this as
+ // a userdefined default
+ // showDistances(true);
+ }
+
+ public TreePanel(AlignmentPanel alignPanel, NewickFile newtree,
+ String theTitle, AlignmentView inputData)
+ {
+ super();
+ this.setFrameIcon(null);
+ this.treeTitle = theTitle;
+ 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();
+ }
+
+ public AlignmentViewport getViewPort()
+ {
+ // @Mungo - Why don't we return our own viewport ???
+ return getTreeCanvas().getViewport();
+ }
+
+ void initTreePanel(AlignmentPanel ap, String type, String modelName,
+ NewickFile newTree, AlignmentView inputData)
+ {
+
+ av = ap.av;
+ this.treeType = type;
+ this.scoreModelName = modelName;
+
+ treeCanvas = new TreeCanvas(this, ap, scrollPane);
+ scrollPane.setViewportView(treeCanvas);
+
+ if (columnWise)