I use this typical snippet (from the prefuse examples) to change the color of one of my nodes when the mouse is over it:
ColorAction nFill = new ColorAction(NODES, VisualItem.FILLCOLOR);
nFill.setDefaultColor(ColorLib.gray(255));
nFill.add("_hover", ColorLib.gray(200));
I'd like to set the color for the edges in & out of this node to a different color too, preferably a different color for the ins than for the outs, but I can't find the right predicate to use.
I'm using a directed graph, in case it matters.
Is there a way to iterate over the children/parents of the current node/edge in the predicate API ? Do you have a solution to my actual issue ?
I found a way to do it without predicates, but by creating my own ColorAction subclass:
Then, I use that as the main color action for my edges:
I don't know if it's the "preferred" way to do it, but it works well enough for me.