package Tools;

import javax.swing.JOptionPane;
import plot.PLOTJ;
/**
 *
 * @author JMDK
 */
public class Tool2 extends plot.PLOTJPlugin {
    String iconPath = "/icons/DNA.png";
    public Tool2(){
        /**
         * Set the name of the tool that will be displayed for the menu item.
         */
        setName("Tool 2 Menu text");
        /**
         * Set the description of the tool that will be displayed in the status
         * label at the bottom of the pLOT window when the mouse is hovering over
         * the menu or button (it the tool is on the toolbar.
         */
        setDescription("Tool 2 description");
        /**
         * Set the plugin icon path.  If none is set or the path is invalid then
         * the default icon is used.  This icon is displayed as the icon for the
         * plugin's menu item or toolbar button.
         */
        setIcon(iconPath);
    }
    @Override
    public void run() {
        /**
         * This is the function that is called when the plugin is run.  A plugin
         * can call the following functions to interface with pLOT and access the
         * sequence information in the open windows:
         *  - getParentInstance()
         *      Returns the PLOT window that was active when the plugin was called.
         *      This is not necessarily the same as the window that is currently active.
         *      Calling getParentInstance().getProject() returns the parent window's
         *      sequence document which can be manipulated as needed.
         *  - PLOTJ.getActiveInstance()
         *      Returns the PLOT window that is currently active.
         *  - PLOTJ.getActiveDocument()
         *      Returns the sequence Document from the active window.  This is the same as
         *      calling PLOTJ.getActiveInstance().getProject().
         *  - PLOTJ.newInstance() creates and returns a new PLOTJ window.  It is
         *      not automatically visible.  The .getProject() function can be used
         *      as with any other PLOTJ window to access and manipulate the sequence
         *      Document.  To set the window visible, use the setVisible(true) function
         *      of the created instance.
         *  - PLOTJ.newOutputWindow() returns a generic output window for displaying
         *      information.  Alternatively, the plugin can simply make its own
         *      custom JFrame.
         */
        JOptionPane.showMessageDialog(getParentInstance(), "Hello from Tool 2");
    }
}
