Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to set ConnectionRouter?
How to set ConnectionRouter? [message #64881] Wed, 18 October 2006 05:43 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:How to replace the view of an existing element
Next Topic:How to create a vertical label
Goto Forum:
  


Current Time: Mon May 12 08:05:41 EDT 2025

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

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

Back to the top