PolylineConnection figure disappears [message #205807] |
Thu, 22 December 2005 09:09 |
Eclipse User |
|
|
|
Originally posted by: cytom.upb.de
Hi all,
I have the problem that the PolylineConnection figure of
MyConnectionEditPart disappears.
I found out that it is correctly added to MyDiagramEditPart with
addChild(...) and addChildVisual(...), but when in addChildVisual(...) the
addNotify() method of MyConnectionEditPart get called it disappears.
I speculate that this has to do with the activateFigure() method where
getLayer(CONNECTION_LAYER).add(getFigure());
is called, but I don't understand why ...
The figure of MyDiagramEditPart is of type ScalableFreeformLayeredPane.
The background is that I'm adding a connection and it's endpoint in one
CompoundCommand, first the new endpoint gets created and then the
connection.
By doing this twice I get an index error in addChildVisual because the
list of editparts of my diagram is larger than the list of the
corresponding figures (as described above the PolylineConnection figure is
disappeared) so new figures get added at wrong index.
Thanks a lot,
Thomas
|
|
|
|
Re: PolylineConnection figure disappears [message #206901 is a reply to message #206043] |
Sun, 08 January 2006 15:53 |
Eclipse User |
|
|
|
Originally posted by: cytom.upb.de
Felix L J Mayer wrote:
> Connections go between nodes, you don't add them directly to the diagram.
> Your node's EditPart returns them with getModelSourceConnections() and
> getModelTargetConnections().
Yes of course, I wrote it a bit ambiguous.
I observed the follwing:
In my Command I create a connection in the model, so the figure, a
PolylineConnection, of the associated EditPart get created.
It is visible in the diagram and full functioning.
But when the next element is added to the diagram, I get an
IndexOutOfBoundsException in addChildVisual.
By debugging, I found out that the PolylineConnection is missing now, so
there are more EditParts than Figures and the next Figure gets add to a
wrong index.
By more debugging, I found out what I wrote before:
I found out that it is correctly added to MyDiagramEditPart with
addChild(...) and addChildVisual(...), but when in addChildVisual(...) the
addNotify() method of MyConnectionEditPart get called it disappears.
Thanks,
Thomas Gewering
> "Thomas Gewering" <cytom@upb.de> wrote in message
> news:4b0de979a9bd9ef288d842491e17ac85$1@www.eclipse.org...
>
>>Hi all,
>>
>>I have the problem that the PolylineConnection figure of
>>MyConnectionEditPart disappears.
>>
>>I found out that it is correctly added to MyDiagramEditPart with
>>addChild(...) and addChildVisual(...), but when in addChildVisual(...) the
>>addNotify() method of MyConnectionEditPart get called it disappears.
>>
>>I speculate that this has to do with the activateFigure() method where
>>getLayer(CONNECTION_LAYER).add(getFigure());
>>is called, but I don't understand why ...
>>
>>The figure of MyDiagramEditPart is of type ScalableFreeformLayeredPane.
>>
>>
>>The background is that I'm adding a connection and it's endpoint in one
>>CompoundCommand, first the new endpoint gets created and then the
>>connection.
>>By doing this twice I get an index error in addChildVisual because the
>>list of editparts of my diagram is larger than the list of the
>>corresponding figures (as described above the PolylineConnection figure is
>>disappeared) so new figures get added at wrong index.
>>
>>Thanks a lot,
>>Thomas
|
|
|
|
Powered by
FUDForum. Page generated in 0.03713 seconds