Author: scooter
Date: 2010-10-31 20:43:06 -0700 (Sun, 31 Oct 2010)
New Revision: 22672

Modified:
   csplugins/trunk/ucsf/scooter/chemViz/build.xml
   csplugins/trunk/ucsf/scooter/chemViz/src/chemViz/model/Compound.java
   
csplugins/trunk/ucsf/scooter/chemViz/src/chemViz/tasks/CreateNodeGraphicsTask.java
Log:
Some bug fixes based on work preparing chemViz poster


Modified: csplugins/trunk/ucsf/scooter/chemViz/build.xml
===================================================================
--- csplugins/trunk/ucsf/scooter/chemViz/build.xml      2010-10-31 06:30:43 UTC 
(rev 22671)
+++ csplugins/trunk/ucsf/scooter/chemViz/build.xml      2010-11-01 03:43:06 UTC 
(rev 22672)
@@ -28,6 +28,9 @@
   <path id="compile.classpath">
     <pathelement path="${build.dir}/classes" />
     <fileset dir="${cytoscape.dir}">
+      <include name="*.jar" />
+    </fileset>
+    <fileset dir="${cytoscape.dir}">
       <include name="cytoscape.jar" />
     </fileset>
     <fileset dir="${lib.dir}">

Modified: csplugins/trunk/ucsf/scooter/chemViz/src/chemViz/model/Compound.java
===================================================================
--- csplugins/trunk/ucsf/scooter/chemViz/src/chemViz/model/Compound.java        
2010-10-31 06:30:43 UTC (rev 22671)
+++ csplugins/trunk/ucsf/scooter/chemViz/src/chemViz/model/Compound.java        
2010-11-01 03:43:06 UTC (rev 22672)
@@ -715,6 +715,10 @@
        public Image depictWithCDK(int width, int height, Color background) {
                BufferedImage bufferedImage = null;
 
+               if (iMolecule == null) {
+                       return null;
+               }
+
                try {
                        if (!laidOut) {
                                StructureDiagramGenerator sdg = new 
StructureDiagramGenerator();
@@ -746,9 +750,9 @@
                        model.setBondWidth(model.getBondWidth()*2);
 
                        int renderWidth = width;
-                       // if (renderWidth < 150) renderWidth = 150;
+                       if (renderWidth < 150) renderWidth = 200;
                        int renderHeight = height;
-                       // if (renderHeight < 150) renderHeight = 150;
+                       if (renderHeight < 150) renderHeight = 200;
                        Rectangle2D bbox = new 
Rectangle2D.Double(0,0,renderWidth,renderHeight);
 
                        bufferedImage = new BufferedImage(renderWidth, 
renderHeight, BufferedImage.TYPE_INT_ARGB);
@@ -761,14 +765,12 @@
 
                        renderer.paintMolecule(iMolecule, new 
AWTDrawVisitor(graphics), bbox, true);
 
-                       /*
                        if (renderWidth != width || renderHeight != height) {
                                if (width < height)
                                        return 
bufferedImage.getScaledInstance(width, width, java.awt.Image.SCALE_SMOOTH);
                                else
                                        return 
bufferedImage.getScaledInstance(height, height, java.awt.Image.SCALE_SMOOTH);
                        }
-                       */
                } catch (Exception e) {
                        logger.warning("Unable to depict molecule with CDK 
depiction: "+e.getMessage(), e);
                }

Modified: 
csplugins/trunk/ucsf/scooter/chemViz/src/chemViz/tasks/CreateNodeGraphicsTask.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/chemViz/src/chemViz/tasks/CreateNodeGraphicsTask.java
  2010-10-31 06:30:43 UTC (rev 22671)
+++ 
csplugins/trunk/ucsf/scooter/chemViz/src/chemViz/tasks/CreateNodeGraphicsTask.java
  2010-11-01 03:43:06 UTC (rev 22672)
@@ -197,7 +197,8 @@
                CyNetworkView view = Cytoscape.getCurrentNetworkView();
 
                if (removeCustomGraphics) {
-                       for (NodeView nv: graphMap.keySet()) {
+                       ArrayList<NodeView> removeList = new 
ArrayList<NodeView>(graphMap.keySet());
+                       for (NodeView nv: removeList) {
                                if (nodeSelection == null || 
nodeSelection.contains(nv.getNode())) {
                                        // System.out.println("Removing cg for 
"+nv.getNode().getIdentifier());
                                        CustomGraphic cg = graphMap.get(nv);

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