Author: pwang
Date: 2013-02-15 14:34:33 -0800 (Fri, 15 Feb 2013)
New Revision: 31124

Added:
   csplugins/trunk/ucsd/kono/bingo-impl/src/main/java/BiNGO/internal/
   
csplugins/trunk/ucsd/kono/bingo-impl/src/main/java/BiNGO/internal/BiNGOAction.java
Log:
Refactored

Added: 
csplugins/trunk/ucsd/kono/bingo-impl/src/main/java/BiNGO/internal/BiNGOAction.java
===================================================================
--- 
csplugins/trunk/ucsd/kono/bingo-impl/src/main/java/BiNGO/internal/BiNGOAction.java
                          (rev 0)
+++ 
csplugins/trunk/ucsd/kono/bingo-impl/src/main/java/BiNGO/internal/BiNGOAction.java
  2013-02-15 22:34:33 UTC (rev 31124)
@@ -0,0 +1,59 @@
+package BiNGO.internal;
+
+import org.cytoscape.application.swing.CySwingApplication;
+import org.cytoscape.application.swing.AbstractCyAction;
+
+import BiNGO.internal.ui.SettingsPanel;
+
+import java.awt.event.ActionEvent;
+import javax.swing.JFrame;
+import java.io.File;
+
+public class BiNGOAction extends AbstractCyAction {
+
+       
+       private static final String CURRENT_WORKING_DIRECTORY = "user.dir";
+       private static final String MENU_NAME = "Start BiNGO Plugin";
+       private static final String MENU_CATEGORY = "Tools";
+       
+       private static final String WINDOW_TITLE = "BiNGO Settings";
+
+       private String bingoDir;
+
+       private CySwingApplication desktopApp;
+
+       public BiNGOAction(CySwingApplication desktopApp){
+               // Add a sub-menu item -- Apps->Sample04->sample04
+               super("BiNGO");
+               setPreferredMenu("Apps");
+               //Specify the menuGravity value to put the menuItem in the 
desired place
+               setMenuGravity(2.0f);
+
+               this.desktopApp = desktopApp;
+       }
+
+
+       /**
+       * This method opens the BiNGO settingspanel upon selection of the menu
+       * item and opens the settingspanel for BiNGO.
+       * 
+       * @param event
+       *            event triggered when BiNGO menu item clicked.
+       */
+       public void actionPerformed(ActionEvent e) {
+
+               String cwd = System.getProperty(CURRENT_WORKING_DIRECTORY);
+               bingoDir = new File(cwd, "plugins").toString();
+
+               final JFrame window = new JFrame(WINDOW_TITLE);
+               final SettingsPanel settingsPanel = new SettingsPanel(bingoDir);
+               window.getContentPane().add(settingsPanel);
+               window.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+               window.pack();
+       
+               window.setLocationRelativeTo(this.desktopApp.getJFrame());
+               window.setVisible(true);                        
+       }
+
+}
+


Property changes on: 
csplugins/trunk/ucsd/kono/bingo-impl/src/main/java/BiNGO/internal/BiNGOAction.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cytoscape-cvs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to