Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » XYLayout problem.
XYLayout problem. [message #226852] Fri, 24 November 2006 14:41
Mark Robinson is currently offline Mark RobinsonFriend
Messages: 37
Registered: July 2009
Member
Here's my problem:

The tool being developed allows you to open up more than one Graphical
Editor; thus it is possible to have the same data model object displayed
in multiple diagrams simultaneously. Only one diagram is visible at any
given time but many diagrams can be open. When you edit a data model
object on the active diagram, if the data model object is in another
diagram the change will occur there too.

The data model object is an EReference in a different Figure Model Object
that contains the figure information - location, size, etc. So the same
data model object can be referenced by multiple figure model objects in
different diagrams. The locations/sizes of the figure models are different
in each diagram, even though they refer to the same data model object;
this is the behaviour I want.

I have a container model/EditPart that has an XYLayout. I can add children
to the container at the required location in the active diagram. The
problem is the positioning of the new children in the non-active diagrams.
I need to set the location of the new figure in the container in the other
diagrams, so that is does not overlap other child figures.

The place to do this seems to be in the layout method. I tried subclassing
XYLayout and overriding the layout method. I can calculate where the new
child should be placed, but when you set the location of the new child the
container figure's bounds do not change. There is a comment in the
XYLayout.class that states: "location of children should be persisted".
So, it seems this is not the correct place to do this.

I then tried positioning the new child by setting the location in
getModelChildren or refreshChildren, but that doesn't work either because
at those points you may not know the height and width of the children.

The Layout method seems to be the place to do this? I'm at a loss of what
to try next, any suggestions would be appreciated.

Thanks in advance,
Mark Robinson.
Previous Topic:Draw2D PolylineConnection
Next Topic:parent Composite of public FigureCanvas
Goto Forum:
  


Current Time: Thu Apr 25 01:13:43 GMT 2024

Powered by FUDForum. Page generated in 0.02631 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top