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
URL:
Keywords:
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:


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

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.

java.lang.AssertionError
	at org.netbeans.modules.visual.router.OrthogonalSearchRouterCore.search(OrthogonalSearchRouterCore.java:184)
	at org.netbeans.modules.visual.router.OrthogonalSearchRouterCore.route(OrthogonalSearchRouterCore.java:107)
	at org.netbeans.modules.visual.router.OrthogonalSearchRouter.routeConnection(OrthogonalSearchRouter.java:163)
	at org.netbeans.api.visual.widget.ConnectionWidget.calculateRouting(ConnectionWidget.java:527)
	at org.netbeans.modules.visual.layout.ConnectionWidgetLayout.layout(ConnectionWidgetLayout.java:109)
	at org.netbeans.api.visual.widget.Widget.layout(Widget.java:1350)
	at org.netbeans.api.visual.widget.Widget.layout(Widget.java:1342)
	at org.netbeans.api.visual.widget.LayerWidget.layout(LayerWidget.java:86)
	at org.netbeans.api.visual.widget.Widget.layout(Widget.java:1342)
	at org.netbeans.api.visual.widget.Scene.layoutScene(Scene.java:312)
	at org.netbeans.api.visual.widget.Scene.validate(Scene.java:393)
	at org.netbeans.api.visual.widget.SceneComponent.setBounds(SceneComponent.java:110)
	at javax.swing.OverlayLayout.layoutContainer(OverlayLayout.java:216)
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
Node-Widget...