Author: sfederow
Date: 2010-10-25 11:40:25 -0700 (Mon, 25 Oct 2010)
New Revision: 22363

Modified:
   csplugins/trunk/soc/sfederow/CyAnimator/.classpath
   csplugins/trunk/soc/sfederow/CyAnimator/build.xml
   csplugins/trunk/soc/sfederow/CyAnimator/src/CyAnimator.java
   csplugins/trunk/soc/sfederow/CyAnimator/src/CyAnimatorDialog.java
   csplugins/trunk/soc/sfederow/CyAnimator/src/CyFrame.java
Log:


Modified: csplugins/trunk/soc/sfederow/CyAnimator/.classpath
===================================================================
--- csplugins/trunk/soc/sfederow/CyAnimator/.classpath  2010-10-25 18:22:26 UTC 
(rev 22362)
+++ csplugins/trunk/soc/sfederow/CyAnimator/.classpath  2010-10-25 18:40:25 UTC 
(rev 22363)
@@ -97,5 +97,14 @@
        <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="lib" 
path="/home/stephen/cytoscape/lib/equations.jar"/>
+       <classpathentry kind="lib" 
path="/home/stephen/cytoscape/lib/jsr173_api.jar"/>
+       <classpathentry kind="lib" 
path="/home/stephen/cytoscape/lib/lucene-core-3.0.1.jar"/>
+       <classpathentry kind="lib" 
path="/home/stephen/cytoscape/lib/mimepull.jar"/>
+       <classpathentry kind="lib" 
path="/home/stephen/cytoscape/lib/phoebe.dnd.jar"/>
+       <classpathentry kind="lib" 
path="/home/stephen/cytoscape/lib/swing-layout-1.0.3.jar"/>
+       <classpathentry kind="lib" 
path="/home/stephen/cytoscape/lib/swingx-1.0.jar"/>
+       <classpathentry kind="lib" 
path="/home/stephen/cytoscape/lib/swingx-beaninfo-1.0.jar"/>
+       <classpathentry kind="lib" 
path="/home/stephen/cytoscape/lib/woodstox.jar"/>
        <classpathentry kind="output" path=""/>
 </classpath>

Modified: csplugins/trunk/soc/sfederow/CyAnimator/build.xml
===================================================================
--- csplugins/trunk/soc/sfederow/CyAnimator/build.xml   2010-10-25 18:22:26 UTC 
(rev 22362)
+++ csplugins/trunk/soc/sfederow/CyAnimator/build.xml   2010-10-25 18:40:25 UTC 
(rev 22363)
@@ -11,12 +11,12 @@
        <property name="src.dir" value="src"/>
 
        <!--  The directory containing library jar files -->    
-       <property name="cytoroot.dir" value="../cytoscape"/>
+       <property name="cytoroot.dir" value="../Cytoscape_v2.7.0"/>
        
         <property name="images.dir" value="img"/>      
-       <property name="release.dir" value="../cytoscape"/>
+       <property name="release.dir" value="../Cytoscape_v2.7.0"/>
 
-       <property name="lib.dir" value = "../cytoscape/lib"/>
+       <property name="lib.dir" value = "../Cytoscape_v2.7.0/lib"/>
        
        <!-- Temporary build directories -->
 
@@ -74,7 +74,7 @@
        
        <!-- Target to create Cytoscape Jar File  -->
        <target name="build_cytoscape">
-               <ant antfile="${cytoroot.dir}/cytoscape/build.xml" 
inheritAll="false" target="jar"/>
+               <ant antfile="${cytoroot.dir}/Cytoscape_v2.7.0/build.xml" 
inheritAll="false" target="jar"/>
        </target>
 
  <!--       Target to create the javadoc information -->
@@ -102,13 +102,19 @@
          <fileset dir="${pluginlib.dir}"/>
         </unjar>
 
+      <copy file="plugin.props" todir="${build.classes}" />
 
       <jar destfile="${build.dir}/${plugin.name}.jar">
         <fileset dir="${build.classes}"/>
