All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ij.macro.StartupRunner Maven / Gradle / Ivy

Go to download

ImageJ is an open source Java image processing program inspired by NIH Image for the Macintosh.

There is a newer version: 1.54m
Show newest version
package ij.macro;
import ij.IJ;
import ij.plugin.MacroInstaller;
import ij.plugin.Startup;

/** Runs the RunAtStartup (created by Edit/Options/Startup) and AutoRun (in StartupMacros) macros. */
public class StartupRunner implements Runnable {

	/** Runs the RunAtStartup and AutoRun macros, on the current thread
		if 'batchMode' true, otherwise on a separate thread. */
	public void run(boolean batchMode) {
		if (IJ.debugMode) IJ.log("StartupRunner: "+batchMode);
		if (batchMode)
			run();
		else {
			Thread thread = new Thread(this, "StartupRunner");
			thread.start();
		}
	}

	public void run() {
 		String macro = (new Startup()).getStartupMacro();
 		if (macro!=null && macro.length()>4) {
 			if (macro.contains("setForegroundColor"))
 				IJ.wait(100);
 			IJ.runMacro(macro);
 		}
		MacroInstaller.autoRun();
 	}
 	
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy