Skip to content

Add a module panel

Eduardo Ramos edited this page Jan 7, 2015 · 1 revision

How to create a panel for plugin features, similar to Ranking, Graph or Layout? It is easy and fully integrated in Netbeans. Create your panel class and use Netbeans IDE to design the user interface. This page also explains how to work with the Perspective system.


  • Step 1: Right click on your module and select New > Other... and find Window like showed in the step 1 below. The window wizard asks where to put your panel. You can use already defined modes (i.e. positions):
    • graphmode: Centered, full-size
    • rankingmode: Top Left position
    • layoutmode: Bottom Left position
    • timelinemode: Below others, at the bottom
    • filtersmode: Bottom Right
    • contextmode: Top Right


  • Step 2: Then check options about the panel policy showed in step2 and click on Next.


  • Step 3: Fill the Class Name, the system shows which files are created. Your panel is a TopComponent subclass.


  • Step 4: Click on Finish, files are created and you're invited to design your panel with Netbeans editor.


Your panel is now created and automatically registered. Start Gephi with your plugin and your panel is visible.

Register in a Perspective

Overview, Data Laboratory and Preview are perspectives in Gephi. A perspective is simply a set of panels that works together. When users change the perspective, some panels are hidden and others are showed. When you define a new panel above, it is not part of a perspective and therefore is always visible, regardless which perspective you are. Follow the steps to associate your panel with a perspective.

  1. Add Desktop Perspective as a new module dependency. Right-click on your module and Properties.
  2. Go to your TopComponent sources and add PerspectiveMember as interface.
  3. Add the @ServiceProvider annotation to be registered by the system and implement methods (note: you will need to add the 'Desktop Perspective' to the Module Dependencies screenshots).
public final class MyTopComponent extends TopComponent implements PerspectiveMember {

Implement `open()` and `close()` methods like below to attach the component to the `LaboratoryPerspective`, works also for `OverviewPerspective` and `PreviewPerspective`:

public boolean open(Perspective perspective) {
   return perspective instanceof LaboratoryPerspective;
public boolean close(Perspective perspective) {
   return true;

Specifically use close() method if you want your panel to be visible on several perspectives.


Change panel title

Open the file in your module and update CTL_MyTopComponent key.

Set Icon

In the TopComponent sources, uncomment the following line and set the icon path.

setIcon(ImageUtilities.loadImage(ICON_PATH, true));


Clone this wiki locally