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 99054 - CollisionsCollector context
Summary: CollisionsCollector context
Alias: None
Product: platform
Classification: Unclassified
Component: Graph (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: apireviews
Depends on:
Reported: 2007-03-26 23:36 UTC by Joshua Sandusky
Modified: 2007-05-25 22:22 UTC (History)
0 users

See Also:
Exception Reporter:

The proposed patch (16.92 KB, application/octet-stream)
2007-04-18 12:43 UTC, David Kaspar

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Sandusky 2007-03-26 23:36:02 UTC
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.
Comment 1 Joshua Sandusky 2007-03-26 23:37:39 UTC
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,
Comment 2 David Kaspar 2007-04-10 14:07:15 UTC
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.
Comment 3 Joshua Sandusky 2007-04-10 20:36:49 UTC
Thanks Dave, this sounds like it will work well!
Comment 4 David Kaspar 2007-04-18 12:43:10 UTC
Created attachment 41151 [details]
The proposed patch
Comment 5 David Kaspar 2007-04-18 12:45:21 UTC
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?
Comment 6 Jaroslav Tulach 2007-04-20 21:27:51 UTC
Y01 Stop using golden files in this trivial cases and try for example: 
boolean wasHere;
public void insideListenerMethod() {
  wasHere = true;
assertTrue("Listener called", wasHere);
Comment 7 David Kaspar 2007-05-25 22:22:12 UTC
Patch applied.