How to set ConnectionRouter? [message #64881] |
Wed, 18 October 2006 05:43  |
Eclipse User |
|
|
|
Hi,
I would like to use ManhattanConnectionRouter in my application. I try to
set the ConnectionRouter in my Top Editpart but failed. It seems that the
way in traditional GEF application do not work. I wonder in which way I
could customize the router?
Best Regards
Junyan
|
|
|
Re: How to set ConnectionRouter? [message #65424 is a reply to message #64881] |
Wed, 18 October 2006 11:58  |
Eclipse User |
|
|
|
Originally posted by: vcciubot.uwaterloo.ca
I do it in the view factory corresponding to the connection:
public class ConnectionViewFactory extends
org.eclipse.gmf.runtime.diagram.ui.view.factories.Connection ViewFactory {
protected List createStyles(View view) {
List styles = new ArrayList();
styles.add(NotationFactory.eINSTANCE.createRoutingStyle());
styles.add(NotationFactory.eINSTANCE.createLineStyle());
styles.add(NotationFactory.eINSTANCE.createFillStyle());
return styles;
}
protected void decorateView(View containerView, View view,
IAdaptable semanticAdapter, String semanticHint, int index,
boolean persisted) {
if (semanticHint == null) {
semanticHint = Bluenose2VisualIDRegistry
.CONNECTION_VISUAL_ID;
view.setType(semanticHint);
}
super.decorateView(containerView, view, semanticAdapter, semanticHint,
index, persisted);
RoutingStyle rstyle = (RoutingStyle) view.getStyle(NotationPackage.eINSTANCE.getRoutingStyle());
rstyle.setAvoidObstructions(true);
rstyle.setRouting(Routing.MANUAL_LITERAL);
}
}
On Wed, 18 Oct 2006 09:43:23 +0000, Junyan wrote:
> Hi,
>
> I would like to use ManhattanConnectionRouter in my application. I try to
> set the ConnectionRouter in my Top Editpart but failed. It seems that the
> way in traditional GEF application do not work. I wonder in which way I
> could customize the router?
>
> Best Regards
> Junyan
|
|
|
Powered by
FUDForum. Page generated in 0.07719 seconds