Author: apico
Date: 2011-06-05 12:05:58 -0700 (Sun, 05 Jun 2011)
New Revision: 25652

Modified:
   
csplugins/trunk/ucsf/scooter/metaNodePlugin2/src/metaNodePlugin2/view/NestedNetworkView.java
   
csplugins/trunk/ucsf/scooter/metaNodePlugin2/src/metaNodePlugin2/view/ViewUtils.java
Log:
fixed opacity settings. works with nested networks too!

Modified: 
csplugins/trunk/ucsf/scooter/metaNodePlugin2/src/metaNodePlugin2/view/NestedNetworkView.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/metaNodePlugin2/src/metaNodePlugin2/view/NestedNetworkView.java
        2011-06-05 19:02:14 UTC (rev 25651)
+++ 
csplugins/trunk/ucsf/scooter/metaNodePlugin2/src/metaNodePlugin2/view/NestedNetworkView.java
        2011-06-05 19:05:58 UTC (rev 25652)
@@ -45,7 +45,6 @@
        static private Map<CyGroup, CyNetworkView> nnMap = new HashMap<CyGroup, 
CyNetworkView>();
 
        public static void create(CyGroup group, CyNetworkView view, double 
opacity) {
-               //TODO: nothing happens with opacity here...
                
                // Get the network
                CyNetwork nn = group.getGraphPerspective();
@@ -77,6 +76,9 @@
 
                // Set it as a nested network
                group.getGroupNode().setNestedNetwork(nn);
+               
+               // Set opacity
+               ViewUtils.setOpacity(group.getGroupNode(), view, opacity);
 
                // Update the size of our group node to match the bounding box
                // Actually, this doesn't work.  If our bounding box is not 
square

Modified: 
csplugins/trunk/ucsf/scooter/metaNodePlugin2/src/metaNodePlugin2/view/ViewUtils.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/metaNodePlugin2/src/metaNodePlugin2/view/ViewUtils.java
        2011-06-05 19:02:14 UTC (rev 25651)
+++ 
csplugins/trunk/ucsf/scooter/metaNodePlugin2/src/metaNodePlugin2/view/ViewUtils.java
        2011-06-05 19:05:58 UTC (rev 25652)
@@ -35,6 +35,7 @@
 // System imports
 import java.util.Collection;
 import java.util.List;
+import java.util.ArrayList;
 import java.awt.Color;
 import java.awt.Dimension;
 
@@ -48,6 +49,7 @@
 import cytoscape.CyNode;
 import cytoscape.CyNetwork;
 import cytoscape.view.CyNetworkView;
+import cytoscape.visual.VisualPropertyType;
 import cytoscape.data.CyAttributes;
 
 import cytoscape.groups.CyGroup;
@@ -114,8 +116,7 @@
                        NestedNetworkView.create(group, view, opacity);
                } else {
                        // Set the opacity, if desired
-                       if (opacity != 1.0)
-                               setOpacity(groupNode, view, opacity);
+                       setOpacity(groupNode, view, opacity);
                }
        }
 
@@ -280,7 +281,13 @@
                        if (tp != newTp) {
                                nView.setUnselectedPaint(new 
Color(oldPaint.getRed(), oldPaint.getGreen(),
                                                                   
oldPaint.getBlue(), newTp));
-                               // Should we set the node.opacity override?
+                               // Set the node.opacity attr
+                               Cytoscape.getNodeAttributes().setAttribute(
+                                               node.getIdentifier(), 
+                                               
VisualPropertyType.NODE_OPACITY.getBypassAttrName(), 
+                                               Double.toString(opacity));
+                               List<VisualPropertyType> vplist = new 
ArrayList<VisualPropertyType>();
+                               vplist.add(VisualPropertyType.NODE_OPACITY);
                        }
                }
        }

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