To Install Eclipse with the Visual Editor

  1. Download the Galileo 3.5 version of Eclipse from http://www.eclipse.org/downloads/. The IDE for Java Developers is a good one to use.

  2. Extract the files to a location on your hard disk. Note that there is no installation of Eclipse required, so if you mess up any of the steps, you can simply delete the extracted files and begin again.

  3. Start Eclipse by clicking on eclipse.exe

  4. In the Workspace Launcher, type in the location where you want to store all of your files and press Enter.

  5. Select Help Install New Software….

  6. In the Install window, click the link in the “Find more software by working with the ‘Available Software Sites’ preferences” link.

  7. Click the Add Button.

  8. In the Add Site window, put in the Name “Releases” and the Location http://download.eclipse.org/releases/galileo

  9. Repeat this for: Visual Editor and http://download.eclipse.org/tools/ve/updates/1.4/

  10. Click Test Connection for each site

  11. When the test has finished Click Ok.

  12. Set the “Work with” dropdown list to Visual Editor – Http://download.eclipse.org/tools/ve/updates/1.4/.

  13. Click the box marked Contact all update sites during install to find required software.

  14. Expand the VE 1.40 item in the list can check the box for Visual Editor.

  15. Click Next

  16. Click Next again.

  17. Click to accept the terms of the license agreement and click Finish.

  18. The software will install.

  19. Click Yes to restart Eclipse.

  20. When Eclipse restarts, confirm the location where you want to keep your development files and click OK.

  21. You will now have the ability to create a new project using the Visual Editor.





To create a plugin for ImageJ

  1. Download and install the Java Development Kit (JDK). The current version as of this writing is JDK 6 Update 16 (http://java.sun.com/javase/downloads/index.jsp)

  2. Create a project.

    1. Start Eclipse.

    2. When the Workspace Launcher starts, enter the directory of the folder where you want all of your files to be stored and click OK (1).

Figure

    1. Click the “X” on the “Welcome” tab. This will display the workbench

    2. Click File New Java Project (2).

Figure

    1. Next the New Java Project window will appear (3). Put in the Project Name.

Figure

    1. Select Use default JRE.

    2. Click Finish.

    3. You now have a project created (4). Click the + sign next to the Project name to see the folders and resources contained in the project.

Figure

  1. Configure the Project.

    1. Select Project Properties (5).

Figure

    1. The Properties window will open. Select Java Build Path from the list on the left.

    2. In the Java Build Path window on the right, select the Libraries tab (6).

Figure



    1. Click on the Add External JARs button.

    2. Navigate to the tools.jar file in the java development kit directory (Ususally in c:\Program Files\Java\jdk1.6.0_16\lib\tools.jar and click Open (7).

Figure

    1. Click on the Source Tab.

    2. Click on the ImageJ Project/src folder and click the Remove (8).

Figure

    1. Click on the Add Folder button.

    2. The Source Folder Selection Window will appear. Click the Create New Folder button (9).

Figure

    1. When the New Source Folder window appears, type the name of the folder where the ImageJ source files will be stored (10). Click Finish.

Figure

    1. Click on the Project Name again and then click the Create New Folder button again. Specify the name of the folder where the Plugin source files will be kept. Click Finish.

    2. There should now be two checked folders, both of which are sub-folders of the Project Name folder (11). Click OK.

Figure

    1. Back in the Project Properties window, click the “Allow output folder for source folders” checkbox.

    2. Replace the word “bin” with “plugins” in the Default output folder field. If this is not set correctly, then the plugin will not appear in the ImageJ plugin folder.

    3. Click to expand the listing for both the ImageJ source files and the Plugin source files.

    4. Below the line listing the ImageJ Source Files folder, select the line “Output folder: (Default output folder) and click on the Edit button (12).

Figure

    1. When the Source Folder Output Location window appears, select the option: Specific output folder (13).

Figure

    1. Specify the name of the folder which will hold the ImageJ output files (these will be compiled .class files) and click OK.

    2. Below the line listing the Plugin Source Files folder, select the line “Output folder: (Default output folder) and click on the Edit button.

    3. Specify the name “plugins”. If this is not set correctly, then the plugin will not appear in the ImageJ plugin folder. Click OK.

    4. The Sources are now configured. The configuration should look like 14.

Figure

    1. In the list on the left, click on Run/Debug Settings.

    2. Click OK to exit the Project Properties window.

  1. Copy the ImageJ Source files

    1. Download the ImageJ source code from http://rsbweb.nih.gov/ij/download/src/

    2. Extract the files to the ImageJ Source Files directory within the project folder.

    3. In the Eclipse window, select File Refresh. There should now be a + sign next to the ImageJSouceFiles. Clicking this + sign will display all of the ImageJ Source Files (15).

Figure

  1. Configure the Run/Debug Settings

    1. Click on Project Properties again.

    2. Click on Run/Debug Settings line on the left (16).

Figure

    1. Click the New button

    2. In the Select Configuration Type window which appears, select Java Application and click OK (17).

Figure

    1. The Edit Configuration window will appear. Give a name to the launch configuration (18).

Figure



    1. Click the Browse button and the Project Selection window will appear (19). Select the project and click OK.

Figure

    1. Back in the Edit Configuration window, click on the Search button.

    2. In the Select Main Type window that appears, select “ImageJ – ij” and click OK (20).

Figure

    1. Click on the Common tab.

    2. Check the boxes before Debug and Run (21). Then click OK.

Figure

    1. Click OK again to exit the Properties window.

  1. Remove the Unused src Folder

    1. Right click on the src folder in the Eclipse window and select Delete (22).

Figure



    1. Confirm the deletion by clicking OK on the Confirm Delete dialog (23).

Figure

  1. Begin Developing a Plugin

    1. You are now set to develop a plugin for ImageJ. Clicking on the Run or Debug buttons will start ImageJ.

    2. To begin plugin development, right click on the Plugin Source Files folder and select New Class.

    3. In the New Java Class dialog, enter a Name for the class file. Remember that plugins will only appear in the plugin folder listing if they contain an underscore in their name.

    4. You may now begin programming. A Hello World program is:

import ij.IJ;

import ij.plugin.PlugIn;



public class New_Plugin implements PlugIn {


public void run(String arg) {

IJ.showMessage("My_Plugin", "Hello world!");

}

}

    1. You may also start creating GUIs using the visual editor by right click on the Plugin Source Files folder and select New Visual Class