Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » PolylineConnection figure disappears
PolylineConnection figure disappears [message #205807] Thu, 22 December 2005 09:09 Go to next message
Eclipse UserFriend
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 #206043 is a reply to message #205807] Fri, 23 December 2005 20:47 Go to previous messageGo to next message
Felix L J Mayer is currently offline Felix L J MayerFriend
Messages: 202
Registered: July 2009
Senior Member
Connections go between nodes, you don't add them directly to the diagram.
Your node's EditPart returns them with getModelSourceConnections() and
getModelTargetConnections().

"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
>
Re: PolylineConnection figure disappears [message #206901 is a reply to message #206043] Sun, 08 January 2006 15:53 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: PolylineConnection figure disappears [message #1053837 is a reply to message #206043] Tue, 07 May 2013 19:40 Go to previous message
Leonid Dworzanski is currently offline Leonid DworzanskiFriend
Messages: 2
Registered: May 2013
Junior Member
Dear Felix,

But then where such PolyConnections should be stored if not in the diagram?
I mean that they are linked with source/target nodes. It's ok.
But why they cant be stored in a diagram model object?
Previous Topic:How to prevent SetPropertyValueCommand from being pushed to CommandStack
Next Topic:How to Rotate rectangle in GEF?
Goto Forum:
  


Current Time: Fri Apr 26 09:28:30 GMT 2024

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

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

Back to the top