Cytoscape Online Plugin Tutorial

"Hello World" Cytoscape Plugin

Here is a simple "Hello World" example as a Cytoscape plugin where a Java Swing utility class is used to display the message in a dialog window.


import javax.swing.JOptionPane;
import cytoscape.plugin.CytoscapePlugin;
import cytoscape.Cytoscape;

public class HelloWorld extends CytoscapePlugin {

    public HelloWorld() {
        String message = "Hello World!";
        System.out.println(message);
        JOptionPane.showMessageDialog(Cytoscape.getDesktop(), message);
    }
}

HelloWorld.java
HelloWorld.jar

Looking at the Plugin

Imports:

import cytoscape.plugin.CytoscapePlugin;
import cytoscape.Cytoscape;
Methods:

      public HelloWorldPlugin ()

To load this plugin into Cytoscape, save the jar file at the above link to your local disk in the Cytoscape plugins folder. Then start Cytoscape which will then load the plugin from the jar. You should see the "Hello World" dialog appear above your main Cytoscape window.