This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 148114 - Loop Edge Grows when moving attached node
Summary: Loop Edge Grows when moving attached node
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Graph (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@platform
Depends on:
Blocks: 143228
  Show dependency tree
Reported: 2008-09-23 23:01 UTC by Trey Spiva
Modified: 2010-04-01 14:47 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:

An example of the problem. (4.12 KB, text/plain)
2008-09-23 23:04 UTC, Trey Spiva

Note You need to log in before you can comment on or make changes to this bug.
Description Trey Spiva 2008-09-23 23:01:40 UTC
When a widget has a loop edge the edge grows when moving the attached widget.
Comment 1 Trey Spiva 2008-09-23 23:04:45 UTC
Created attachment 70374 [details]
An example of the problem.
Comment 2 Trey Spiva 2008-09-23 23:05:42 UTC
To see the problem run the attached example.  Move the bottom node and watch the edge change shape.
Comment 3 David Kaspar 2008-09-24 14:09:45 UTC
Unfortunately we cannot do anything with it. This is a default behavior of OrthogonalSearchRouter algorithm. The
algorithm is tried to route the horizontal segment of the "bottom-edge" somewhere in the space between the nodes. Since
the space is limited from two side (top and bottom node) then it decides to route the horizontal segment just in the
middle of the space. The algorithm does not have any information about the loop-edges and therefore it is rendered with
the same logic as the rest of the edges. With this routing the algorithm is trying to prevent from overlapped edges
which was heavily happening with previous implementation.
A general fix is definitely not simple and may break another visualizations.

To workaround it, create a simple Router implementation and assign it to the loop-edges only. The other edges may use
the current algorithm still.
Comment 4 Antonin Nebuzelsky 2008-09-24 14:27:21 UTC
Trey, does the workaround work for you? Please, let us know.

I suggest decreasing to P3.
Comment 5 Trey Spiva 2008-09-25 19:27:18 UTC
I have made our own router to handle this situation.  I also found that in one of our diagrams the router was throwing an assertion error.

	at org.netbeans.modules.visual.router.OrthogonalSearchRouterCore.route(
	at org.netbeans.modules.visual.router.OrthogonalSearchRouter.routeConnection(
	at org.netbeans.api.visual.widget.ConnectionWidget.calculateRouting(
	at org.netbeans.modules.visual.layout.ConnectionWidgetLayout.layout(
	at org.netbeans.api.visual.widget.Widget.layout(
	at org.netbeans.api.visual.widget.Widget.layout(
	at org.netbeans.api.visual.widget.LayerWidget.layout(
	at org.netbeans.api.visual.widget.Widget.layout(
	at org.netbeans.api.visual.widget.Scene.layoutScene(
	at org.netbeans.api.visual.widget.Scene.validate(
	at org.netbeans.api.visual.widget.SceneComponent.setBounds(
	at javax.swing.OverlayLayout.layoutContainer(
Comment 6 David Kaspar 2008-09-25 20:28:19 UTC
Regarding assertation:
It seems that the scene is bigger than +-10000px in some direction from [0,0] origin. Unfortunately this is the
limitation of the algorithm as well.
Regarding the workaround:
It is also possible to use the OrthogonalSearchRouter even for loop edges but they have to use CollisionsCollection that
returns the Node-Widget only as a collision in case that the ConnectionWidget is lead-in and comming-out from the same