Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » ShortestPathConnectionRouter
ShortestPathConnectionRouter [message #212618] Mon, 27 March 2006 22:11 Go to next message
Eclipse UserFriend
Originally posted by: tdeloren.intervoice.com

I am trying to use the ShortestPathConnectionRouter in a get application
we are writing and here is the problem I have encountered.

Figure A has a bunch of children defined in the getModelChildren
Those children each have a getSourceConnections\getSourceModelConnections
and get target ones.
Those connections draw just fine.
I have the following code in Figure A's createFigure

ConnectionLayer connLayer = (ConnectionLayer)
getLayer(LayerConstants.CONNECTION_LAYER);
connLayer.setConnectionRouter(new
ShortestPathConnectionRouter(outerPanel));
return outerPanel;

where outerPanel is the content pane said children get added to. The
problem is the router doens't manipulate the connetions to avoid them
going right through the figures like it does in the shapes examples. My
searching has only turned up one thing I don't have which is this line of
code from somebody else's example:
contentEditPart.getContentPane().addLayoutListener(spRouter. getLayoutListener());
However that getLayoutListener doesn't exist anymore seemingly on shortest
path router. If anyone has any idea why the router might not be seeing my
figures as obstacles and routing aroudn them let me know. Thanks a bunch
Re: ShortestPathConnectionRouter [message #212716 is a reply to message #212618] Tue, 28 March 2006 15:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

The connection router does not handle nested containers. You would have to
enhance or rewrite the router to identify nested nodes, and add them as
obstacles.

"Tom" <tdeloren@intervoice.com> wrote in message
news:42fc099be5ff24b36f05cfd077e3889e$1@www.eclipse.org...
>I am trying to use the ShortestPathConnectionRouter in a get application we
>are writing and here is the problem I have encountered.
>
> Figure A has a bunch of children defined in the getModelChildren
> Those children each have a getSourceConnections\getSourceModelConnections
> and get target ones.
> Those connections draw just fine.
> I have the following code in Figure A's createFigure
>
> ConnectionLayer connLayer = (ConnectionLayer)
> getLayer(LayerConstants.CONNECTION_LAYER);
> connLayer.setConnectionRouter(new
> ShortestPathConnectionRouter(outerPanel));
> return outerPanel;
>
> where outerPanel is the content pane said children get added to. The
> problem is the router doens't manipulate the connetions to avoid them
> going right through the figures like it does in the shapes examples. My
> searching has only turned up one thing I don't have which is this line of
> code from somebody else's example:
> contentEditPart.getContentPane().addLayoutListener(spRouter. getLayoutListener());
> However that getLayoutListener doesn't exist anymore seemingly on shortest
> path router. If anyone has any idea why the router might not be seeing my
> figures as obstacles and routing aroudn them let me know. Thanks a bunch
>
Re: ShortestPathConnectionRouter [message #212732 is a reply to message #212716] Tue, 28 March 2006 20:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tdeloren.intervoice.com

The router is set on the content pane, the content pane has the figures in
it. Isn't that the same level? Those figurs have sub figures yes but the
size of the top level figure I would have thought would be what it cares
about and it grows to accomodate its sub figures.
Re: ShortestPathConnectionRouter [message #212740 is a reply to message #212732] Tue, 28 March 2006 21:20 Go to previous message
Eclipse UserFriend
Originally posted by: tdeloren.intervoice.com

Ok I discovered the problem. You were on the right track. Because I kept
re-setting the router for the connections in each figure, the bottom level
figure was the last one to get it set on and he has no children so there
was no obstacles. THanks
Previous Topic:GEF Popup Toolbar
Next Topic:Connection Question
Goto Forum:
  


Current Time: Wed Dec 07 00:17:26 GMT 2022

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

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

Back to the top