Cy3: How to Translate Cy2 to Cy3 VisualPropertyDependencies

20 views
Skip to first unread message

michael...@non.agilent.com

unread,
Sep 27, 2013, 2:37:49 PM9/27/13
to cytoscape...@googlegroups.com

I can't quite figure out VisualPropertyDependency usage in Cy3. I checked the code snippets and code examples, but none show dependencies.

 

I have the Cy2 dependency:

 

visualStyle.getDependency().set(VisualPropertyDependency.Definition.NODE_SIZE_LOCKED, false);

 

In Cy3, I've found bits and pieces but can't figure out how to put it together:

 

       final Set<VisualProperty<Double>> nodeSizeVisualProperties = new HashSet<VisualProperty<Double>>();

       nodeSizeVisualProperties.add(BasicVisualLexicon.NODE_WIDTH);

       nodeSizeVisualProperties.add(BasicVisualLexicon.NODE_HEIGHT);    

       VisualPropertyDependency vpd = new VisualPropertyDependency(??,

                                                                  ??,

                                                                  nodeSizeVisualProperties,

                                                                  ??);

       vpd.setDependency (false);

visualStyle.addVisualPropertyDependency (vpd);

 

IgorRodchenkov

unread,
Sep 27, 2013, 3:54:02 PM9/27/13
to cytoscape...@googlegroups.com
I put, e.g., this code:


- a.f.a.i.k., this is because future Cy3 is going to support several renderers along with Ding, 
and the actual list of Dependencies may vary (in my example, unfortunately, with the current 3.1.0 snapshots, the visual mapping function for EDGE_PAINT created with the discrete mapping factory does not produce desired effect - all edges are black despite all mappings; this is perhaps due to a Cy3 bug...)


Igor.

michael...@non.agilent.com

unread,
Sep 27, 2013, 4:13:42 PM9/27/13
to cytoscape...@googlegroups.com

Wow, I would not have guessed that! So you iterate thru all the existing VisualPropertyDependencys of a visual style and if you find the right dependency, you set its value. So how do we know that the visual style already has that VisualPropertyDependency? Is it ever the case that it doesn't and if so, what do you do then?

--
You received this message because you are subscribed to the Google Groups "cytoscape-helpdesk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpd...@googlegroups.com.
To post to this group, send email to cytoscape...@googlegroups.com.
Visit this group at http://groups.google.com/group/cytoscape-helpdesk.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages