Build a plugin without Gephi source code
Clone this wiki locally
It is possible to build a plugin using only binary installation of Gephi. The principle is to compile the plugin using the Gephi binary installation as a NetBeans platform.
First, you need a Gephi binary installation, such as the one that can be downloaded at http://gephi.org
Registering Gephi as a NetBeans Platform
Open the "Tools|NetBeans Platforms" dialog, click on "Add Platform...", and choose the directory containing the Gephi binary installation. Note that when the NetBeans IDE detects a NetBeans Platform in a directory, the "Platform Name" label is filled with the identifier of this platform.
By example, in the next picture, a Gephi installation was found in the /opt/gephi-0.8-beta directory.
Click on the Next button, and change the platform name if required. In that example, it was required to change the platform name to "Gephi 0.8 beta", since the Gephi 0.8 alpha and beta have the same identifier, namely "Gephi 0.8 alpha".
As you can see, two Gephi platforms have been registered.
Build a Plugin
To build a plugin, it requires to:
- Create a module suite, event if your suite contains only one plugin, and make this suite use the Gephi platform;
- Create a plugin in the module suite.
- Add as dependencies of your modules the NetBeans and Gephi modules containing the functionalities required.
Creation of a Module Suite
- Click on "New|New Project";
- In Categories, choose "NetBeans Modules, and "Module Suite" in projects, then click on the Next button;
- Configure the name, locations at your will.
- Choose the NetBeans Plaform you want to use. Here, you have to choose one of the Gephi platforms you have previously registered.
Creation of a Module
- Click on "New|New Project";
- In Categories, choose "NetBeans Modules, and "Module" in projects, then click on the Next button;
- Configure the name, locations at your will. Add the new module to the module suite created in the previous step.
Display after the creation of the module suite and the module
Add the Gephi Dependencies
When some Gephi SPI/API are required by your module:
- In the Projects window, right-click on the "Libraries" item in the module tree.;
- Select the "Add Module Dependency";
- In the Filter textfield, enter a part or the totality of the interface/class required by your module.
- Select in the Module pane the module containing the interface/class required.
The Gephi SPI/API is not seen when editing and compiling
If the interfaces and classes are not seen by the editor and the compiler, please process the following steps:
- Check the suite is using Gephi as its NetBeans platform by :
- Right-click on the suite project, click on the "Properties" item;
- In Categories, choose "Libraries". In the right pane, check whether the NetBeans Platform is using a Gephi installation, and change the platform if Gephi is not selected.
- In the Platform Modules tree, check the box for the gephi suite of modules, so that all the modules composing Gephi are used when compiling your module.
Module Version not compatible
If an error message similar to "Cannot compile against a module: org-gephi-data-attributes-api.jar because of dependency: org.gephi.data.attributes.api > 0.8", it means the configuration of your module is requiring a Gephi module more recent than those provided by the Gephi platform used. A solution is to open the "Module Dependendies" dialog by doing:
- Right click on the module, choose the "Properties" item;
- In Categories, click on "Libraries";
- In the "Module Dependencies" tab, select the module causing problem, and edit the requirements on its version number.