Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to reroute the connections on collapse without model change? How to ensure edges having bendpoin
How to reroute the connections on collapse without model change? How to ensure edges having bendpoin [message #210903] Tue, 11 November 2008 11:46 Go to next message
Eclipse UserFriend
Originally posted by: uwe.suedbeck.koeln.de

Hi Everybody,
hopefully i'll get an answer this time.

My Problem is as follows. In my editor there are components that can
contain items which can have connections. Now when i collapse the
compartment of a component in which the items reside i want to reroute
the connection to now point at the collapsed component instead of
pointing nowhere.
I do this by listening to the Collapse_Notify of the compartment. On
Event i iterate over the childs of the component and set the Source or
target of the Connection to the collapsed Component. On decollapse i am
doing the same vice versa.

I'd like to know whether this is an adaquat good approach or not.

Also I encounter a strange behavior on the very last of my components.
This one is fine on collapse but on decollapse i get a Nullpointer in
ConnectionEditPart.refreshBendPoints() cause the bendpoints are null.

I managed to figure out that somehow the eUnset of the EdgeImpl class is
called with the BendPoint-Feature so that the bendpoints are set to
null. The only method i call ist SetSource() asn setTarget on my
ConnectionEditParts.

Please Help.

(Sorry for the Double-Post but i finally recognized that edge is GMF)
Re: How to reroute the connections on collapse without model change?How to ensure edges having bendp [message #210953 is a reply to message #210903] Wed, 12 November 2008 05:11 Go to previous messageGo to next message
Eclipse UserFriend
Hello Uwe,

I suggest you to introduce one more type of the link into your diagram description.
This link will point to the link tartet container and should be "derived"
one. You can hide/show this link on collapsing/uncollapsing compartment.

The situation then you are modifying LinkEditPart source/target should be
viable solution, but i think you'll spend some time fighting with the update
from Notation model to EditParts state (in GMf this update process was written
with an idea each link EditPart points to an EditPart of it's source/target
node...)

-----------------
Alex Shatalin
Re: How to reroute the connections on collapse without model change?How to ensure edges having bendp [message #211005 is a reply to message #210953] Wed, 12 November 2008 07:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: uwe.suedbeck.koeln.de

Hello Alex,

i'm not sure whether i got this right.

Do you mean that i need to change my model and add several invisible
Connections for any possible connection between the source, or its
container and the target and its container? And after that i would alter
the visible-state according to the collapsed state of the containers?

Like this? :

all in all 4 Connections
a) source -> target
b) source -> target's container
c) source's container -> target
d) source's container -> target's container

<node> <node>
<container> ---------------<container>
/
<source/>-----------------------------<target/>
/
</container>---------- </container>
</node> </node>

(Before i'll try this i think i'd like to battle down GMF's
NotationModel Update mechanism. ;-))

or are you saying that i need to derive my Connection eObject by a lets
call it a "CollapsedConnection"-Object which automatically connects to
the compartment instead of the target? How could i achieve this? How
could i switch from one Type to the other on collapse of the compartment?



Alex Shatalin wrote:
> Hello Uwe,
>
> I suggest you to introduce one more type of the link into your diagram
> description. This link will point to the link tartet container and
> should be "derived" one. You can hide/show this link on
> collapsing/uncollapsing compartment.
> The situation then you are modifying LinkEditPart source/target should
> be viable solution, but i think you'll spend some time fighting with the
> update from Notation model to EditParts state (in GMf this update
> process was written with an idea each link EditPart points to an
> EditPart of it's source/target node...)
>
> -----------------
> Alex Shatalin
>
>
Re: How to reroute the connections on collapse without model change?Howto ensure edges having bendpo [message #211013 is a reply to message #211005] Wed, 12 November 2008 08:27 Go to previous messageGo to next message
Eclipse UserFriend
Hello Uwe,

> Like this? :
Yes, Another option is to add "source -> target's container" connection into
notation model only on hiding compartment contents..

> this? How could i switch from one Type to the other on collapse of the
> compartment?
Well, you have to do it manually - I do not see any ready solution for this
use case.

-----------------
Alex Shatalin
Re: How to reroute the connections on collapse without model change?Howto ensure edges having bendpo [message #211358 is a reply to message #211013] Mon, 17 November 2008 06:43 Go to previous message
Eclipse UserFriend
Originally posted by: uwe.suedbeck.koeln.de

Hi Alex,
we can close this thread. I finally managed to find the error and it had
nothing to do with Model/View-Update mechanism. I had an error on my
diagram updater that provoked this remove on the collapsed editpart.
Setting Source/Target on Connections is definitive a viable solution for
the collapse issue.

Thank you for your help!

Alex Shatalin schrieb:
> Hello Uwe,
>
>> Like this? :
> Yes, Another option is to add "source -> target's container" connection
> into notation model only on hiding compartment contents..
>
>> this? How could i switch from one Type to the other on collapse of the
>> compartment?
> Well, you have to do it manually - I do not see any ready solution for
> this use case.
>
> -----------------
> Alex Shatalin
>
>
Previous Topic:Problem with mutli editors for one meta model
Next Topic:integrating emf and gmf editors
Goto Forum:
  


Current Time: Thu May 15 10:41:49 EDT 2025

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

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

Back to the top