Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Adding a node between connections
Adding a node between connections [message #82688] Mon, 04 December 2006 18:52 Go to next message
Eclipse UserFriend
Originally posted by: julias.frb.br

when i create a connection between two nodes, i want to add another node
automatically, like splitting the new connection.

Is that possible?
Im trying to do this because when i connect two nodes inside different
compartments, the runtime creates two connections.
So its enough for me just to add a node (2px thick) between the other
two, so i get a
CompartmentNode-Connection-Node-Connection-CompartmentNode, bypassing
this problem.

any hints/snippets/magic-commands?
Thanks! ^^
Re: Adding a node between connections [message #82895 is a reply to message #82688] Tue, 05 December 2006 07:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ravikanth.pramati.com

Do u want to avoid creation of two connections, or is it that you
require to create an intermediate node.

In case you want to avoid creation of two connections, then the magic is
as follows:

public class xxxxDiagramCanonicalEditPolicy extends
CanonicalConnectionEditPolicy {
.....

@Override
protected boolean shouldHandleNotificationEvent(Notification event) {
super.shouldHandleNotificationEvent(event);
return false;
}

or else modify the Itemsemanticeditpolicy of the compartment so that
while creation of the connection you can create a node as well!
-ravi

Julia Sartori wrote:
> when i create a connection between two nodes, i want to add another node
> automatically, like splitting the new connection.
>
> Is that possible?
> Im trying to do this because when i connect two nodes inside different
> compartments, the runtime creates two connections.
> So its enough for me just to add a node (2px thick) between the other
> two, so i get a
> CompartmentNode-Connection-Node-Connection-CompartmentNode, bypassing
> this problem.
>
> any hints/snippets/magic-commands?
> Thanks! ^^
Re: Adding a node between connections [message #82938 is a reply to message #82895] Tue, 05 December 2006 11:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: julias.frb.br

Thanks ravi, thats much more simple that i imagined, really magic! =)

Thanks a lot, that solved my problem!! ^^




ravi wrote:
> Do u want to avoid creation of two connections, or is it that you
> require to create an intermediate node.
>
> In case you want to avoid creation of two connections, then the magic is
> as follows:
>
> public class xxxxDiagramCanonicalEditPolicy extends
> CanonicalConnectionEditPolicy {
> ....
>
> @Override
> protected boolean shouldHandleNotificationEvent(Notification event) {
> super.shouldHandleNotificationEvent(event);
> return false;
> }
>
> or else modify the Itemsemanticeditpolicy of the compartment so that
> while creation of the connection you can create a node as well!
> -ravi
>
> Julia Sartori wrote:
>> when i create a connection between two nodes, i want to add another
>> node automatically, like splitting the new connection.
>>
>> Is that possible?
>> Im trying to do this because when i connect two nodes inside different
>> compartments, the runtime creates two connections.
>> So its enough for me just to add a node (2px thick) between the other
>> two, so i get a
>> CompartmentNode-Connection-Node-Connection-CompartmentNode, bypassing
>> this problem.
>>
>> any hints/snippets/magic-commands?
>> Thanks! ^^
Re: Adding a node between connections [message #1649994 is a reply to message #82688] Wed, 04 March 2015 16:07 Go to previous message
dorra daddou is currently offline dorra daddouFriend
Messages: 6
Registered: February 2015
Junior Member
Hello have you any idea about creating automatically connections between nodes.i want an example please .
Previous Topic:how to change the nodes auto organization after loading resources
Next Topic:How to recreate transient model and view objects?
Goto Forum:
  


Current Time: Tue Apr 16 07:19:49 GMT 2024

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

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

Back to the top