Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » ChopboxAnchor bug ? - related to earler post on connection anchor and router
ChopboxAnchor bug ? - related to earler post on connection anchor and router [message #168772] Fri, 18 February 2005 21:26 Go to next message
Sapna George is currently offline Sapna GeorgeFriend
Messages: 76
Registered: July 2009
Member
My earlier question:

"My polyline connection uses ChopboxAnchors and
FanRouter+BendpointConnectionRouter like in the Logic example. However, if i
move a node with two or more connections, one one of the connections move
along with the node. The others stay hanging in the original place. If i
click on any of these dangling connections, they refresh and fix themselves
to the node automatically."

I debugged a little and found that ChopboxAnchor and AutomaticRouter have
certain behaviors that might be leading to the above problem:
1. The automatic router (FanRouter in my case) groups together all anchors
on mulitple connections that are at the same "location" using a HashKey.
This is so that it can take approriate handleCollision action. In the case
of FanRouter, it inserts an additional bendpoint inorder to fan out. It
order to find out if 2 anchors on different connections are at the same
location, the router expexts the Anchor class to implement the equals method
and the getHashCode method.
2. The equals method in ChopboxAnchor returns true if the two chopbox
anchors belong to the same figure irrespective of the location of the anchor
on the figure.So, two anchors may be at opposite sides of the figure, but
will still return true. This should not be the case, in my opinion. Only a
new anchor that is at the exact location as an exisiting one should return
true. A new anchor at the opposite side of the figure should return false.

So, I modified ChopboxAnchor behavior to as follows and there is some
improvement:
protected Point locationPoint; // new variable to store anchor location.

public Point getLocation(Point reference) { // super class is ChopboxAnchor
locationPoint = super.getLocation(reference);
return locationPoint;
}

public boolean equals(Object obj) { // returns true only if the location of
both anchors is exactly the same.
if (obj instanceof TestChopboxAnchor) {
MyChopboxAnchor other = (MyChopboxAnchor )obj;
if (getLocationPoint() != null && other.getLocationPoint() != null)
return other.getOwner() == getOwner() &&
other.getLocationPoint().equals(getLocationPoint());
}
return false;
}

After implementing this, the above dangling problem is not caused for ALL
connections on a node. It is caused for ONLY those connections using anchors
at the same location on the node boundary. i.e. if the node has 2
connections on two opposite sides, moving the node WILL NOT leave some
connections dangling.

For those connections that DO have anchors at the exact same location,
Here's what is causing the dangling problem. But i have no idea where it is
being caused and how to fix it:

At some point, by some class, the connection figures get removed from the
list of AnchorListeners in the ChopboxAnchor. This occurs for all
connections except the last one added to the figure. I found this by moving
the node figure and debugging ancestorMoved(IFigure figure) method in
AbstractConnectionAnchor class. Inspecting the variables in the class shows
that all anchors except one, on the figure had AnchorListener = null even
though they have connections associated with them. Therefore if the node
figure is moved, the connections do not receive anchorMoved events and the
connections are left dangling!

I tried a lot to find out where this was occuring, but i was unsuccesful.
Can any of the experts help?

thanks
Sapna
Re: ChopboxAnchor bug ? - related to earler post on connection anchor and router [message #169159 is a reply to message #168772] Mon, 21 February 2005 19:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Please try using the most recent official release to find out if the
behavior you are seeing is new (a bug). Then, search for a bugzilla or try
a more recent build. Next, open a bugzilla, or wait for your newsgroup post
to be answered.
Re: ChopboxAnchor bug ? - related to earler post on connection anchor and router [message #169177 is a reply to message #169159] Mon, 21 February 2005 22:26 Go to previous messageGo to next message
Sapna George is currently offline Sapna GeorgeFriend
Messages: 76
Registered: July 2009
Member
Yes. It turns out to be a bug that has been fixed in the latest builds.

thanks
Sapna

"Randy Hudson" <none@us.ibm.com> wrote in message
news:cvddo8$7dt$1@www.eclipse.org...
> Please try using the most recent official release to find out if the
> behavior you are seeing is new (a bug). Then, search for a bugzilla or
try
> a more recent build. Next, open a bugzilla, or wait for your newsgroup
post
> to be answered.
>
>
Re: ChopboxAnchor bug ? - related to earler post on connection anchor and router [message #170240 is a reply to message #169177] Wed, 02 March 2005 18:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gbreeds.yahoo.com

Which build is it fixed in, is it 3.1M5 or the GEF M5 or do you have both?

I'm on 3.1M4, WindowsXP, with the org.eclipse.gef_3.1.0 released on 12/23
and I'm still getting the unrefreshed connections.


"Sapna George" <sgeorge@vt.edu> wrote in message
news:cvdn2e$g61$1@www.eclipse.org...
> Yes. It turns out to be a bug that has been fixed in the latest builds.
>
> thanks
> Sapna
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:cvddo8$7dt$1@www.eclipse.org...
>> Please try using the most recent official release to find out if the
>> behavior you are seeing is new (a bug). Then, search for a bugzilla or
> try
>> a more recent build. Next, open a bugzilla, or wait for your newsgroup
> post
>> to be answered.
>>
>>
>
>
Re: ChopboxAnchor bug ? - related to earler post on connection anchor and router [message #170960 is a reply to message #170240] Tue, 08 March 2005 06:35 Go to previous message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
You'll need GEF 3.1M5.

"George" <gbreeds@yahoo.com> wrote in message
news:d051qb$631$1@www.eclipse.org...
> Which build is it fixed in, is it 3.1M5 or the GEF M5 or do you have both?
>
> I'm on 3.1M4, WindowsXP, with the org.eclipse.gef_3.1.0 released on 12/23
> and I'm still getting the unrefreshed connections.
>
>
> "Sapna George" <sgeorge@vt.edu> wrote in message
> news:cvdn2e$g61$1@www.eclipse.org...
> > Yes. It turns out to be a bug that has been fixed in the latest builds.
> >
> > thanks
> > Sapna
> >
> > "Randy Hudson" <none@us.ibm.com> wrote in message
> > news:cvddo8$7dt$1@www.eclipse.org...
> >> Please try using the most recent official release to find out if the
> >> behavior you are seeing is new (a bug). Then, search for a bugzilla or
> > try
> >> a more recent build. Next, open a bugzilla, or wait for your newsgroup
> > post
> >> to be answered.
> >>
> >>
> >
> >
>
>
Previous Topic:Text displayed in a thumbnail
Next Topic:Any plans to support "grouping" and "nesting" ?
Goto Forum:
  


Current Time: Fri Apr 26 00:19:41 GMT 2024

Powered by FUDForum. Page generated in 0.03262 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top