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();
62 * Triggers a tree partition from the specified x coordinate.
67 public void partitionTree(final int x);
70 * Looks up the given TreeNodeI in the tree and highlights Jalview sequences
71 * that belong to it or its descendants.
74 * node from where the descendants should get matched, this node
77 public void showMatchingChildSequences(TreeNodeI parentNode);
80 * Highlights the Jalview sequence belonging to the given TreeNodeI (if
85 public void showMatchingSequence(TreeNodeI nodeToMatch);
88 * If a node is selected in the tree panel this method highlights the
89 * corresponding sequence in the Jalview alignment view. If an internal node
90 * is selected all child sequences get highlighted as well.
92 public void showNodeSelectionOnAlign(TreeNodeI node);
95 * Sorts the given alignment by the order in which the sequences appear in the
99 * panel containing the alignment to be sorted.
100 * @return the sorting Command
102 public CommandI sortAlignmentIn(AlignmentPanel alignPanel);
105 * Is triggered when the user wants to sort the Jalview alignment by the
106 * sequence order of the tree.
108 public void sortByTree_actionPerformed();
111 * Is triggered when the users wants to hide sequences in the Jalview
112 * alignment view that are part of a currently collapsed sub tree.
114 public void hideCollapsedSequences_actionPerformed();
117 * If the nodes that should be matched have changed (different one selected by
118 * the user), this method notifies the Jalview alignment view that the
119 * matching sequences have changed as well.
122 * the new SequenceI that should be matched.
124 public void treeSelectionChanged(SequenceI sequence);