Default connection anchor used after model persisted [message #210680] |
Fri, 03 March 2006 01:55 |
Nick Allen 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
|
|
|
Powered by
FUDForum. Page generated in 0.04159 seconds