/* * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) * Copyright (C) $$Year-Rel$$ The Jalview Authors * * This file is part of Jalview. * * Jalview is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, either version 3 * of the License, or (at your option) any later version. * * Jalview is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Jalview. If not, see . * The Jalview Authors are detailed in the 'AUTHORS' file. */ package jalview.ext.treeviewer; import jalview.commands.CommandI; import jalview.datamodel.SequenceI; import jalview.gui.AlignmentPanel; import jalview.structure.SelectionListener; import jalview.structure.SelectionSource; import java.awt.event.ActionListener; import java.awt.event.MouseListener; import java.util.Map; /** * * Interface for associating the nodes of a tree viewer with Jalview alignment * sequences and communicating between the two. Assumes a tree viewer will both * want to receive and send selection events. * * @author kjvanderheide * * */ public interface TreeViewerBindingI extends ActionListener, MouseListener, SelectionListener, SelectionSource { /** * Gets the mapping for sequences with their associated tree nodes * * @return */ public Map getAlignmentWithNodes(); /** * Gets the mapping for tree nodes with their associated sequences * * @return */ public Map getNodesWithAlignment(); /** * * @param x * coordinate that functions as the clustering threshold */ public void partitionTree(final int x); public void showMatchingChildSequences(TreeNodeI parentNode); public void showMatchingSequence(TreeNodeI nodeToMatch); /** * If a node is selected in the tree panel this method highlights the * corresponding sequence in the Jalview alignment view. If an internal node * is selected all child sequences get highlighted as well. */ public void showNodeSelectionOnAlign(TreeNodeI node); /** * Sorts the given alignment by the order in which the sequences appear in the * tree. * * @param alignPanel * Panel containing the alignment to be sorted. * @return the sorting Command */ public CommandI sortAlignmentIn(AlignmentPanel alignPanel); public void sortByTree_actionPerformed(); public void treeSelectionChanged(SequenceI sequence); }