eclipse plugin - GEF: How to add figures to different BorderLayout sections of RootEditPart/-Figure -


i have gef editor following rooteditpart.

public class myprojecteditpart extends abstractgraphicaleditpart {  @override protected ifigure createfigure() {     scalablefreeformlayeredpane layer = new scalablefreeformlayeredpane();     layer.setlayoutmanager(new freeformlayout());     return layer;   } 

i'm using editor create bottom-up tree:

     _7_     /   \    5     6   / \   / \  1   2 3   4  

1-7 rectangles, 1-4 represent different model elements 5-7. @ moment, figures laid out foot (new rectangle(x, y, w, h) + parent.setconstraint(this, figure, rectangle)). position of figures 5-7 calculated simple algorithm, based on position on figures 1-4.

for sake of practicality i'd able add 1-4 flowlayouted figure @ borderlayout.bottom of rootfigure, , add rest of figures rootfigure's borderlayout.center.

however, i'm pretty new gef , can't head around how it. fail find right method adding figures 1-4 in respective editpart's createfigure().

for example, i've tried stuff parent.getfigure().getchildren().get(0).add(figure_1) example, rooteditpart's createfigure() method adding 2 new figures borderlayout.bottom , center respectively..

i'd thankful starting points :).

you need editpartfactory "dispatches" model elements different editparts. toplevel editpart (7) should implement getmodelchildren return 5 , 6, editparts in turn should return children 1,2 , 3,4.

how taking time gef shape example and/or http://www.redbooks.ibm.com/abstracts/sg246302.html ?


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -