Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Re:(Mohammed Mostafa) delete a node including all links start or end at this node
Re:(Mohammed Mostafa) delete a node including all links start or end at this node [message #68569] Tue, 24 October 2006 11:07 Go to next message
Eclipse UserFriend
Originally posted by: greenl.mot.com

This is a multi-part message in MIME format.

------=_NextPart_000_0057_01C6F7C1.349E0D80
Content-Type: text/plain;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable

Mohammed,

I can hit the breakpoint set in NotationViewDependentsAdvice. However, I =
was unfortunately not be able to hit my breakpoint set in the Advices =
methods in the domain model, specifically, I overwrite =
getDestroyDependentsCommand(...) method in my XXXEditHelper class, but I =
found the execution flow never reach that method when I delete a figure =
with link to other figures.

Consequently, the Node and Edge are removed from the view, the Object =
represented by the node is also removed from the domain model, but the =
object representend by the edge doesn't.

Do you know where I am wrong?

Thanks,
Green


------------------------------------------------------------ -------------=
-------

Martin Jacob wrote:

Hi Jacob;
if i understand you correctly; i think you want the edges connecting a=20
view to go away as the view is deleted

there is a class called NotationViewDependentsAdvice which is supposed=20
to handle this for you

it does that in the getBeforeDestroyDependentsCommand method
you can add a break point there to see if the edge will be deleted with=20
the view.

One more thing to check, is make sure your problem is not a refresh=20
problem, i mean your edge might have been deleted but the diagram for=20
one reason or another did not refresh, you can check that by closing and =

reopening your diagram or dragging another shape to the diagram, if the=20
edge disappear then you might have a refresh problem.

also, keep in mind i'm talking here from the Runtime component point of=20
view not from he code generation point of view.



> Cherie,
>=20
> I delete Node |B| in the diagram. Select it and push the "Del" key at=20
> the keyboard.
>=20
> No, automatically deletion is not handeled by GMF. May I modeled it in =
a=20
> wrong way?
>=20
> I have a class ClassA reference the ClassNodes and ClassLinks. It =
looks=20
> in UML some thing like this:
>=20
> ----------
> | ClassA |
> ----------
> /\ /\
> \/ \/
> | |
> | |
> ----------- -----------
> |ClassNode| |ClassLink|
> ----------- -----------
>=20
> The Canvas maps to ClassA, ClassNode is a TopNodeReference and Link =
Mapp=20
> maps to ClassLink.
>=20
> Any advice where I am wrong?
>=20
> Martin
>=20
> Cherie Mahoney wrote:
>=20
>> Martin,
>=20
>> I think this should be handled automatically by GMF. How are you=20
>> deleting
>> Node |B|? Is there anything special about your scenario that might=20
>> affect
>> this?
>=20
>> - Cherie
>=20
>> "Martin Jacob" <mj@bahntechnik.de> wrote in message
>> news:d5df94b5cf283bf114e69e0efce46789$1@www.eclipse.org...
>>> Hi,
>>>
>>> I have the following situation:
>>> Node: |xyz|
>>> Link: (xyz)
>>>
>>> "Diagram:" |A|----(ab)----|B|-----(bc)----|C|
>>>
>>> In case I select and delete Node |B| I want also to delete the links =

>>> (ab)
>>> and (bc).
>>>
>>> Any I dea how to do this?
>>>
>>> Thanks,
>>> Martin
>>>
>=20
Hi

------=_NextPart_000_0057_01C6F7C1.349E0D80
Content-Type: text/html;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dgb2312">
<META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT color=3D#000000 size=3D2>Mohammed,</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>I can hit the breakpoint set in=20
NotationViewDependentsAdvice. However, I was unfortunately not be able =
to hit my=20
breakpoint set in the Advices methods in the domain model, specifically, =
I=20
overwrite&nbsp;getDestroyDependentsCommand(...) method in&nbsp;my =
XXXEditHelper=20
class, but I found the execution flow never reach that method when I =
delete a=20
figure with link to other figures.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>Consequently, the Node and Edge are =
removed from=20
the view, the Object represented by the node&nbsp;is also removed from =
the=20
domain model, but the object representend by the edge =
doesn't.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>Do you know where I am =
wrong?</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>Thanks,</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>Green</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>
<HR>
</DIV>
<DIV><FONT color=3D#000000 size=3D2>Martin Jacob wrote:<BR><BR>Hi =
Jacob;<BR>if i=20
understand you correctly; i think you want the edges connecting a =
<BR>view to go=20
away as the view is deleted<BR><BR>there is a class called=20
NotationViewDependentsAdvice which is supposed <BR>to handle this for=20
you<BR><BR>it does that in the getBeforeDestroyDependentsCommand =
method<BR>you=20
can add a break point there to see if the edge will be deleted with =
<BR>the=20
view.<BR><BR>One more thing to check, is make sure your problem is not a =
refresh=20
<BR>problem, i mean your edge might have been deleted but the diagram =
for=20
<BR>one reason or another did not refresh, you can check that by closing =
and=20
<BR>reopening your diagram or dragging another shape to the diagram, if =
the=20
<BR>edge disappear then you might have a refresh problem.<BR><BR>also, =
keep in=20
mind i'm talking here from the Runtime component point of <BR>view not =
from he=20
code generation point of view.<BR><BR><BR><BR>&gt; Cherie,<BR>&gt; =
<BR>&gt; I=20
delete Node |B| in the diagram. Select it and push the "Del" key at =
<BR>&gt; the=20
keyboard.<BR>&gt; <BR>&gt; No, automatically deletion is not handeled by =
GMF.=20
May I modeled it in a <BR>&gt; wrong way?<BR>&gt; <BR>&gt; I have a =
class ClassA=20
reference the ClassNodes and ClassLinks. It looks <BR>&gt; in UML some =
thing=20
like this:<BR>&gt;=20
<BR> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
----------<BR> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp; |=20
ClassA =
|<BR> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
----------<BR> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;&nbsp;&nbsp; =

/\&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;=20
/\<BR> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;&nbsp;&nbsp;=20
\/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;=20
\/<BR> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;=20
|<BR> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;=20
|<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; -----------&nbsp;=20
-----------<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; |ClassNode|&nbsp;=20
|ClassLink|<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; -----------&nbsp;=20
-----------<BR>&gt; <BR>&gt; The Canvas maps to ClassA, ClassNode is a=20
TopNodeReference and Link Mapp <BR>&gt; maps to ClassLink.<BR>&gt; =
<BR>&gt; Any=20
advice where I am wrong?<BR>&gt; <BR>&gt; Martin<BR>&gt; <BR>&gt; Cherie =
Mahoney=20
wrote:<BR>&gt; <BR>&gt;&gt; Martin,<BR>&gt; <BR>&gt;&gt; I think this =
should be=20
handled automatically by GMF.&nbsp; How are you <BR>&gt;&gt;=20
deleting<BR>&gt;&gt; Node |B|?&nbsp; Is there anything special about =
your=20
scenario that might <BR>&gt;&gt; affect<BR>&gt;&gt; this?<BR>&gt; =
<BR>&gt;&gt; -=20
Cherie<BR>&gt; <BR>&gt;&gt; "Martin Jacob" &lt;</FONT><A href=3D""><FONT =

color=3D#000000 size=3D2>mj@bahntechnik.de</FONT></A><FONT =
color=3D#000000 size=3D2>&gt;=20
wrote in message<BR>&gt;&gt; </FONT><A href=3D""><FONT color=3D#000000=20
size=3D2>news:d5df94b5cf283bf114e69e0efce46789$1@www.eclipse.org</FONT></=
A><FONT=20
color=3D#000000 size=3D2>...<BR>&gt;&gt;&gt; =
Hi,<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; I=20
have the following situation:<BR>&gt;&gt;&gt; Node: =
|xyz|<BR>&gt;&gt;&gt; Link:=20
(xyz)<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; "Diagram:"=20
|A|----(ab)----|B|-----(bc)----|C|<BR>&gt;&gt;&gt; <BR>&gt;&gt;&gt; In =
case I=20
select and delete Node |B| I want also to delete the links =
<BR>&gt;&gt;&gt;=20
(ab)<BR>&gt;&gt;&gt; and (bc).<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; Any I dea =
how to=20
do this?<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; =
Thanks,<BR>&gt;&gt;&gt;&nbsp;&nbsp;=20
Martin<BR>&gt;&gt;&gt;<BR>&gt; <BR>Hi</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_0057_01C6F7C1.349E0D80--
Re: Re:(Mohammed Mostafa) delete a node including all links start or end at this node [message #68591 is a reply to message #68569] Tue, 24 October 2006 11:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: greenl.mot.com

This is a multi-part message in MIME format.

------=_NextPart_000_006A_01C6F7C2.89F1F750
Content-Type: text/plain;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable

Another finding, the Edge is NOT actually removed from the view, it is =
still there, just not visible to user (since no target Node). I reach to =
this conclusion because every time after I have mannually removed the =
link object from the domain model xml file, and then I do some operation =
like arrange figures and save the diagram file, I found the removed link =
object come out like a ghost in the domain model xml file.
"Green Law" <greenl@mot.com> wrote in message =
news:ehla82$2se$1@utils.eclipse.org...
Mohammed,

I can hit the breakpoint set in NotationViewDependentsAdvice. However, =
I was unfortunately not be able to hit my breakpoint set in the Advices =
methods in the domain model, specifically, I overwrite =
getDestroyDependentsCommand(...) method in my XXXEditHelper class, but I =
found the execution flow never reach that method when I delete a figure =
with link to other figures.

Consequently, the Node and Edge are removed from the view, the Object =
represented by the node is also removed from the domain model, but the =
object representend by the edge doesn't.

Do you know where I am wrong?

Thanks,
Green


------------------------------------------------------------ -------------=
-----

Martin Jacob wrote:

Hi Jacob;
if i understand you correctly; i think you want the edges connecting a =

view to go away as the view is deleted

there is a class called NotationViewDependentsAdvice which is supposed =

to handle this for you

it does that in the getBeforeDestroyDependentsCommand method
you can add a break point there to see if the edge will be deleted =
with=20
the view.

One more thing to check, is make sure your problem is not a refresh=20
problem, i mean your edge might have been deleted but the diagram for=20
one reason or another did not refresh, you can check that by closing =
and=20
reopening your diagram or dragging another shape to the diagram, if =
the=20
edge disappear then you might have a refresh problem.

also, keep in mind i'm talking here from the Runtime component point =
of=20
view not from he code generation point of view.



> Cherie,
>=20
> I delete Node |B| in the diagram. Select it and push the "Del" key =
at=20
> the keyboard.
>=20
> No, automatically deletion is not handeled by GMF. May I modeled it =
in a=20
> wrong way?
>=20
> I have a class ClassA reference the ClassNodes and ClassLinks. It =
looks=20
> in UML some thing like this:
>=20
> ----------
> | ClassA |
> ----------
> /\ /\
> \/ \/
> | |
> | |
> ----------- -----------
> |ClassNode| |ClassLink|
> ----------- -----------
>=20
> The Canvas maps to ClassA, ClassNode is a TopNodeReference and Link =
Mapp=20
> maps to ClassLink.
>=20
> Any advice where I am wrong?
>=20
> Martin
>=20
> Cherie Mahoney wrote:
>=20
>> Martin,
>=20
>> I think this should be handled automatically by GMF. How are you=20
>> deleting
>> Node |B|? Is there anything special about your scenario that might =

>> affect
>> this?
>=20
>> - Cherie
>=20
>> "Martin Jacob" <mj@bahntechnik.de> wrote in message
>> news:d5df94b5cf283bf114e69e0efce46789$1@www.eclipse.org...
>>> Hi,
>>>
>>> I have the following situation:
>>> Node: |xyz|
>>> Link: (xyz)
>>>
>>> "Diagram:" |A|----(ab)----|B|-----(bc)----|C|
>>>
>>> In case I select and delete Node |B| I want also to delete the =
links=20
>>> (ab)
>>> and (bc).
>>>
>>> Any I dea how to do this?
>>>
>>> Thanks,
>>> Martin
>>>
>=20
Hi

------=_NextPart_000_006A_01C6F7C2.89F1F750
Content-Type: text/html;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dgb2312">
<META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#000000 size=3D2>Another finding, the Edge is NOT =
actually=20
removed from the view, it is still there, just not visible to user =
(since no=20
target Node). I reach to this conclusion because every time after I have =

mannually removed the link object from the domain model xml file, and =
then I do=20
some operation like arrange figures and save the diagram file, I found =
the=20
removed link object come out like a ghost in the domain model xml=20
file.</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Green Law" &lt;<A =
href=3D"mailto:greenl@mot.com">greenl@mot.com</A>&gt;=20
wrote in message <A=20
=
href=3D"news:ehla82$2se$1@utils.eclipse.org">news:ehla82$2se$1@utils.ecli=
pse.org</A>...</DIV>
<DIV><FONT color=3D#000000 size=3D2>Mohammed,</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>I can hit the breakpoint set in=20
NotationViewDependentsAdvice. However, I was unfortunately not be able =
to hit=20
my breakpoint set in the Advices methods in the domain model, =
specifically, I=20
overwrite&nbsp;getDestroyDependentsCommand(...) method in&nbsp;my=20
XXXEditHelper class, but I found the execution flow never reach that =
method=20
when I delete a figure with link to other figures.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>Consequently, the Node and Edge =
are removed=20
from the view, the Object represented by the node&nbsp;is also removed =
from=20
the domain model, but the object representend by the edge=20
doesn't.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>Do you know where I am =
wrong?</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>Thanks,</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>Green</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>
<HR>
</DIV>
<DIV><FONT color=3D#000000 size=3D2>Martin Jacob wrote:<BR><BR>Hi =
Jacob;<BR>if i=20
understand you correctly; i think you want the edges connecting a =
<BR>view to=20
go away as the view is deleted<BR><BR>there is a class called=20
NotationViewDependentsAdvice which is supposed <BR>to handle this for=20
you<BR><BR>it does that in the getBeforeDestroyDependentsCommand =
method<BR>you=20
can add a break point there to see if the edge will be deleted with =
<BR>the=20
view.<BR><BR>One more thing to check, is make sure your problem is not =
a=20
refresh <BR>problem, i mean your edge might have been deleted but the =
diagram=20
for <BR>one reason or another did not refresh, you can check that by =
closing=20
and <BR>reopening your diagram or dragging another shape to the =
diagram, if=20
the <BR>edge disappear then you might have a refresh =
problem.<BR><BR>also,=20
keep in mind i'm talking here from the Runtime component point of =
<BR>view not=20
from he code generation point of view.<BR><BR><BR><BR>&gt; =
Cherie,<BR>&gt;=20
<BR>&gt; I delete Node |B| in the diagram. Select it and push the =
"Del" key at=20
<BR>&gt; the keyboard.<BR>&gt; <BR>&gt; No, automatically deletion is =
not=20
handeled by GMF. May I modeled it in a <BR>&gt; wrong way?<BR>&gt; =
<BR>&gt; I=20
have a class ClassA reference the ClassNodes and ClassLinks. It looks =
<BR>&gt;=20
in UML some thing like this:<BR>&gt;=20
<BR> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
=
----------<BR> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;=20
| ClassA =
|<BR> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
=
----------<BR> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;&nbsp;&nbsp; =

/\&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;=20
/\<BR> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;&nbsp;&nbsp;=20
\/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;=20
\/<BR> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =

|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;=20
|<BR> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;=20
|<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; -----------&nbsp;=20
-----------<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; |ClassNode|&nbsp;=20
|ClassLink|<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; -----------&nbsp;=20
-----------<BR>&gt; <BR>&gt; The Canvas maps to ClassA, ClassNode is a =

TopNodeReference and Link Mapp <BR>&gt; maps to ClassLink.<BR>&gt; =
<BR>&gt;=20
Any advice where I am wrong?<BR>&gt; <BR>&gt; Martin<BR>&gt; <BR>&gt; =
Cherie=20
Mahoney wrote:<BR>&gt; <BR>&gt;&gt; Martin,<BR>&gt; <BR>&gt;&gt; I =
think this=20
should be handled automatically by GMF.&nbsp; How are you <BR>&gt;&gt; =

deleting<BR>&gt;&gt; Node |B|?&nbsp; Is there anything special about =
your=20
scenario that might <BR>&gt;&gt; affect<BR>&gt;&gt; this?<BR>&gt; =
<BR>&gt;&gt;=20
- Cherie<BR>&gt; <BR>&gt;&gt; "Martin Jacob" &lt;</FONT><A =
href=3D""><FONT=20
color=3D#000000 size=3D2>mj@bahntechnik.de</FONT></A><FONT =
color=3D#000000=20
size=3D2>&gt; wrote in message<BR>&gt;&gt; </FONT><A href=3D""><FONT =
color=3D#000000=20
=
size=3D2>news:d5df94b5cf283bf114e69e0efce46789$1@www.eclipse.org</FONT></=
A><FONT=20
color=3D#000000 size=3D2>...<BR>&gt;&gt;&gt; =
Hi,<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; I=20
have the following situation:<BR>&gt;&gt;&gt; Node: =
|xyz|<BR>&gt;&gt;&gt;=20
Link: (xyz)<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; "Diagram:"=20
|A|----(ab)----|B|-----(bc)----|C|<BR>&gt;&gt;&gt; <BR>&gt;&gt;&gt; In =
case I=20
select and delete Node |B| I want also to delete the links =
<BR>&gt;&gt;&gt;=20
(ab)<BR>&gt;&gt;&gt; and (bc).<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt; Any I =
dea how=20
to do this?<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt;=20
Thanks,<BR>&gt;&gt;&gt;&nbsp;&nbsp; Martin<BR>&gt;&gt;&gt;<BR>&gt;=20
<BR>Hi</FONT></DIV>
<DIV><FONT color=3D#000000 =
size=3D2></FONT>&nbsp;</DIV></BLOCKQUOTE></BODY></HTML >

------=_NextPart_000_006A_01C6F7C2.89F1F750--
Re: (Mohammed Mostafa) delete a node including all links start or end at this node [message #70312 is a reply to message #68569] Thu, 26 October 2006 12:44 Go to previous message
Eclipse UserFriend
Hi Green;
The NotationViewDependentsAdvice, will delete the edges connected to
the view but it will not delete the semantic element for the edges it is
destroying; since this semantic element might be used but other edges.
If you need to delete the semantic element when the edge is deleted you
need to handle that in your own advice, but be careful since the
semantic element might be used by other views.



Green Law wrote:




> Mohammed,
>
> I can hit the breakpoint set in NotationViewDependentsAdvice. However, I
> was unfortunately not be able to hit my breakpoint set in the Advices
> methods in the domain model, specifically, I
> overwrite getDestroyDependentsCommand(...) method in my XXXEditHelper
> class, but I found the execution flow never reach that method when I
> delete a figure with link to other figures.
>
> Consequently, the Node and Edge are removed from the view, the Object
> represented by the node is also removed from the domain model, but the
> object representend by the edge doesn't.
>
> Do you know where I am wrong?
>
> Thanks,
> Green
>
> ------------------------------------------------------------ ------------
> Martin Jacob wrote:
>
> Hi Jacob;
> if i understand you correctly; i think you want the edges connecting a
> view to go away as the view is deleted
>
> there is a class called NotationViewDependentsAdvice which is supposed
> to handle this for you
>
> it does that in the getBeforeDestroyDependentsCommand method
> you can add a break point there to see if the edge will be deleted with
> the view.
>
> One more thing to check, is make sure your problem is not a refresh
> problem, i mean your edge might have been deleted but the diagram for
> one reason or another did not refresh, you can check that by closing and
> reopening your diagram or dragging another shape to the diagram, if the
> edge disappear then you might have a refresh problem.
>
> also, keep in mind i'm talking here from the Runtime component point of
> view not from he code generation point of view.
>
>
>
> > Cherie,
> >
> > I delete Node |B| in the diagram. Select it and push the "Del" key at
> > the keyboard.
> >
> > No, automatically deletion is not handeled by GMF. May I modeled it in a
> > wrong way?
> >
> > I have a class ClassA reference the ClassNodes and ClassLinks. It looks
> > in UML some thing like this:
> >
> > ----------
> > | ClassA |
> > ----------
> > /\ /\
> > \/ \/
> > | |
> > | |
> > ----------- -----------
> > |ClassNode| |ClassLink|
> > ----------- -----------
> >
> > The Canvas maps to ClassA, ClassNode is a TopNodeReference and Link Mapp
> > maps to ClassLink.
> >
> > Any advice where I am wrong?
> >
> > Martin
> >
> > Cherie Mahoney wrote:
> >
> >> Martin,
> >
> >> I think this should be handled automatically by GMF. How are you
> >> deleting
> >> Node |B|? Is there anything special about your scenario that might
> >> affect
> >> this?
> >
> >> - Cherie
> >
> >> "Martin Jacob" <mj@bahntechnik.de> wrote in message
> >> news:d5df94b5cf283bf114e69e0efce46789$1@www.eclipse.org...
> >>> Hi,
> >>>
> >>> I have the following situation:
> >>> Node: |xyz|
> >>> Link: (xyz)
> >>>
> >>> "Diagram:" |A|----(ab)----|B|-----(bc)----|C|
> >>>
> >>> In case I select and delete Node |B| I want also to delete the links
> >>> (ab)
> >>> and (bc).
> >>>
> >>> Any I dea how to do this?
> >>>
> >>> Thanks,
> >>> Martin
> >>>
> >
> Hi
>
Previous Topic:GMF Internationalization
Next Topic:how to reflect model inheritance hierarchy in the generated editParts ?
Goto Forum:
  


Current Time: Tue Jul 22 13:54:24 EDT 2025

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

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

Back to the top