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.
It would be nice if the CollisionsCollector had some contextual information as far as which connection it is collecting collisions for. For example, the "collectionCollisions" method could be passed the ConnectionWidget itself, so that custom implementations could then ignore collisions for connections that share similar characteristics (such as sharing the same pins). For CASA, I have a custom OrthogonalSearchRouter, which is exactly the same as the OrthogonalSearchRouter in the graph library - except that it passes in the ConnectionWidget to a custom collisions collector (one that does not implement CollisionsCollector). Unfortunately, in order to do this, I had to copy the entire OrthogonalSearchRouterCore and associated classes. It would be nice if there were, for example, an OrthogonalCollisionsCollector that passed in the ConnectionWidget so that I wouldn't have to copy any code.
including the first part of the routeConnection method in my modified OrthogonalSearchRouter to provide the details of what I am doing: public List<Point> routeConnection (ConnectionWidget widget) { ... collector.collectCollisions(widget, verticalCollisions, horizontalCollisions); ...
CollisionsCollector is not context sensitive at all. I am attaching a proposed patch. It contains a new ConnectionWidgetCollisionsCollector interface which receives "ConnectionWidget" parameter as the context of connection which is being routed. You can use the ConnectionWidgetCollisionsCollector interface for creating an OrthogonalSearchRouter instance using: RouterFactory.createOrthogonalSearchRouter(CWCC collector) The patch contains updated documentation, javadoc, apichanges.xml, increased spec. number and automated test. Reassigning to apireviews to ask for fast-track API review.
Thanks Dave, this sounds like it will work well!
Created attachment 41151 [details] The proposed patch
Sorry - I have forgotten to attach the proposed patch to the issue last week. I guess I have to wait one week again for patch integration. Or not?
Y01 Stop using golden files in this trivial cases and try for example: boolean wasHere; public void insideListenerMethod() { wasHere = true; } assertTrue("Listener called", wasHere);
Patch applied.