+               <manifest>
+         <attribute name="Cytoscape-Plugin"
+                    value="CyAnimator" />
+         </manifest>
+
         </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/"/>
+               <copy file="${build.dir}/${plugin.name}.jar" 
todir="../Cytoscape_v2.7.0/plugins/"/>
        </target>
 
 </project>

Modified: csplugins/trunk/soc/sfederow/CyAnimator/src/CyAnimator.java
===================================================================
--- csplugins/trunk/soc/sfederow/CyAnimator/src/CyAnimator.java 2010-10-25 
18:22:26 UTC (rev 22362)
+++ csplugins/trunk/soc/sfederow/CyAnimator/src/CyAnimator.java 2010-10-25 
18:40:25 UTC (rev 22363)
@@ -1,23 +1,49 @@
 package CyAnimator;
 
-import javax.swing.JMenu;
-import javax.swing.JMenuItem;
+import java.util.*;
 import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 
-import javax.swing.*;
 
-
+import cytoscape.plugin.CytoscapePlugin;
+import cytoscape.util.CytoscapeAction;
 import cytoscape.Cytoscape;
-import cytoscape.plugin.CytoscapePlugin;
 
+
+
+
 public class CyAnimator extends CytoscapePlugin {
 
+               
        /**
         * @param args
         */
        public CyAnimator() {
+               CyAnimatorAction action = new CyAnimatorAction();
+               action.setPreferredMenu("Plugins");
+               Cytoscape.getDesktop().getCyMenus().addAction(action);
                
+
+    }          
+       
+       class CyAnimatorAction extends CytoscapeAction {
+               
+
+               public CyAnimatorAction() {super("CyAnimatorrr"); }     
+               
+               public void actionPerformed(ActionEvent e) {
+                       System.out.println("WWDDDWWWWWWWWW");
+                       CyAnimatorDialog animationDialog = new 
CyAnimatorDialog();
+                       // Pop it up
+                       animationDialog.actionPerformed(e);
+                        
+               }
+               
+       }
+       /**
+        * @param args
+        */
+       /*public CyAnimator() {
+               
                JMenuItem item = new JMenuItem("CyAnimator");
                
                item.addActionListener(new CyAnimatorCommandListener());
@@ -25,10 +51,10 @@
                JMenu pluginMenu = 
Cytoscape.getDesktop().getCyMenus().getMenuBar().getMenu("Plugins");
                
                pluginMenu.add(item);
-               
-               
+                       
        }
-
+       */
+       /*
        class CyAnimatorCommandListener implements ActionListener {
                //BooleanAlgorithm alg = null;
 
@@ -45,4 +71,5 @@
                        //} 
                }
        }
+       */
 }

Modified: csplugins/trunk/soc/sfederow/CyAnimator/src/CyAnimatorDialog.java
===================================================================
--- csplugins/trunk/soc/sfederow/CyAnimator/src/CyAnimatorDialog.java   
2010-10-25 18:22:26 UTC (rev 22362)
+++ csplugins/trunk/soc/sfederow/CyAnimator/src/CyAnimatorDialog.java   
2010-10-25 18:40:25 UTC (rev 22363)
@@ -114,6 +114,7 @@
        private JMenuItem menuItem;
        private JPanel mainPanel;
        private JPopupMenu thumbnailMenu;
+       private JPopupMenu metabolicOptions;
        private JSlider speedSlider;
        final JFileChooser fc = new JFileChooser();
        
@@ -234,6 +235,16 @@
                this.setSize(new Dimension(500,220));
                this.setLocation(900, 100);
                
+               metabolicOptions = new JPopupMenu();
+               menuItem = new JMenuItem("Map Metabolic");
+               menuItem.addActionListener(this);
+               menuItem.setActionCommand("Initiate Metabolic");
+               metabolicOptions.add(menuItem);
+               //mainPanel.setComponentPopupMenu(metabolicOptions);
+               MouseListener extraPopupListener = new ExtraPopupListener();
+               framePane.addMouseListener(extraPopupListener);
+
+               
                setContentPane(mainPanel);
                
                
