2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.ext.treeviewer;
23 import jalview.commands.CommandI;
24 import jalview.datamodel.SequenceI;
25 import jalview.gui.AlignmentPanel;
26 import jalview.structure.SelectionListener;
27 import jalview.structure.SelectionSource;
29 import java.awt.event.ActionListener;
30 import java.awt.event.MouseListener;
35 * Interface for associating the nodes of a tree viewer with Jalview alignment
36 * sequences and communicating between the two. Assumes a tree viewer will both
37 * want to receive and send selection events.
39 * @author kjvanderheide
43 public interface TreeViewerBindingI
44 extends ActionListener, MouseListener, SelectionListener,
48 * Gets the mapping for sequences with their associated tree nodes
52 public Map<SequenceI, TreeNodeI> getAlignmentWithNodes();
55 * Gets the mapping for tree nodes with their associated sequences
59 public Map<TreeNodeI, SequenceI> getNodesWithAlignment();
64 * coordinate that functions as the clustering threshold
66 public void partitionTree(final int x);
68 public void showMatchingChildSequences(TreeNodeI parentNode);
70 public void showMatchingSequence(TreeNodeI nodeToMatch);
73 * If a node is selected in the tree panel this method highlights the
74 * corresponding sequence in the Jalview alignment view. If an internal node
75 * is selected all child sequences get highlighted as well.
77 public void showNodeSelectionOnAlign(TreeNodeI node);
80 * Sorts the given alignment by the order in which the sequences appear in the
84 * Panel containing the alignment to be sorted.
85 * @return the sorting Command
87 public CommandI sortAlignmentIn(AlignmentPanel alignPanel);
89 public void sortByTree_actionPerformed();
91 public void treeSelectionChanged(SequenceI sequence);