|
|
Re: Set Node Visible when initialized [message #198614 is a reply to message #198528] |
Wed, 23 July 2008 14:12 |
Guillaume Gauffre Messages: 65 Registered: July 2009 |
Member |
|
|
I have another problem concerning these parts of my editor :
I also need to set visible node B and its link to the connection X when
the connection X is selected, and set unvisible the others.
To do that I extend the SelectionEditPolicy class and override the
showPrimarySelection() :
I find the Edge and Node elements that I need to set visible or not but
when I try to use setVisible(), I have an exception like this :
java.lang.IllegalStateException: Cannot modify resource set without a
write transaction
at
org.eclipse.emf.transaction.impl.TransactionChangeRecorder.a ssertWriting(TransactionChangeRecorder.java:338)
at
org.eclipse.emf.transaction.impl.TransactionChangeRecorder.a ppendNotification(TransactionChangeRecorder.java:300)
at
org.eclipse.emf.transaction.impl.TransactionChangeRecorder.p rocessObjectNotification(TransactionChangeRecorder.java:282)
at
org.eclipse.emf.transaction.impl.TransactionChangeRecorder.n otifyChanged(TransactionChangeRecorder.java:238)
at
org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify (BasicNotifierImpl.java:247)
at
org.eclipse.gmf.runtime.notation.impl.ViewImpl.setVisible(Vi ewImpl.java:228)
Does anybody know why ?
Many thanks !
Guillaume a écrit :
> Hi,
>
> I have one connection of type X between two nodes of type A.
> When I create such a link, I initialize a reference of this connection
> which refers to a node of type B.
> The resulted figure is a connection X between the 2 nodes of type A and
> another connection between the link X previsouly created and the node of
> type B. So the 2nd connection doesn't map an EClass of my ecore model,
> just a reference between classes X and B.
> My problem is that when I create my connection X, the connection appears
> but the figure B doesn't, except if I create a node or if I reopen the
> diagram.
> And if I delete the connection X, the node B is always displayed, except
> if I reopen the diagram or create a new node.
> How could I resolve this problem, what kind of action is realized during
> the creation of a node which make my node B visible ?
>
> Thanks.
>
> Guillaume
|
|
|
|
Re: Set Node Visible when initialized [message #198750 is a reply to message #198614] |
Thu, 24 July 2008 07:42 |
Eclipse User |
|
|
|
Originally posted by: eclipse.[REMOVE]stefan-kuhn.eu
use a AbstractTransactionalCommand to do changes to the domain or
notation model.
-stefan
Guillaume schrieb:
> I have another problem concerning these parts of my editor :
>
> I also need to set visible node B and its link to the connection X when
> the connection X is selected, and set unvisible the others.
>
> To do that I extend the SelectionEditPolicy class and override the
> showPrimarySelection() :
>
> I find the Edge and Node elements that I need to set visible or not but
> when I try to use setVisible(), I have an exception like this :
>
> java.lang.IllegalStateException: Cannot modify resource set without a
> write transaction
> at
> org.eclipse.emf.transaction.impl.TransactionChangeRecorder.a ssertWriting(TransactionChangeRecorder.java:338)
>
> at
> org.eclipse.emf.transaction.impl.TransactionChangeRecorder.a ppendNotification(TransactionChangeRecorder.java:300)
>
> at
> org.eclipse.emf.transaction.impl.TransactionChangeRecorder.p rocessObjectNotification(TransactionChangeRecorder.java:282)
>
> at
> org.eclipse.emf.transaction.impl.TransactionChangeRecorder.n otifyChanged(TransactionChangeRecorder.java:238)
>
> at
> org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify (BasicNotifierImpl.java:247)
>
> at
> org.eclipse.gmf.runtime.notation.impl.ViewImpl.setVisible(Vi ewImpl.java:228)
>
>
>
> Does anybody know why ?
>
> Many thanks !
>
> Guillaume a écrit :
>> Hi,
>>
>> I have one connection of type X between two nodes of type A.
>> When I create such a link, I initialize a reference of this
>> connection which refers to a node of type B.
>> The resulted figure is a connection X between the 2 nodes of type A
>> and another connection between the link X previsouly created and the
>> node of type B. So the 2nd connection doesn't map an EClass of my
>> ecore model, just a reference between classes X and B.
>> My problem is that when I create my connection X, the connection
>> appears but the figure B doesn't, except if I create a node or if I
>> reopen the diagram.
>> And if I delete the connection X, the node B is always displayed,
>> except if I reopen the diagram or create a new node.
>> How could I resolve this problem, what kind of action is realized
>> during the creation of a node which make my node B visible ?
>>
>> Thanks.
>>
>> Guillaume
|
|
|
Re: Set Node Visible when initialized [message #198784 is a reply to message #198750] |
Thu, 24 July 2008 09:32 |
Guillaume Gauffre Messages: 65 Registered: July 2009 |
Member |
|
|
Thanks,
I've just found the trick !
Another quick question : is it possible to get the View object
corresponding to a model element ?
Stefan Kuhn a écrit :
> use a AbstractTransactionalCommand to do changes to the domain or
> notation model.
>
> -stefan
>
>
> Guillaume schrieb:
>> I have another problem concerning these parts of my editor :
>>
>> I also need to set visible node B and its link to the connection X
>> when the connection X is selected, and set unvisible the others.
>>
>> To do that I extend the SelectionEditPolicy class and override the
>> showPrimarySelection() :
>>
>> I find the Edge and Node elements that I need to set visible or not
>> but when I try to use setVisible(), I have an exception like this :
>>
>> java.lang.IllegalStateException: Cannot modify resource set without a
>> write transaction
>> at
>> org.eclipse.emf.transaction.impl.TransactionChangeRecorder.a ssertWriting(TransactionChangeRecorder.java:338)
>>
>> at
>> org.eclipse.emf.transaction.impl.TransactionChangeRecorder.a ppendNotification(TransactionChangeRecorder.java:300)
>>
>> at
>> org.eclipse.emf.transaction.impl.TransactionChangeRecorder.p rocessObjectNotification(TransactionChangeRecorder.java:282)
>>
>> at
>> org.eclipse.emf.transaction.impl.TransactionChangeRecorder.n otifyChanged(TransactionChangeRecorder.java:238)
>>
>> at
>> org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify (BasicNotifierImpl.java:247)
>>
>> at
>> org.eclipse.gmf.runtime.notation.impl.ViewImpl.setVisible(Vi ewImpl.java:228)
>>
>>
>>
>> Does anybody know why ?
>>
>> Many thanks !
>>
>> Guillaume a écrit :
>>> Hi,
>>>
>>> I have one connection of type X between two nodes of type A.
>>> When I create such a link, I initialize a reference of this
>>> connection which refers to a node of type B.
>>> The resulted figure is a connection X between the 2 nodes of type A
>>> and another connection between the link X previsouly created and the
>>> node of type B. So the 2nd connection doesn't map an EClass of my
>>> ecore model, just a reference between classes X and B.
>>> My problem is that when I create my connection X, the connection
>>> appears but the figure B doesn't, except if I create a node or if I
>>> reopen the diagram.
>>> And if I delete the connection X, the node B is always displayed,
>>> except if I reopen the diagram or create a new node.
>>> How could I resolve this problem, what kind of action is realized
>>> during the creation of a node which make my node B visible ?
>>>
>>> Thanks.
>>>
>>> Guillaume
>
|
|
|
Re: Set Node Visible when initialized [message #198879 is a reply to message #198784] |
Fri, 25 July 2008 05:57 |
Eclipse User |
|
|
|
Originally posted by: eclipse.[REMOVE]stefan-kuhn.eu
you can use the CrossReferenceAdapter (or GMFCrossRef... or similar).
But I wouldn't do that.
-stefan
Guillaume schrieb:
> Thanks,
> I've just found the trick !
>
> Another quick question : is it possible to get the View object
> corresponding to a model element ?
>
>
>
> Stefan Kuhn a écrit :
>> use a AbstractTransactionalCommand to do changes to the domain or
>> notation model.
>>
>> -stefan
>>
>>
>> Guillaume schrieb:
>>> I have another problem concerning these parts of my editor :
>>>
>>> I also need to set visible node B and its link to the connection X
>>> when the connection X is selected, and set unvisible the others.
>>>
>>> To do that I extend the SelectionEditPolicy class and override the
>>> showPrimarySelection() :
>>>
>>> I find the Edge and Node elements that I need to set visible or not
>>> but when I try to use setVisible(), I have an exception like this :
>>>
>>> java.lang.IllegalStateException: Cannot modify resource set without a
>>> write transaction
>>> at
>>> org.eclipse.emf.transaction.impl.TransactionChangeRecorder.a ssertWriting(TransactionChangeRecorder.java:338)
>>>
>>> at
>>> org.eclipse.emf.transaction.impl.TransactionChangeRecorder.a ppendNotification(TransactionChangeRecorder.java:300)
>>>
>>> at
>>> org.eclipse.emf.transaction.impl.TransactionChangeRecorder.p rocessObjectNotification(TransactionChangeRecorder.java:282)
>>>
>>> at
>>> org.eclipse.emf.transaction.impl.TransactionChangeRecorder.n otifyChanged(TransactionChangeRecorder.java:238)
>>>
>>> at
>>> org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify (BasicNotifierImpl.java:247)
>>>
>>> at
>>> org.eclipse.gmf.runtime.notation.impl.ViewImpl.setVisible(Vi ewImpl.java:228)
>>>
>>>
>>>
>>> Does anybody know why ?
>>>
>>> Many thanks !
>>>
>>> Guillaume a écrit :
>>>> Hi,
>>>>
>>>> I have one connection of type X between two nodes of type A.
>>>> When I create such a link, I initialize a reference of this
>>>> connection which refers to a node of type B.
>>>> The resulted figure is a connection X between the 2 nodes of type A
>>>> and another connection between the link X previsouly created and the
>>>> node of type B. So the 2nd connection doesn't map an EClass of my
>>>> ecore model, just a reference between classes X and B.
>>>> My problem is that when I create my connection X, the connection
>>>> appears but the figure B doesn't, except if I create a node or if I
>>>> reopen the diagram.
>>>> And if I delete the connection X, the node B is always displayed,
>>>> except if I reopen the diagram or create a new node.
>>>> How could I resolve this problem, what kind of action is realized
>>>> during the creation of a node which make my node B visible ?
>>>>
>>>> Thanks.
>>>>
>>>> Guillaume
>>
|
|
|
Powered by
FUDForum. Page generated in 0.04106 seconds