Author: sfederow
Date: 2009-06-11 16:37:59 -0700 (Thu, 11 Jun 2009)
New Revision: 16935
Added:
csplugins/trunk/soc/sfederow/CyAnimator/
csplugins/trunk/soc/sfederow/CyAnimator/.classpath
csplugins/trunk/soc/sfederow/CyAnimator/.project
csplugins/trunk/soc/sfederow/CyAnimator/build.xml
csplugins/trunk/soc/sfederow/CyAnimator/build/
csplugins/trunk/soc/sfederow/CyAnimator/build/CyAnimator.jar
csplugins/trunk/soc/sfederow/CyAnimator/build/classes/
csplugins/trunk/soc/sfederow/CyAnimator/build/classes/src/
csplugins/trunk/soc/sfederow/CyAnimator/build/classes/src/CyAnimator$CyAnimatorCommandListener.class
csplugins/trunk/soc/sfederow/CyAnimator/build/classes/src/CyAnimator.class
csplugins/trunk/soc/sfederow/CyAnimator/build/classes/src/CyAnimatorDialog$frame.class
csplugins/trunk/soc/sfederow/CyAnimator/build/classes/src/CyAnimatorDialog.class
csplugins/trunk/soc/sfederow/CyAnimator/build/classes/src/CyFrame.class
csplugins/trunk/soc/sfederow/CyAnimator/lib/
csplugins/trunk/soc/sfederow/CyAnimator/src/
csplugins/trunk/soc/sfederow/CyAnimator/src/CyAnimator$CyAnimatorCommandListener.class
csplugins/trunk/soc/sfederow/CyAnimator/src/CyAnimator.class
csplugins/trunk/soc/sfederow/CyAnimator/src/CyAnimator.java
csplugins/trunk/soc/sfederow/CyAnimator/src/CyAnimatorDialog.class
csplugins/trunk/soc/sfederow/CyAnimator/src/CyAnimatorDialog.java
csplugins/trunk/soc/sfederow/CyAnimator/src/CyFrame.java
Log:
Added: csplugins/trunk/soc/sfederow/CyAnimator/.classpath
===================================================================
--- csplugins/trunk/soc/sfederow/CyAnimator/.classpath
(rev 0)
+++ csplugins/trunk/soc/sfederow/CyAnimator/.classpath 2009-06-11 23:37:59 UTC
(rev 16935)
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path=""/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/activation.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/biojava-1.4.jar"/>
+ <classpathentry kind="lib" path="/home/stephen/cytoscape/lib/colt.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/coltginy.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/commons-cli-1.x-cytoscape-custom.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/com-nerius-math-xform.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/concurrent.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/cytoscape-cruft-obo.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/cytoscape-geom-rtree.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/cytoscape-geom-spacial.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/cytoscape-graph-dynamic.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/cytoscape-graph-fixed.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/cytoscape-render-export.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/cytoscape-render-immed.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/cytoscape-render-stateful.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/cytoscape-task.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/cytoscape-util-intr.jar"/>
+ <classpathentry kind="lib" path="/home/stephen/cytoscape/lib/ding.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/FastInfoset.jar"/>
+ <classpathentry kind="lib" path="/home/stephen/cytoscape/lib/fing.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/freehep-export-2.1.1.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/freehep-graphics2d-2.1.1.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/freehep-graphicsio-2.1.1.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/freehep-graphicsio-java-2.1.1.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/freehep-graphicsio-ps-2.1.1.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/freehep-graphicsio-svg-2.1.1.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/freehep-io-2.0.2.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/freehep-jas-plotter-2.2.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/freehep-swing-2.0.3.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/freehep-util-2.0.2.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/freehep-xml-2.1.1.jar"/>
+ <classpathentry kind="lib" path="/home/stephen/cytoscape/lib/giny.jar"/>
+ <classpathentry kind="lib" path="/home/stephen/cytoscape/lib/glf.jar"/>
+ <classpathentry kind="lib" path="/home/stephen/cytoscape/lib/http.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/i4jruntime.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/itext-2.0.4.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/jaxb-api.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/jaxb-impl.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/jaxws-api.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/jaxws-rt.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/jaxws-tools.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/jdom-1.0.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/jhall.jar"/>
+ <classpathentry kind="lib" path="/home/stephen/cytoscape/lib/jnlp.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/jsr173_1.0_api.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/jsr181-api.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/jsr250-api.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/junit.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/l2fprod-common-all.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/looks-2.1.4.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/phoebe.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/piccolo.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/resolver.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/saaj-api.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/saaj-impl.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/sjsxp.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/stax-ex.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/streambuffer.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/swing-layout-1.0.1.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/swingx-2006_10_27.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/tclib.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/undo.support.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/violinstrings-1.0.2.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/wizard.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/build-libs/batik-awt-util.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/build-libs/batik-bridge.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/build-libs/batik-css.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/build-libs/batik-dom.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/build-libs/batik-ext.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/build-libs/batik-gvt.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/build-libs/batik-parser.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/build-libs/batik-rasterizer.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/build-libs/batik-rasterizerTask.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/build-libs/batik-script.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/build-libs/batik-svg-dom.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/build-libs/batik-transcoder.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/build-libs/batik-util.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/build-libs/batik-xml.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/build-libs/jakarta-regexp-1.4.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/build-libs/jaxb-libs.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/build-libs/jaxb-xjc.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/build-libs/jfcunit.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/build-libs/relaxngDatatype.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/build-libs/swingunit.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/build-libs/xalan.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/build-libs/xercesImpl-jwsdp.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/build-libs/xsdlib.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/build-libs/jalopy/jalopy.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/build-libs/jalopy/jalopy-ant.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/lib/build-libs/jalopy/log4j.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/cytoscape.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/extra-jars/colt.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/extra-jars/coltginy.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/extra-jars/jfreechart-0.9.20.jar"/>
+ <classpathentry kind="lib"
path="/home/stephen/cytoscape/extra-jars/jfreechart-common-0.9.5.jar"/>
+ <classpathentry kind="output" path=""/>
+</classpath>
Added: csplugins/trunk/soc/sfederow/CyAnimator/.project
===================================================================
--- csplugins/trunk/soc/sfederow/CyAnimator/.project
(rev 0)
+++ csplugins/trunk/soc/sfederow/CyAnimator/.project 2009-06-11 23:37:59 UTC
(rev 16935)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>CyAnimator</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: csplugins/trunk/soc/sfederow/CyAnimator/build/CyAnimator.jar
===================================================================
(Binary files differ)
Property changes on:
csplugins/trunk/soc/sfederow/CyAnimator/build/CyAnimator.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
csplugins/trunk/soc/sfederow/CyAnimator/build/classes/src/CyAnimator$CyAnimatorCommandListener.class
===================================================================
(Binary files differ)
Property changes on:
csplugins/trunk/soc/sfederow/CyAnimator/build/classes/src/CyAnimator$CyAnimatorCommandListener.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
csplugins/trunk/soc/sfederow/CyAnimator/build/classes/src/CyAnimator.class
===================================================================
(Binary files differ)
Property changes on:
csplugins/trunk/soc/sfederow/CyAnimator/build/classes/src/CyAnimator.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
csplugins/trunk/soc/sfederow/CyAnimator/build/classes/src/CyAnimatorDialog$frame.class
===================================================================
(Binary files differ)
Property changes on:
csplugins/trunk/soc/sfederow/CyAnimator/build/classes/src/CyAnimatorDialog$frame.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
csplugins/trunk/soc/sfederow/CyAnimator/build/classes/src/CyAnimatorDialog.class
===================================================================
(Binary files differ)
Property changes on:
csplugins/trunk/soc/sfederow/CyAnimator/build/classes/src/CyAnimatorDialog.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: csplugins/trunk/soc/sfederow/CyAnimator/build/classes/src/CyFrame.class
===================================================================
(Binary files differ)
Property changes on:
csplugins/trunk/soc/sfederow/CyAnimator/build/classes/src/CyFrame.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: csplugins/trunk/soc/sfederow/CyAnimator/build.xml
===================================================================
--- csplugins/trunk/soc/sfederow/CyAnimator/build.xml
(rev 0)
+++ csplugins/trunk/soc/sfederow/CyAnimator/build.xml 2009-06-11 23:37:59 UTC
(rev 16935)
@@ -0,0 +1,107 @@
+<?xml version="1.0"?>
+<!-- build.xml - Build file for Sample Cytoscape Plugin -->
+<project name="CyAnimator" default="jar" basedir=".">
+
+ <!-- Name of Plug In -->
+ <!-- Change this to the name of your Plug In -->
+ <!-- The name is used to create the plugin JAR file -->
+ <property name="plugin.name" value="CyAnimator"/>
+
+ <!-- The directory containing source code -->
+ <property name="src.dir" value="src"/>
+
+ <!-- The directory containing library jar files -->
+ <property name="cytoroot.dir" value="../cytoscape"/>
+
+
+ <property name="release.dir" value="../cytoscape"/>
+
+ <property name="lib.dir" value = "../cytoscape/lib"/>
+
+ <!-- Temporary build directories -->
+
+ <property name="build.dir" value="build"/>
+ <property name="build.classes" value="${build.dir}/classes"/>
+
+ <property name="doc.dir" value="doc"/>
+ <property name="pluginlib.dir" value="lib"/>
+ <property name="plugindata.dir" value="data"/>
+
+ <!-- Global "magic" property for <javac> -->
+ <property name="build.compiler" value="modern"/>
+
+ <!-- Classpath with all lib JAR Files and all Cytoscape Core classes -->
+ <path id="classpath">
+
+ <fileset dir="${lib.dir}">
+ <include name="*.jar"/>
+ </fileset>
+
+ <!-- include cytoscape.jar, which is it release directory top
level -->
+ <fileset dir="${release.dir}">
+ <include name="*.jar"/>
+ </fileset>
+
+ <fileset dir="${pluginlib.dir}">
+ <include name="*.jar"/>
+ </fileset>
+
+ </path>
+
+ <!-- Target to create the build directories prior to compilation -->
+ <target name="prepare">
+ <mkdir dir="${build.dir}"/>
+ <mkdir dir="${build.classes}"/>
+ <!-- copy over images -->
+
+ <!-- <mkdir dir="${dist.dir}"/> -->
+ <!-- <mkdir dir="${doc.dir}"/> -->
+ </target>
+
+ <!-- Target to clean out all directories -->
+ <target name="clean" description="Removes all generated files.">
+ <delete dir="${build.dir}"/>
+ <delete dir="${dist.dir}"/>
+ </target>
+
+ <!-- Target to create Cytoscape Jar File -->
+ <target name="build_cytoscape">
+ <ant antfile="${cytoroot.dir}/cytoscape/build.xml"
inheritAll="false" target="jar"/>
+ </target>
+
+ <!-- Target to create the javadoc information -->
+ <target name="doc" depends="prepare">
+ <echo>${src.dir}</echo>
+ <javadoc destdir="${doc.dir}" Private="yes">
+ <fileset dir="${src.dir}" defaultexcludes="no"/>
+ </javadoc>
+ </target>
+
+
+ <!-- Target to compile all Plug In Code -->
+ <target name="compile" depends="prepare"
+ description="Compiles all PlugIn source code.">
+ <javac debug="Yes" srcdir="${src.dir}"
destdir="${build.classes}">
+ <classpath refid="classpath"/>
+ </javac>
+
+ </target>
+
+ <!-- Create PlugIn Jar File (Unobfuscated) -->
+ <target name="jar" depends="compile" description="Creates PlugIn Jar
File.">
+
+ <unjar dest="${build.classes}">
+ <fileset dir="${pluginlib.dir}"/>
+ </unjar>
+
+
+ <jar destfile="${build.dir}/${plugin.name}.jar">
+ <fileset dir="${build.classes}"/>
+ </jar>
+
+ <echo message="${plugin.name}.jar is now complete. It is
located in build/ directory"/>
+
+ <copy file="${build.dir}/${plugin.name}.jar"
todir="../cytoscape/plugins/core/"/>
+ </target>
+
+</project>
Added:
csplugins/trunk/soc/sfederow/CyAnimator/src/CyAnimator$CyAnimatorCommandListener.class
===================================================================
(Binary files differ)
Property changes on:
csplugins/trunk/soc/sfederow/CyAnimator/src/CyAnimator$CyAnimatorCommandListener.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: csplugins/trunk/soc/sfederow/CyAnimator/src/CyAnimator.class
===================================================================
(Binary files differ)
Property changes on:
csplugins/trunk/soc/sfederow/CyAnimator/src/CyAnimator.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: csplugins/trunk/soc/sfederow/CyAnimator/src/CyAnimator.java
===================================================================
--- csplugins/trunk/soc/sfederow/CyAnimator/src/CyAnimator.java
(rev 0)
+++ csplugins/trunk/soc/sfederow/CyAnimator/src/CyAnimator.java 2009-06-11
23:37:59 UTC (rev 16935)
@@ -0,0 +1,48 @@
+package src;
+
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.*;
+
+
+import cytoscape.Cytoscape;
+import cytoscape.plugin.CytoscapePlugin;
+
+public class CyAnimator extends CytoscapePlugin {
+
+ /**
+ * @param args
+ */
+ public CyAnimator() {
+
+ JMenuItem item = new JMenuItem("CyAnimator");
+
+ item.addActionListener(new CyAnimatorCommandListener());
+
+ JMenu pluginMenu =
Cytoscape.getDesktop().getCyMenus().getMenuBar().getMenu("Plugins");
+
+ pluginMenu.add(item);
+
+
+ }
+
+ class CyAnimatorCommandListener implements ActionListener {
+ //BooleanAlgorithm alg = null;
+
+ public CyAnimatorCommandListener() {
+ //this.alg = algorithm;
+ }
+
+ public void actionPerformed(ActionEvent e) {
+ //if (alg != null) {
+ // Create the dialog
+ CyAnimatorDialog animationDialog = new
CyAnimatorDialog();
+ // Pop it up
+ animationDialog.actionPerformed(e);
+ //}
+ }
+ }
+}
Added: csplugins/trunk/soc/sfederow/CyAnimator/src/CyAnimatorDialog.class
===================================================================
(Binary files differ)
Property changes on:
csplugins/trunk/soc/sfederow/CyAnimator/src/CyAnimatorDialog.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: csplugins/trunk/soc/sfederow/CyAnimator/src/CyAnimatorDialog.java
===================================================================
--- csplugins/trunk/soc/sfederow/CyAnimator/src/CyAnimatorDialog.java
(rev 0)
+++ csplugins/trunk/soc/sfederow/CyAnimator/src/CyAnimatorDialog.java
2009-06-11 23:37:59 UTC (rev 16935)
@@ -0,0 +1,177 @@
+package src;
+
+import giny.model.Node;
+import giny.view.*;
+
+import javax.swing.BorderFactory;
+import javax.swing.BoxLayout;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JOptionPane;
+
+import javax.swing.border.Border;
+import javax.swing.border.EtchedBorder;
+import javax.swing.border.TitledBorder;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+
+import cytoscape.Cytoscape;
+import cytoscape.CyNetwork;
+import cytoscape.CyNode;
+import cytoscape.view.*;
+
+
+import cytoscape.data.CyAttributes;
+import cytoscape.view.CyNetworkView;
+import cytoscape.data.CyAttributes;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.Color;
+import java.awt.Paint;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import java.beans.PropertyChangeEvent;
+import java.util.*;
+
+public class CyAnimatorDialog extends JDialog implements ActionListener,
java.beans.PropertyChangeListener {
+
+ private JPanel mainPanel;
+ private JButton captureFrame;
+ private JButton returnFrame;
+
+ //private NodeView[] currentFrame;
+ private HashMap<String, double[]> posFrame;
+ private HashMap<String, Paint> colFrame;
+ private CyFrame currentFrame;
+
+ public CyAnimatorDialog()
+ {
+
Cytoscape.getSwingPropertyChangeSupport().addPropertyChangeListener(this);
+ //add as listener to CytoscapeDesktop
+
Cytoscape.getDesktop().getSwingPropertyChangeSupport().addPropertyChangeListener(this);
+
+ initialize();
+ }
+
+ public void initialize()
+ {
+
+ mainPanel = new JPanel();
+
+ captureFrame = new JButton("Capture Frame");
+ captureFrame.addActionListener(this);
+ captureFrame.setActionCommand("capture");
+
+ returnFrame = new JButton("Return To Frame");
+ returnFrame.addActionListener(this);
+ returnFrame.setActionCommand("return");
+
+ mainPanel.add(captureFrame);
+ mainPanel.add(returnFrame);
+ this.setSize(new Dimension(120,120));
+ setContentPane(mainPanel);
+ System.out.println("hey");
+
+ }
+
+
+ public void actionPerformed(ActionEvent e)
+ {
+ String command = e.getActionCommand();
+
+ if(command.equals("capture"))
+ {
+ captureSettings();
+
+ }
+
+ if(command.equals("return"))
+ {
+ currentFrame.display();
+ }
+ setVisible(true);
+
+ }
+
+ public void captureSettings()
+ {
+
+
+ CyNetwork currentNetwork = Cytoscape.getCurrentNetwork();
+ currentFrame = new CyFrame(currentNetwork);
+
+
+ //List<Node> nodeList = currentNetwork.nodesList();
+
+ CyNetworkView networkView = Cytoscape.getCurrentNetworkView();
+
+ currentFrame.populate(networkView);
+
+ /*
+ currentFrame = new NodeView[nodeList.size()];
+ posFrame = new HashMap<String, double[]>();
+ colFrame = new HashMap<String, Paint>();
+ for(int i=0;i<nodeList.size();i++)
+ {
+
+ NodeView nodeView = networkView.getNodeView(nodeList.get(i));
+ currentFrame[i] = nodeView;
+ double[] xy = new double[2];
+ xy[0] = nodeView.getXPosition();
+ xy[1] = nodeView.getYPosition();
+ posFrame.put(nodeList.get(i).getIdentifier(), xy);
+ colFrame.put(nodeList.get(i).getIdentifier(),
nodeView.getUnselectedPaint());
+ System.out.println(nodeView.getUnselectedPaint()+" X:
"+nodeView.getXPosition()+" Y: "+nodeView.getYPosition());
+
+ }
+ */
+ }
+
+ public void displayCurrentFrame()
+ {
+ //currentFrame.display();
+
+ /*
+ System.out.println("WOOOO");
+ CyNetwork currentNetwork = Cytoscape.getCurrentNetwork();
+ CyNetworkView networkView = Cytoscape.getCurrentNetworkView();
+ List<Node> nodeList = currentNetwork.nodesList();
+ for(int i=0;i<nodeList.size();i++)
+ {
+
+ NodeView nodeView =
networkView.getNodeView(nodeList.get(i));
+ double[] xy =
posFrame.get(nodeList.get(i).getIdentifier());
+ Paint p = colFrame.get(nodeList.get(i).getIdentifier());
+
+ nodeView.setXPosition(xy[0]);
+ nodeView.setYPosition(xy[1]);
+
+ nodeView.setUnselectedPaint(p);
+ //nodeView.setXPosition(currentFrame[i].getXPosition());
+ //nodeView.setYPosition(currentFrame[i].getYPosition());
+
+
+
//nodeView.setXPosition(cframe.get(nodeList.get(i).getIdentifier()));
+
//nodeView.setYPosition(cframe.get(nodeList.get(i).getIdentifier()));
+
+ }
+ networkView.updateView();
+ */
+ }
+
+ public void propertyChange ( PropertyChangeEvent e ) {
+ if(e.getPropertyName().equals("ATTRIBUTES_CHANGED")){
+ initialize();
+ setVisible(true);
+ }
+ }
+
+
+}
Added: csplugins/trunk/soc/sfederow/CyAnimator/src/CyFrame.java
===================================================================
--- csplugins/trunk/soc/sfederow/CyAnimator/src/CyFrame.java
(rev 0)
+++ csplugins/trunk/soc/sfederow/CyAnimator/src/CyFrame.java 2009-06-11
23:37:59 UTC (rev 16935)
@@ -0,0 +1,83 @@
+package src;
+
+import giny.model.Node;
+import giny.view.NodeView;
+
+import java.awt.Paint;
+import java.util.HashMap;
+import java.util.List;
+
+import cytoscape.Cytoscape;
+import cytoscape.CyNetwork;
+import cytoscape.view.CyNetworkView;
+
+public class CyFrame {
+
+ HashMap<String, double[]> nodePosMap;
+ HashMap<String, Paint> nodeColMap;
+ CyNetworkView networkView = null;
+ List<Node> nodeList = null;
+
+ public CyFrame(CyNetwork currentNetwork){
+ nodePosMap = new HashMap<String, double[]>();
+ nodeColMap = new HashMap<String, Paint>();
+
+ nodeList = currentNetwork.nodesList();
+ networkView = Cytoscape.getCurrentNetworkView();
+
+ }
+
+ //public CyFrame(CyNetwork currentNetwork, List<HashMap<String,
double[]>> valuesList){
+
+ //}
+
+
+ public void populate(CyNetworkView networkView){
+
+
+ for(int i=0;i<nodeList.size();i++)
+ {
+
+ NodeView nodeView = networkView.getNodeView(nodeList.get(i));
+
+ double[] xy = new double[2];
+ xy[0] = nodeView.getXPosition();
+ xy[1] = nodeView.getYPosition();
+
+ nodePosMap.put(nodeList.get(i).getIdentifier(), xy);
+ nodeColMap.put(nodeList.get(i).getIdentifier(),
nodeView.getUnselectedPaint());
+ System.out.println(nodeView.getUnselectedPaint()+" X:
"+nodeView.getXPosition()+" Y: "+nodeView.getYPosition());
+
+ }
+ }
+
+
+ public void display(){
+ System.out.println("WOOOO");
+ CyNetwork currentNetwork = Cytoscape.getCurrentNetwork();
+ CyNetworkView networkView = Cytoscape.getCurrentNetworkView();
+ List<Node> nodeList = currentNetwork.nodesList();
+ for(int i=0;i<nodeList.size();i++)
+ {
+
+ NodeView nodeView =
networkView.getNodeView(nodeList.get(i));
+ double[] xy =
nodePosMap.get(nodeList.get(i).getIdentifier());
+ Paint p =
nodeColMap.get(nodeList.get(i).getIdentifier());
+
+ nodeView.setXPosition(xy[0]);
+ nodeView.setYPosition(xy[1]);
+
+ nodeView.setUnselectedPaint(p);
+ //nodeView.setXPosition(currentFrame[i].getXPosition());
+ //nodeView.setYPosition(currentFrame[i].getYPosition());
+
+
+
//nodeView.setXPosition(cframe.get(nodeList.get(i).getIdentifier()));
+
//nodeView.setYPosition(cframe.get(nodeList.get(i).getIdentifier()));
+
+ }
+ networkView.updateView();
+ }
+
+
+}
\ No newline at end of file
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---