Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Default connection anchor used after model persisted
Default connection anchor used after model persisted [message #210680] Fri, 03 March 2006 01:55
Nick Allen is currently offline Nick AllenFriend
Messages: 23
Registered: July 2009
Junior Member
I have a simple model where a connection connects two other model
elements. The connection itself also has a model element. All of these
models have a common root model element.

When the connection is initially made, everything works fine. The problem
occurs after the model is saved and re-opened. (Saving the model simply
involves serializing to a file.) After the model is re-opened, the
connection is not connected to the source and target. It is
instead anchored to the default source and target anchors
(AbstractConnectionEditPart.DEFAULT_SOURCE_ANCHOR/DEFAULT_TA RGET_ANCHOR).

1. The source model element has its EditPart created from
AbstractEditPart.refreshChildren().

2. This calls AbstractGraphicalEditPart.createOrFindConnection which
creates an EditPart for the connection. This connection EditPart is
initialized correctly.

3. The target model element has its EditPart created from
refreshChildren()

4. This causes another EditPart to be created for the connection even
though one was already created. This connection EditPart is again
initialized correctly.

5. Finally, AbstractEditPart.refreshChildren runs across the connection's
model element and, yet again, creates an EditPart for the connection.

6. This final EditPart is not initialized correctly. It does not have its
source and target EditPart initialized which means that the default source
and target anchors get used.

Why are multiple EditParts being created for the connection? Shouldn't
these EditParts be added to the edit part registry to avoid this? What am
I doing wrong?


Thanks,
Nick
Previous Topic:Draw2d relative coordinates: move view does not move model?
Next Topic:How to create figures that look like text fields
Goto Forum:
  


Current Time: Thu Apr 25 11:19:23 GMT 2024

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

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

Back to the top