// Source Code Retriever // This macro searches for a menu entry listed in IJ_Props.txt and tries to // retrieve the java source file of the respective plugin from the latest // IJ daily build // // Tiago Ferreira, March 2010 srcURLr= "http://rsbweb.nih.gov/ij/source/"; srcURLb= "http://rsbweb.nih.gov/ij/developer/source/index.html"; props = File.openUrlAsString(srcURLr+"IJ_Props.txt"); msg1= "This macro parses 'IJ_Props.txt' (the IJ properties file) for a" + "\n"+ "menu entry and retrieves the java source file (from the latest" + "\n"+ "daily build) of the class implementing that ImageJ command.\n " + "\n"+ "All IJ source files are highly annotated containing detailed" + "\n"+ "informations useful to both developers and regular users" + "\n"+ "that want to know more about IJ routines and algorithms."; msg2= "Note that 'Plugins>Utilities>Search...' can search the IJ" + "\n"+ "source code if it has been downloaded (rsb.info.nih.gov/ij/" + "\n"+ "download/src/) and extracted into the IJ folder."; msg3 ="Type in the IJ command exactly as it is listed on its Menu." + "\n"+ "You can omit ellipsis from the menu entry, e.g.: \"Add...\"" + "\n"+ "is the same as \"Add\" ('Process>Math>Add...' command)."; if(indexOf(props, "UnknownHost")!=-1) exit("Unable to connect to the ImageJ web site...\n \n"+msg1); Dialog.create('Source Code Retriever'); Dialog.addMessage(msg1); Dialog.addMessage(msg2); Dialog.addMessage(msg3); Dialog.addString(" ","Gaussian Blur",37); Dialog.addHelp(srcURLb); Dialog.show; cmd = Dialog.getString; props = split(props, "\n"); str= ""; for(i=0; i