setroutingconstraint curve problem [message #195715] |
Thu, 03 July 2008 15:50 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03754 seconds