/*
 * ITab.java Copyright (C) 2020. Daniel H. Huson
 *
 *  (Some files contain contributions from other authors, who are then mentioned separately.)
 *
 *  This program 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.
 *
 *  This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

package megan.clusteranalysis.gui;

import jloda.swing.find.IObjectSearcher;
import jloda.swing.graphview.GraphView;
import megan.clusteranalysis.tree.Distances;
import megan.clusteranalysis.tree.Taxa;

/**
 * basic tab interface
 * Daniel Huson, 9.2015
 */
public interface ITab {
    /**
     * this tab has been selected
     */
    void activate();

    /**
     * this tab has been deselected
     */
    void deactivate();

    /**
     * compute the graphics
     *
     * @param taxa
     * @param distances
     */
    void compute(Taxa taxa, Distances distances) throws Exception;

    /**
     * get the label
     *
     * @return
     */
    String getLabel();

    /**
     * get the method name
     *
     * @return method of computation
     */
    String getMethod();

    /**
     * update the view
     *
     * @param what
     */
    void updateView(String what);

    /**
     * get the associated graphview
     *
     * @return graphview
     */
    GraphView getGraphView();

    /**
     * zoom to fit
     */
    void zoomToFit();

    /**
     * zoom to selection
     */
    void zoomToSelection();

    /**
     * gets the searcher associated with this tab
     *
     * @return searcher
     */
    IObjectSearcher getSearcher();

    /**
     * should this tab be enabled?
     *
     * @return true, if currently applicable
     */
    boolean isApplicable();

    /**
     * need update
     *
     * @return update
     */
    boolean needsUpdate();
}
