Adding a node between connections [message #82688] |
Mon, 04 December 2006 18:52 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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! ^^
|
|
|
|
Powered by
FUDForum. Page generated in 0.03093 seconds