Author: pwang Date: 2012-04-06 13:39:36 -0700 (Fri, 06 Apr 2012) New Revision: 28753
Added: csplugins/trunk/ucsd/pwang/sandbox2/pom.xml csplugins/trunk/ucsd/pwang/sandbox2/src/ csplugins/trunk/ucsd/pwang/sandbox2/src/main/ csplugins/trunk/ucsd/pwang/sandbox2/src/main/java/ csplugins/trunk/ucsd/pwang/sandbox2/src/main/java/org/ csplugins/trunk/ucsd/pwang/sandbox2/src/main/java/org/cytoscape/ csplugins/trunk/ucsd/pwang/sandbox2/src/main/java/org/cytoscape/sandbox/ csplugins/trunk/ucsd/pwang/sandbox2/src/main/java/org/cytoscape/sandbox/SandboxAction.java csplugins/trunk/ucsd/pwang/sandbox2/src/main/java/org/cytoscape/sandbox/SandboxPlugin.java Log: Original creation Added: csplugins/trunk/ucsd/pwang/sandbox2/pom.xml =================================================================== --- csplugins/trunk/ucsd/pwang/sandbox2/pom.xml (rev 0) +++ csplugins/trunk/ucsd/pwang/sandbox2/pom.xml 2012-04-06 20:39:36 UTC (rev 28753) @@ -0,0 +1,43 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.cytoscape</groupId> + + <parent> + <groupId>cytoscape.coreplugins</groupId> + <artifactId>parent</artifactId> + <version>2.8.3-SNAPSHOT</version> + </parent> + + + <artifactId>sandbox</artifactId> + <packaging>jar</packaging> + <name>sandbox</name> + + + <!-- bootstrap for cytoscape dependencies, namely the parent POM snapshots --> + <repositories> + <repository> + <id>cytoscape_snapshots</id> + <snapshots> + <enabled>true</enabled> + </snapshots> + <releases> + <enabled>false</enabled> + </releases> + <name>Cytoscape Snapshots</name> + <url>http://cytoscape.wodaklab.org/nexus/content/repositories/snapshots/</url> + </repository> + <repository> + <id>cytoscape_releases</id> + <snapshots> + <enabled>false</enabled> + </snapshots> + <releases> + <enabled>true</enabled> + </releases> + <name>Cytoscape Releases</name> + <url>http://cytoscape.wodaklab.org/nexus/content/repositories/releases/</url> + </repository> + </repositories> + +</project> \ No newline at end of file Added: csplugins/trunk/ucsd/pwang/sandbox2/src/main/java/org/cytoscape/sandbox/SandboxAction.java =================================================================== --- csplugins/trunk/ucsd/pwang/sandbox2/src/main/java/org/cytoscape/sandbox/SandboxAction.java (rev 0) +++ csplugins/trunk/ucsd/pwang/sandbox2/src/main/java/org/cytoscape/sandbox/SandboxAction.java 2012-04-06 20:39:36 UTC (rev 28753) @@ -0,0 +1,55 @@ +package org.cytoscape.sandbox; + +import cytoscape.CyNode; +import cytoscape.Cytoscape; +import cytoscape.util.CytoscapeAction; +import java.awt.event.ActionEvent; +import java.net.URL; +import java.util.Iterator; + +import cytoscape.CyNetwork; +import cytoscape.view.CyNetworkView; +import cytoscape.data.CyAttributes; +import cytoscape.layout.CyLayoutAlgorithm; +import cytoscape.visual.VisualStyle; + +/** + * A simple action. Change the names as appropriate and + * then fill in your expected behavior in the actionPerformed() + * method. + */ +public class SandboxAction extends CytoscapeAction { + + public SandboxAction() { + // Give your action a name here + super("Sandbox"); + + // Set the menu you'd like here. Plugins don't need + // to live in the Plugins menu, so choose whatever + // is appropriate! + setPreferredMenu("Plugins"); + } + + public void actionPerformed(ActionEvent e) { + + System.out.println( "\nMenuItem sandbox is clicked!\n "); + + CyAttributes nodeAttrs = Cytoscape.getNodeAttributes(); + Iterator<CyNode> it = Cytoscape.getCurrentNetwork().nodesIterator(); + + + while (it.hasNext()){ + CyNode node = it.next(); + + String name = nodeAttrs.getAttribute(node.getIdentifier(), "canonicalName").toString(); + + if (name.equalsIgnoreCase("ASDF")){ + + } + + System.out.println( "\tname = "+ name); + } + + + } +} Added: csplugins/trunk/ucsd/pwang/sandbox2/src/main/java/org/cytoscape/sandbox/SandboxPlugin.java =================================================================== --- csplugins/trunk/ucsd/pwang/sandbox2/src/main/java/org/cytoscape/sandbox/SandboxPlugin.java (rev 0) +++ csplugins/trunk/ucsd/pwang/sandbox2/src/main/java/org/cytoscape/sandbox/SandboxPlugin.java 2012-04-06 20:39:36 UTC (rev 28753) @@ -0,0 +1,25 @@ + +package org.cytoscape.sandbox; + +import cytoscape.Cytoscape; +import cytoscape.plugin.CytoscapePlugin; + + +/** + * This class is used to instantiate your plugin. Put whatever initialization code + * you need into the no argument constructor (the only one that will be called). + * The actual functionality of your plugin can be in this class, but should + * probably be separated into separted classes that get instantiated here. + */ +public class SandboxPlugin extends CytoscapePlugin { + + public SandboxPlugin() { + // Properly initializes things. + super(); + + // This action represents the actual behavior of the plugin. + SandboxAction action = new SandboxAction(); + Cytoscape.getDesktop().getCyMenus().addAction(action); + + } +} -- You received this message because you are subscribed to the Google Groups "cytoscape-cvs" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/cytoscape-cvs?hl=en.
