Author: pwang
Date: 2013-02-22 11:52:51 -0800 (Fri, 22 Feb 2013)
New Revision: 31136
Added:
csplugins/trunk/ucsd/kono/bingo-impl/src/main/java/bingo/internal/BingoPluginAction.java
Log:
Original creation
Added:
csplugins/trunk/ucsd/kono/bingo-impl/src/main/java/bingo/internal/BingoPluginAction.java
===================================================================
---
csplugins/trunk/ucsd/kono/bingo-impl/src/main/java/bingo/internal/BingoPluginAction.java
(rev 0)
+++
csplugins/trunk/ucsd/kono/bingo-impl/src/main/java/bingo/internal/BingoPluginAction.java
2013-02-22 19:52:51 UTC (rev 31136)
@@ -0,0 +1,50 @@
+package bingo.internal;
+
+import java.awt.event.ActionEvent;
+import java.io.File;
+import javax.swing.JFrame;
+import org.cytoscape.app.swing.CySwingAppAdapter;
+import org.cytoscape.application.swing.AbstractCyAction;
+import bingo.internal.ui.SettingsPanel;
+
+
+public class BingoPluginAction 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 final CySwingAppAdapter adapter;
+ private String bingoDir;
+ private static final long serialVersionUID = 4190390703299860130L;
+
+ // The constructor sets the text that should appear on the menu item.
+ public BingoPluginAction(final CySwingAppAdapter adapter) {
+ super(MENU_NAME);
+ this.adapter = adapter;
+ setPreferredMenu(MENU_CATEGORY);
+
+ String cwd = System.getProperty(CURRENT_WORKING_DIRECTORY);
+ bingoDir = new File(cwd, "plugins").toString();
+ }
+
+ /**
+ * 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 event) {
+ final JFrame window = new JFrame(WINDOW_TITLE);
+ final SettingsPanel settingsPanel = new SettingsPanel(bingoDir,
(CySwingAppAdapter)adapter);
+ window.getContentPane().add(settingsPanel);
+ window.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+ window.pack();
+
+ // Cytoscape Main Window
+ final JFrame desktop =
adapter.getCySwingApplication().getJFrame();
+ window.setLocationRelativeTo(desktop);
+ window.setVisible(true);
+ }
+}
Property changes on:
csplugins/trunk/ucsd/kono/bingo-impl/src/main/java/bingo/internal/BingoPluginAction.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.