Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » setroutingconstraint curve problem
setroutingconstraint curve problem [message #195715] Thu, 03 July 2008 15:50 Go to next message
Eclipse UserFriend
Originally posted by: kelvinng.db.gmail.com

Hi everyone,

I have a connector extends PolylineConnection rather than PolylineConnectionEx.
For all my other connectors, that extend PolylineConnectionEx, they
curve smoothly after I call:

///////////////////////////////////////////
RoutingStyle style = (RoutingStyle)
view.getStyle(NotationPackage.eINSTANCE.getRoutingStyle());
style.setSmoothness(org.eclipse.gmf.runtime.notation.Smoothn ess.NORMAL_LITERAL);
///////////////////////////////////////////

in

their respective view factories, but for the one connector that extends
PolylineConnection, it doesn't curve at all.

Now, I read that there still might be a way to curve it using routing
constraints (setroutingconstraint)?
I can't seem to get the code right, and it's just not working properly.
Can someone post an example of how it's done?

This is what I have so far:

///////////////////////////////////////////
public class DependencyLineConnection extends PolylineConnection {
.........

protected void outlineShape(Graphics g) {
.......

ConnectionRouter connectionRouter = this.getConnectionRouter();
ArrayList<AbsoluteBendpoint> list = new ArrayList<AbsoluteBendpoint>();

list.add(new AbsoluteBendpoint(midPoint));
this.setRoutingConstraint(list);
///////////////////////////////////////////

This doesn't work, and the line disappears. Any tips?
Thanks in advance.

~Kelvin Ng
Re: setroutingconstraint curve problem [message #195806 is a reply to message #195715] Fri, 04 July 2008 14:40 Go to previous message
Eclipse UserFriend
Originally posted by: kelvinng.db.gmail.com

Nevermind!
I was deeply mistaken.

The simple solution is simply have my connector extend
PolylineConnectionEx as well.
I originally had it extend PolylineConnection, for no good reason.

~Kelvin Ng

On 2008-07-03 11:50:51 -0400, Kelvin Ng <kelvinng.db@gmail.com> said:

> Hi everyone,
>
> I have a connector extends PolylineConnection rather than PolylineConnectionEx.
> For all my other connectors, that extend PolylineConnectionEx, they
> curve smoothly after I call:
>
> ///////////////////////////////////////////
> RoutingStyle style = (RoutingStyle)
> view.getStyle(NotationPackage.eINSTANCE.getRoutingStyle());
> style.setSmoothness(org.eclipse.gmf.runtime.notation.Smoothn ess.NORMAL_LITERAL);
///////////////////////////////////////////

in
their
>
> respective view factories, but for the one connector that extends
> PolylineConnection, it doesn't curve at all.
>
> Now, I read that there still might be a way to curve it using routing
> constraints (setroutingconstraint)?
> I can't seem to get the code right, and it's just not working properly.
> Can someone post an example of how it's done?
>
> This is what I have so far:
>
> ///////////////////////////////////////////
> public class DependencyLineConnection extends PolylineConnection {
> ........
>
> protected void outlineShape(Graphics g) {
> .......
>
> ConnectionRouter connectionRouter = this.getConnectionRouter();
> ArrayList<AbsoluteBendpoint> list = new ArrayList<AbsoluteBendpoint>();
>
> list.add(new AbsoluteBendpoint(midPoint));
> this.setRoutingConstraint(list);
> ///////////////////////////////////////////
>
> This doesn't work, and the line disappears. Any tips?
> Thanks in advance.
>
> ~Kelvin Ng
Previous Topic:Exception when generating diagram code from .gmfgen
Next Topic:A clear definition of "children feature" and its use cases?
Goto Forum:
  


Current Time: Mon May 25 06:23:58 GMT 2020

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

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

Back to the top