Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [gef-dev] FanRouter and ShortestPathConnectionRouter together

Hi,

first of all thanks for your answer Randy.

Unfortunatly the shapes example only uses the SPCR standalone. If I try to
extend the logic example in order to use FanRouter with SPCR I don't see any
connections anymore.

I changed the refreshVisualls() in LogicDiagramEditPart to the following

else {
       AutomaticRouter fanrouter = new FanRouter();
       ShortestPathConnectionRouter router =
			new ShortestPathConnectionRouter(getFigure());
       fanrouter.setNextRouter(router);
	cLayer.setConnectionRouter(fanrouter);
getFigure().setLayoutManager(new ShortestPathConnectionRouter.LayoutWrapper(
				layout,router));
	}

Is there a way to extend the SPCR to handle overlapping/same connections like
FanRouter? Any hints would be great.

Greetings
Christian

Quoting Randy Hudson <hudsonr@xxxxxxxxxx>:

I think that the shapes example uses both routers together.  It should
work fine.  The exception looks like you have a Connection with 0 points.
This should not be possible since SPCR always sets at least the start and
end points.

- Randy




Christian Dupuis <spring@xxxxxxxxxxxxxxxxxx>
Sent by: gef-dev-bounces@xxxxxxxxxxx
04/27/2005 06:05 PM
Please respond to
GEF development


To
gef-dev@xxxxxxxxxxx
cc

Subject
[gef-dev] FanRouter and ShortestPathConnectionRouter together






Hello,

is there a way to use FanRouter and ShortestPathConnectionRouter together?
Because after using the routing of ShortestPathConnectionRouter I still
have
connections between the same nodes which are overlapping.

If I use the to routers together

ConnectionLayer cLayer = (ConnectionLayer) getLayer(CONNECTION_LAYER);
FanRouter fanRouter = new FanRouter();
ShortestPathConnectionRouter router = new
ShortestPathConnectionRouter(getFigure());
fanRouter.setNextRouter(router);
cLayer.setConnectionRouter(fanRouter);

I'll get the following stacktrace:

java.lang.IndexOutOfBoundsException: Index: -1, Size: 0
       at
org.eclipse.draw2d.geometry.PointList.getPoint(PointList.java:183)
       at
org.eclipse.draw2d.ConnectionLocator.getLocation(ConnectionLocator.java:120)
       at org.eclipse.draw2d.ArrowLocator.relocate(ArrowLocator.java:42)
       at
org.eclipse.draw2d.DelegatingLayout.layout(DelegatingLayout.java:71)
       at org.eclipse.draw2d.Figure.layout(Figure.java:928)
       at
org.eclipse.draw2d.PolylineConnection.layout(PolylineConnection.java:156)
       at org.eclipse.draw2d.Figure.validate(Figure.java:1604)
       at org.eclipse.draw2d.Figure.validate(Figure.java:1606)
       at org.eclipse.draw2d.Figure.validate(Figure.java:1606)
       at org.eclipse.draw2d.Figure.validate(Figure.java:1606)
       at org.eclipse.draw2d.Figure.validate(Figure.java:1606)
       at org.eclipse.draw2d.Figure.validate(Figure.java:1606)
       at org.eclipse.draw2d.Viewport.validate(Viewport.java:357)
       at org.eclipse.draw2d.Figure.validate(Figure.java:1606)
       at
org.eclipse.draw2d.DeferredUpdateManager.validateFigures(DeferredUpdateManager.java:237)

Greetings Christian
_______________________________________________
gef-dev mailing list
gef-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/gef-dev






Back to the top