Skip to main content



      Home
Home » Eclipse Projects » GEF » Draw2D connections problem
Draw2D connections problem [message #197466] Mon, 03 October 2005 17:09 Go to next message
Eclipse UserFriend
Originally posted by: cleversons.gmail.com

Hi,

I'm working on an application which connects many nodes through Polyline
connections. I'm not using GEF, but plain draw2d. My connections are not
being drawn correctly. I'm not sure if this may have something to do with
the containers's layout which these connections are being added. This is
my current scenario:

- one container (Figure) with ToolbarLayout.
- many nodes (Figure) being added to this container.
- after adding all nodes, connections are created and also added to the
container.

But they are not rendered as expected.

Any clue?

Thank you

Cleverson Schmidt
Re: Draw2D connections problem [message #197505 is a reply to message #197466] Tue, 04 October 2005 03:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ingo.koch[nospam].sap.com

Hi,

you could be more precise on "not rendered as expected"...:-)
Perhaps your figures lack a connection router?

Regards, Ingo


"Cleverson Schmidt" <cleversons@gmail.com> wrote in message
news:c56d011f86ed39d11bf28def220dc611$1@www.eclipse.org...
> Hi,
>
> I'm working on an application which connects many nodes through Polyline
> connections. I'm not using GEF, but plain draw2d. My connections are not
> being drawn correctly. I'm not sure if this may have something to do with
> the containers's layout which these connections are being added. This is
> my current scenario:
>
> - one container (Figure) with ToolbarLayout.
> - many nodes (Figure) being added to this container.
> - after adding all nodes, connections are created and also added to the
> container.
>
> But they are not rendered as expected.
>
> Any clue?
>
> Thank you
>
> Cleverson Schmidt
>
Re: Draw2D connections problem [message #197552 is a reply to message #197505] Tue, 04 October 2005 08:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cleversons.gmail.com

Hi,

Thanks for the answer.
By not rendered as expected I mean I draw more than 50 connections among
my nodes (there are more than 100 nodes on my graph) and just one straight
line is drawn, but this line does not connect any node, just a line
floating in the top left side of my diagram.
This is the code I'm using to create the connections:

ChopboxAnchor targetAnchor = new ChopboxAnchor(node[n]);
ChopboxAnchor sourceAnchor = new ChopboxAnchor(node[n+1]);
PolylineConnection con = new PolylineConnection();
con.setSourceAnchor(sourceAnchor);
con.setSourceAnchor(targetAnchor);
add(con); // the connection is added to the same Figure as the node are
added. This figure has its layout set to ToolbarLayout. Maybe connection
can't be added to a container with such layout ?

Thank you

Cleverson Schmidt
Re: Draw2D connections problem [message #197587 is a reply to message #197466] Tue, 04 October 2005 09:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

You can't add connections and nodes to the same parent figure.

"Cleverson Schmidt" <cleversons@gmail.com> wrote in message
news:c56d011f86ed39d11bf28def220dc611$1@www.eclipse.org...
> Hi,
>
> I'm working on an application which connects many nodes through Polyline
> connections. I'm not using GEF, but plain draw2d. My connections are not
> being drawn correctly. I'm not sure if this may have something to do with
> the containers's layout which these connections are being added. This is
> my current scenario:
>
> - one container (Figure) with ToolbarLayout.
> - many nodes (Figure) being added to this container.
> - after adding all nodes, connections are created and also added to the
> container.
>
> But they are not rendered as expected.
>
> Any clue?
>
> Thank you
>
> Cleverson Schmidt
>
Re: Draw2D connections problem [message #197615 is a reply to message #197587] Tue, 04 October 2005 11:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cleversons.gmail.com

Hi Randy,

Thank you for your help. I will try to create a connections layer.
Once more thank you.

Best Regards
Cleverson Schmidt
Re: Draw2D connections problem [message #197623 is a reply to message #197587] Tue, 04 October 2005 11:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cleversons.gmail.com

By the way, I was driven to this error by the "Display a UML diagram using
Draw2D". That's how this tutorial add a connection between 2 nodes:

contents.add(classFigure);
contents.add(classFigure2);
contents.add(c); // c is the connection and it is being added to the same
parent as the node it will conect
Re: Draw2D connections problem [message #197643 is a reply to message #197587] Tue, 04 October 2005 13:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cleversons.gmail.com

Hi again Randi,

Can you point me to some example or piece of code which creates
connections between nodes using just Draw2D (not GEF)?

I've tried lots of different aproaches but no success.
I've created a different Figure just to add connections, but my
connections are not displayed.
I've tried to use the ConnectionLayer class, but no success again.

What are the steps to make it work?
I need to have one layer for my figure and other for my connections but
how to mix them into a root figure in way that my connections are
displayed?

Thank you

Best Regards
Cleverson Schmidt
Re: Draw2D connections problem [message #198283 is a reply to message #197643] Sun, 09 October 2005 15:53 Go to previous message
Eclipse UserFriend
Originally posted by: none.unknown.com

Use a layered pane (freeform or otherwise). See the createFigure() method
of ScalableRootEditPart to see how the different layers are created.

"Cleverson Schmidt" <cleversons@gmail.com> wrote in message
news:2f0f6270c26b424bfc00677045b93d24$1@www.eclipse.org...
> Hi again Randi,
>
> Can you point me to some example or piece of code which creates
> connections between nodes using just Draw2D (not GEF)?
>
> I've tried lots of different aproaches but no success.
> I've created a different Figure just to add connections, but my
> connections are not displayed.
> I've tried to use the ConnectionLayer class, but no success again.
>
> What are the steps to make it work?
> I need to have one layer for my figure and other for my connections but
> how to mix them into a root figure in way that my connections are
> displayed?
>
> Thank you
>
> Best Regards
> Cleverson Schmidt
>
Previous Topic:How to add menu item to figure's context menu?
Next Topic:Beehive Application Wizard Startup
Goto Forum:
  


Current Time: Sat Jun 21 04:57:57 EDT 2025

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

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

Back to the top