Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Code to use connections with bending points
Code to use connections with bending points [message #238981] Tue, 09 October 2007 15:38 Go to next message
Eclipse UserFriend
Originally posted by: luis_dediego.yahoo.com

Hi,

I have an editor where I have placed some elements. One of them is a
list of instances of a shape called ReferencePoint that try to represent
a path. Connecting them there are Polyline instances created using the
WireEditPart from the Flow example.

The lines are created, the connections can be selected but if I try to
create a new Bendingpoint by dragging the center point I got a
NullPointerException at

org.eclipse.gef.editpolicies.BendpointEditPolicy.showCreateB endpointFeedback(BendpointEditPolicy.java:312)


when trying to access the connection figure constraints. I get a null
instead an empty ArrayList.

I should have missed some code from the example but I am unable to found
where the constraint or any of such references gets created.

Please help. I have almost spent a whole day looking for a line of code
where I can create the constraint, even I have modified the original
code without success.

Thank you for any help.
Re: Code to use connections with bending points [message #238991 is a reply to message #238981] Tue, 09 October 2007 18:13 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
I'm not sure, but why are you expecting an empty list? Digging thru the code, I can see that in PolylineConnection:

public Object getRoutingConstraint() {
	if (getConnectionRouter() != null)
		return getConnectionRouter().getConstraint(this);
	else
		return null;
}

So basically your connection route is null. Are you missing to set the BendpointConnectionRouter somewhere?
Re: Code to use connections with bending points [message #239034 is a reply to message #238991] Wed, 10 October 2007 14:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: luis_dediego.yahoo.com

Hi, I have reviewed the code and it is true that the
getConnectionRouter() returns an instance of the default
PolylineConnection$RoutingNotifier that gives a
ConnectionRouter$NullConnectionRouter

This return a null constraint all times it is called. I have started to
review the original FLOW code to see where there is the setting for the
RoutingNotifier to check if that is the part I have forget.

Thank you for pointing my that direction.
Luis

Prakash wrote:
> I'm not sure, but why are you expecting an empty list? Digging thru the code, I can see that in PolylineConnection:
>
>
> public Object getRoutingConstraint() {
> 	if (getConnectionRouter() != null)
> 		return getConnectionRouter().getConstraint(this);
> 	else
> 		return null;
> }
> 

> So basically your connection route is null. Are you missing to set the BendpointConnectionRouter somewhere?
Re: Code to use connections with bending points [message #239037 is a reply to message #238991] Wed, 10 October 2007 15:07 Go to previous message
Eclipse UserFriend
Originally posted by: luis_dediego.yahoo.com

Hi,

I found the problem. I did not add the code to set the default Router on the connection layer of my diagram. I
located the code on the refreshVisuals() for the root diagram container and I added it to my our root
container and now the editing, creation and deletion of bending points works perfectly.

Thanks a lot for the help.
Luis

Prakash wrote:
> I'm not sure, but why are you expecting an empty list? Digging thru the code, I can see that in PolylineConnection:
>
>
> public Object getRoutingConstraint() {
> 	if (getConnectionRouter() != null)
> 		return getConnectionRouter().getConstraint(this);
> 	else
> 		return null;
> }
> 

> So basically your connection route is null. Are you missing to set the BendpointConnectionRouter somewhere?
Previous Topic:a gef editor's tale
Next Topic:Programmatically run arrange action
Goto Forum:
  


Current Time: Thu Apr 18 17:29:04 GMT 2024

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

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

Back to the top