@@ -363,6 +374,26 @@
                        frameManager.setKeyFrameList(frameList);
                        updateThumbnails();
                }       
+               
+               if(command.equals("Initiate Metabolic")){
+                       MetabolicModule module = null;
+                       fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+                       int returnVal = fc.showOpenDialog(new JPanel());
+                        if (returnVal == JFileChooser.APPROVE_OPTION) {
+                       File file = fc.getSelectedFile();
+                       String filePath = file.getPath();
+                       //System.out.println(filePath+" "+file.getName());
+                       try{
+                                       module = new MetabolicModule(filePath);
+                               }catch (Exception excp) {
+                                       System.out.println(excp.getMessage()); 
+                               }
+                        }
+                       frameManager = module.getFrameManager();
+                       updateThumbnails();
+                        
+               }
+               
                setVisible(true);
        }
 
@@ -720,9 +751,25 @@
                }
            }
        }
+       class ExtraPopupListener extends MouseAdapter {
+           public void mousePressed(MouseEvent e) {
+               maybeShowPopup(e);
+           }
+
+           public void mouseReleased(MouseEvent e) {
+               maybeShowPopup(e);
+           }
+
+           private void maybeShowPopup(MouseEvent e) {
+               if (e.isPopupTrigger()) {
+                   metabolicOptions.show(e.getComponent(),
+                              e.getX(), e.getY());
+               }
+           }
+       }
+
        
        
-       
        protected ImageIcon createImageIcon(String path, String description) {
                java.net.URL imgURL = getClass().getResource(path);
                if (imgURL != null) {

Modified: csplugins/trunk/soc/sfederow/CyAnimator/src/CyFrame.java
===================================================================
--- csplugins/trunk/soc/sfederow/CyAnimator/src/CyFrame.java    2010-10-25 
18:22:26 UTC (rev 22362)
+++ csplugins/trunk/soc/sfederow/CyAnimator/src/CyFrame.java    2010-10-25 
18:40:25 UTC (rev 22363)
@@ -37,6 +37,7 @@
 import java.awt.Graphics2D;
 import java.awt.Color;
 import java.awt.Image;
+import java.awt.Stroke;
 import java.awt.image.*;
 import java.awt.Paint;
 import java.io.IOException;
@@ -116,7 +117,7 @@
                nodeViewList = new ArrayList();
                edgeViewList = new ArrayList();
                
-               // Initialize our node view maps
+               // Initialize our edge view maps
                Iterator<EdgeView> eviter = networkView.getEdgeViewsIterator();
                while(eviter.hasNext()) {
                        EdgeView ev = eviter.next();
@@ -124,7 +125,7 @@
                        edgeViewList.add(ev);
                }
 
-               // Initialize our edge view maps
+               // Initialize our node view maps
                Iterator<NodeView> nviter = networkView.getNodeViewsIterator();
                while(nviter.hasNext()) {
                        NodeView nv = nviter.next();
@@ -307,6 +308,11 @@
                        if (p == null || edgeView == null) continue;
                        Integer trans = 
edgeOpacityMap.get(edge.getIdentifier());
                        edgeView.setUnselectedPaint(new Color(p.getRed(), 
p.getGreen(), p.getBlue(), trans));
+                       //Added as of 7/1/2010, must have been some kind of 
internal change in the API
+                       Stroke oldStroke = edgeView.getStroke();
+                       Stroke newStroke = 
LineStyle.extractLineStyle(oldStroke).getStroke(edgeWidthMap.get(edge.getIdentifier()));
+                       edgeView.setStroke(newStroke);
+                       System.out.println(edge.getIdentifier()+": 
"+edgeWidthMap.get(edge.getIdentifier()));
                        
edgeView.setStrokeWidth(edgeWidthMap.get(edge.getIdentifier()));
                }
                currentView.setBackgroundPaint(backgroundPaint);

-- 
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.

Reply via email to