treeView = archaeopteryx.getTreePanel();
ssm = parentAvport.getStructureSelectionManager();
+ aptxFrame.setViewBinding(this);
ssm.addSelectionListener(this);
treeView.addMouseListener(this);
treeView.registerWithPaintRefresher(
if (treeView.showingSubTree())
{
- LoadedTreeSequenceAssociation bindAptxNodes = new LoadedTreeSequenceAssociation(
- parentAvport.getAlignment().getSequencesArray(),
+ LoadedTreeSequenceAssociation bindAptxNodes = new LoadedTreeSequenceAssociation(
+ parentAvport.getAlignment().getSequencesArray(),
treeView.getTree());
- bindAptxNodes.associateLeavesToSequences();
- sequencesBoundToNodes = bindAptxNodes.getAlignmentWithNodes();
- nodesBoundToSequences = bindAptxNodes.getNodesWithAlignment();
- TreeViewerUtils.associateNodesWithJalviewSequences(aptxFrame, parentAvport,
- sequencesBoundToNodes, nodesBoundToSequences);
+ bindAptxNodes.associateNodesToSequences();
+ sequencesBoundToNodes = bindAptxNodes.getAlignmentWithNodes();
+ nodesBoundToSequences = bindAptxNodes.getNodesWithAlignment();
+ TreeViewerUtils.associateNodesWithJalviewSequences(aptxFrame,
+ parentAvport, sequencesBoundToNodes, nodesBoundToSequences);
-
- for (SequenceI seq : parentAvport.getAlignment().getSequencesArray())
- {
- if (!sequencesBoundToNodes.containsKey(seq))
+ for (SequenceI seq : parentAvport.getAlignment().getSequencesArray())
{
- parentAvport.hideSequence(new SequenceI[] { seq });
- }
+ if (!sequencesBoundToNodes.containsKey(seq))
+ {
+ parentAvport.hideSequence(new SequenceI[] { seq });
+ }
}
}
rootX = tree.getRoot().getXcoord();
// don't bother if 0 distance tree or clicked x lies outside of tree
- if (furthestNodeX != rootX && !(x > furthestNodeX))
- {
+ // if (furthestNodeX != rootX && !(x > furthestNodeX))
+
float threshold = (x - rootX) / (furthestNodeX - rootX);
List<TreeNodeI> foundNodes = getNodesAboveThreshold(
threshold,
tree.getRoot());
- }
- else
- {
- // clear previous colours?
- }
+
}
}
- public List<TreeNodeI> getNodesAboveThreshold(double threshold,
+ public List<TreeNodeI> getNodesAboveThreshold(float threshold,
TreeNodeI node)
{
* @return
*/
private List<TreeNodeI> colourNodesAboveThreshold(
- List<TreeNodeI> nodeList, double threshold,
+ List<TreeNodeI> nodeList, float threshold,
TreeNodeI node)
{
}
- /**
- * may or may not need an extra repaint on the alignment view (check what kira
- * does)
- */
+
@Override
public void showNodeSelectionOnAlign(final TreeNodeI node)
{
for (TreeNodeI childNode : childNodes)
{
- // childNode.getBranchData().setBranchColor(new BranchColor(Color.BLUE));
-
SequenceI matchingSequence = nodesBoundToSequences.get(childNode);
if (matchingSequence != null)
{
}
- /**
- * Refactored from TreeCanvas.
- *
- * @param sequence
- * of the node selected in the tree viewer.
- */
+
@Override
public void treeSelectionChanged(final SequenceI sequence)
{
@Override
public CommandI sortAlignmentIn(AlignmentPanel ap)
{
- // TODO: move to alignment view controller
-
AlignmentViewport viewport = ap.av;
SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();
try
.getAssociatedPanels(parentAvport.getSequenceSetId());
}
+ @Override
+ public Map<SequenceI, TreeNodeI> getAlignmentWithNodes()
+ {
+ return sequencesBoundToNodes;
+ }
+
+ @Override
+ public Map<TreeNodeI, SequenceI> getNodesWithAlignment()
+ {
+ return nodesBoundToSequences;
+ }
}