package vnt;
/**
 * Compile_All.java - v1.0
 * Began: April 23, 2006
 * Last Updated: April 23, 2007 
 * 
 * Copyright (C) 2005 - Michael D. Miller - mdm162@truman.edu
 * Truman State University
 * 100 E. Normal
 * Kirksville, MO - 63501
 * 
 * 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 2
 * 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, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 */

import ij.*;
import ij.gui.*;
import java.awt.*;
import java.awt.Color.*;
import ij.plugin.PlugIn;
import ij.process.*;
import java.io.*;
import ij.io.*;
import java.lang.String.*;
import java.lang.Math.*;

/**
 * <p>This program quickly compiles all the known VNT plugins quickly.
 * May be used in an "install" plugin or macro. This is largely useful
 * for the developer to rapidly make changes to plugins without having
 * to individually compile them or install a separate macro.</p>
 * 
 * @author Michael Miller - Truman State University
 * @version 1.0
 * @since 1.0
 */
public class Compile_All extends VascularNetworkToolkit implements PlugIn {

    /**
     * This is called at the start of the plugin. 
     *  
     * <p>Pre: ImageJ is open.
     * <br />Post: All known VNT plugins are compiled. 
     * @param arg Required by the interface. The argument, if any (may be blank).
     */
    public void run(String arg){
        IJ.showMessage("Compile-All about to begin", "ImageJ will now attempt to compile all known VNT plugins.\nThis will produce several popup windows, please wait until a final message is displayed.");

        IJ.run("Compile and Run...", "compile=/usr/local/ImageJ/plugins/VNT/Basic_Segment.java");
        IJ.run("Compile and Run...", "compile=/usr/local/ImageJ/plugins/VNT/FindEdges_Segment.java");
        IJ.run("Compile and Run...", "compile=/usr/local/ImageJ/plugins/VNT/Batch_File.java");
        IJ.run("Compile and Run...", "compile=/usr/local/ImageJ/plugins/VNT/Batch_Folder.java");
        IJ.run("Compile and Run...", "compile=/usr/local/ImageJ/plugins/VNT/Compile_All.java");
        IJ.run("Compile and Run...", "compile=/usr/local/ImageJ/plugins/VNT/Create_Settings.java");
        IJ.run("Compile and Run...", "compile=/usr/local/ImageJ/plugins/VNT/Debug_tool.java");
        IJ.run("Compile and Run...", "compile=/usr/local/ImageJ/plugins/VNT/DistanceMap_Outline.java");
        IJ.run("Compile and Run...", "compile=/usr/local/ImageJ/plugins/VNT/DistanceMap_Skeleton.java");
        IJ.run("Compile and Run...", "compile=/usr/local/ImageJ/plugins/VNT/Endpoint_Prune.java");
        IJ.run("Compile and Run...", "compile=/usr/local/ImageJ/plugins/VNT/Eye_Candy.java");
        IJ.run("Compile and Run...", "compile=/usr/local/ImageJ/plugins/VNT/Lighting_Correction.java");
        IJ.run("Compile and Run...", "compile=/usr/local/ImageJ/plugins/VNT/Node_Analysis.java");
        IJ.wait(2*1000); // assume it takes 10 seconds to compile them all (ms)
        
        IJ.showMessage("Compile-All Complete", "ImageJ must be restarted for plugin changes to take effect.\nPressing OK will close ImageJ now.");
        
        IJ.run("Quit");
        return;
    }
}