Use of Routing and JumpLinks For Connectors [message #158477] |
Tue, 06 November 2007 11:35 |
Eclipse User |
|
|
|
Originally posted by: Shwetha.V.in.bosch.com
Hi,
By default the Routing Style of a Connector is set to Oblique.How can I
change the default value to Rectilinear.Similarly Jump Links Status is
None by default how can I change it All and Jump Type to Chamfered.
I tried to override refereshRoutingStyle() in ConnectorEditPart,but it is
throwing an Exception.Please guide me where to change and which method to
change.
Instead of overriding the code can I change something in gmfgraph or
gmfgen to do the above mentioned changes.
Thanks in advance.
Regards,
Shwetha
|
|
|
|
Re: Use of Routing and JumpLinks For Connectors [message #159173 is a reply to message #159128] |
Fri, 09 November 2007 09:17 |
Eclipse User |
|
|
|
Originally posted by: Shwetha.V.in.bosch.com
Hello,
I managed to find the solution for my query.
To change the style property of the connector I overrided
initializeFromPreferences() in ConnectorViewFactory class generated by GMF
inside factories package.
@Override
protected void initializeFromPreferences(View view) {
super.initializeFromPreferences(view);
IPreferenceStore store = (IPreferenceStore) getPreferencesHint()
.getPreferenceStore();
RoutingStyle routingStyle =
(RoutingStyle)view.getStyle(NotationPackage.Literals.ROUTING _STYLE);
if (routingStyle != null) {
// Routing.get(1) is for RECTILINEAR Routing style.
Routing routing = Routing.get(1);
if (routing != null) {
routingStyle.setRouting(routing);
routingStyle.setJumpLinkStatus(JumpLinkStatus.ALL_LITERAL);
routingStyle.setJumpLinkType(JumpLinkType.CHAMFERED_LITERAL) ;
}
}
}
It works for me,but would be happy to know is this the right place.
Thanks and Regards,
Shwetha
|
|
|
|
Powered by
FUDForum. Page generated in 0.03381 seconds