Question

I'm trying to plug a (very) simple graph layout algorithm into my GEF editor. I do it by simply adding calculateX() and calculateY() methods to my NodeEditParts' refreshVisuals() (the graph figure has an XYLayout obviously).

It does work, albeit only for those nodes, which have a connection to another node, of which they are the source. When I try to access the constraints for nodes to which the node in question has a connection, of which it is the target, I get a NullPointerException.

I'm guessing that this is to do with the order in which nodes are drawn in GEF.

I'm also guessing that there is no such thing as an element parser checking which elements will have to be drawn first, but rather that elements are either drawn in the order they appear in a List, or concurrently via the EditPartFactory (which, however, must get its input from some sort of ordered collection in the model).

But how is it really done?

Was it helpful?

Solution

In GEF the elements are drawn in the order they appear in the list returned by getModelChildren() (I don't remember if from start to end or backwards, but you can check the code)

Nevertheless, I couldn't understand what exactly was your problem, so if you can provide more details I may help you some more.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top