Attachment 'HelloWorldPlugin.java'

Download

   1 package helloworld;
   2 
   3 import java.awt.event.ActionEvent;
   4 import javax.swing.JOptionPane;
   5 import cytoscape.Cytoscape;
   6 import cytoscape.plugin.CytoscapePlugin;
   7 import cytoscape.util.CytoscapeAction;
   8 
   9 /**
  10  * A menu item "Hello World" will appear at Plugins menu. Click on the menu
  11  * item, a message dialog will show up.
  12  */
  13 public class HelloWorldPlugin extends CytoscapePlugin {
  14 
  15 	public HelloWorldPlugin() {
  16 		MyPluginMenuAction menuAction = new MyPluginMenuAction(this);
  17 		Cytoscape.getDesktop().getCyMenus().addCytoscapeAction((CytoscapeAction) menuAction);
  18 	}
  19 	
  20 	public class MyPluginMenuAction extends CytoscapeAction {
  21 
  22 		public MyPluginMenuAction(HelloWorldPlugin myPlugin) {
  23 			super("Hello World");
  24 			setPreferredMenu("Plugins");
  25 		}
  26 
  27 		public void actionPerformed(ActionEvent e) {
  28 			JOptionPane.showMessageDialog(Cytoscape.getDesktop(),"Hello World is selected!");	
  29 		}
  30 	}
  31 }
  32 

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.

You are not allowed to attach a file to this page.

Funding for Cytoscape is provided by a federal grant from the U.S. National Institute of General Medical Sciences (NIGMS) of the Na tional Institutes of Health (NIH) under award number GM070743-01. Corporate funding is provided through a contract from Unilever PLC.

MoinMoin Appliance - Powered by TurnKey Linux