2

I started with JGraphX a few days ago and already did some nice things. I would like to programmatically change the color (and maybe other style properties) of an existing vertex (i.e. that was already created before) upon some specific events. How can this be done?

  • Please provide element about what you've done to achieve what you want, and the problems you encountered. – Sorikairo Oct 09 '18 at 16:30
  • 1
    I found the answer this morning. To color all vertices white, I used: graph.getModel().beginUpdate(); try { // uncolor all older vertices - see https://forum.jgraph.com/vote/1715/down/index.html graph.setCellStyles(mxConstants.STYLE_FILLCOLOR, "#ffffff", nodes.toArray()); ... } finally { graph.getModel().endUpdate(); } – Jozef Aerts Oct 10 '18 at 17:42
  • and to color a single vertex: /** Un-color a single vertex given its label */ private void uncolorSingleVertex(String label) { for(int i=0; i – Jozef Aerts Oct 10 '18 at 17:44

0 Answers0