1

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)

QueNuevo
  • 105
  • 12

1 Answers1

0

You could look at Zest Layout Algorithms to have some inspiration: http://www.eclipse.org/gef/zest/

pbanfi
  • 1,885
  • 2
  • 19
  • 23
  • Thanks, will do that, although I think Zest works quite differently? – QueNuevo Jun 20 '12 at 08:57
  • Zest is a visualization framework based on gef and has some articulated layout algorithms. perhaps you can base your solution on one of these :) – pbanfi Jun 20 '12 at 11:05
  • Thanks. The thing is that I need all the editing capabilities that GEF (the plug-in, not the framework) offers. Would it be possible to use Zest to layout figures in a GEF editor? – QueNuevo Jun 20 '12 at 11:20
  • try this: http://stackoverflow.com/questions/8884792/eclipse-plugin-gef-and-graph-visualization-zest – pbanfi Jun 20 '12 at 13:06