I'm trying to draw a tree within a GEF editor. The problem is that I need to draw it bottom up. I have a primary layer for the node figures, and a connection layer for the connections.
The primary layer is a FreeformLayer, the root edit part a ScalableFreeformLayeredPane. The primary layer has a XYLayout.
Now I need to find the bottom edge of the editor (= viewport???) in order to be able to draw the bottom level of figures ("tokens") at that position (bottom y of primary layer - height of tokens = y of tokens). How can I get that?
I've tried to do it with BorderLayout so the tokens get painted at the bottom of the editor (BorderLayout.BOTTOM), and the nodes above it in BorderLayout.CENTER, but I've run into trouble with selections, and the layout is far from what I want to achieve.
So basically I want to have all nodes in one layer. I can set the position of the tokens, but the nodes above them must be calculated dynamically. How can I do this within XYLayout?
Many thanks in advance!
(Alternatively, positioning the tokens in the y-centered would be acceptable if it's easier to achieve)