Giving Edge Color to Edge Target Arrow

Skip to first unread message

pritam saha

Jul 14, 2021, 3:05:38 PM7/14/21
to cytoscape-app-dev
Hello Everyone, 

I am trying to apply RGB color the edge target arrow which is of delta shape. 
I have used this below code to apply the Delta shape for edge target arrow. 
VisualStyle vs = cyServiceRegistrar.getService(VisualStyleFactory.class).createVisualStyle(currentStyle);
vs.setDefaultValue(BasicVisualLexicon.EDGE_TARGET_ARROW_SHAPE, ArrowShapeVisualProperty.DELTA);

But I am not able to give color to the tip of the edge. 

There is some property which we can do from a xml file. Below is the sample example
<visualProperty name="EDGE_TARGET_ARROW_UNSELECTED_PAINT" default="#000000"/>
<visualProperty name="EDGE_TARGET_ARROW_SELECTED_PAINT" default="#ffff00"/>

I need to do this using programmatically.  

Please help me with this issue. 



Jul 15, 2021, 12:06:24 PM7/15/21
to cytoscape-app-dev
First guess:  Did you apply the style?

pritam saha

Jul 19, 2021, 6:14:58 PM7/19/21
to cytoscape-app-dev

Hi Alex,

Thank you for your response. 

Actually, I was not able to find the class for the property Edge Target Arrow like BasicVisualLexicon.EDGE_UNSELECTED_PAINT under   BasicVisualLexicon

It was not defined there. 

So, I have tried to find some solutions in the GitHub repositories and then I have seen some of the properties are used from the rendering manager. 
I have used the below code.

VisualLexicon lex = cyServiceRegistrar.getService(RenderingEngineManager.class).getDefaultVisualLexicon(); 
VisualProperty targetedgecolor = lex.lookup(CyEdge.class,"EDGE_TARGET_ARROW_UNSELECTED_PAINT"); 

And It worked. 


Scooter Morris

Jul 29, 2021, 11:21:31 AM7/29/21
to cytoscape-app-dev
Hi Pritam,
  Exactly right!  Not all properties are available through the BasicVisualLexicon.  In particular, the EDGE_TARGET and EDGE_SOURCE paints are only defined in "ding", the default 2D renderer.  That's why you need to actually go through the lookup.

-- scooter
Reply all
Reply to author
0 new messages