Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Ecore Tools] Diagram editor: reflect model changes automatically
[Ecore Tools] Diagram editor: reflect model changes automatically [message #536440] Fri, 28 May 2010 09:21 Go to next message
Jens von Pilgrim is currently offline Jens von PilgrimFriend
Messages: 295
Registered: July 2009
Senior Member
Hi all,

while the UML2 Tools diagram editors automatically reflect model
changes, the Ecore Tools diagram editor doesn't. Is it possible to
activate that somehow (via preferences, diagram properties or
programmatically)? E.g., when a new class is created in the Ecore model,
I want at new figure to be created automatically.

Cheers

Jens
Re: [Ecore Tools] Diagram editor: reflect model changes automatically [message #536469 is a reply to message #536440] Fri, 28 May 2010 12:08 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26289
Registered: July 2009
Senior Member
Jens,

I think this is the GMF difference between synchronized and
unsynchronized. I don't think there's a dynamic switch for it.


Jens v.P. wrote:
> Hi all,
>
> while the UML2 Tools diagram editors automatically reflect model
> changes, the Ecore Tools diagram editor doesn't. Is it possible to
> activate that somehow (via preferences, diagram properties or
> programmatically)? E.g., when a new class is created in the Ecore
> model, I want at new figure to be created automatically.
>
> Cheers
>
> Jens
Re: [Ecore Tools] Diagram editor: reflect model changes automatically [message #536482 is a reply to message #536469] Fri, 28 May 2010 12:44 Go to previous messageGo to next message
Jens von Pilgrim is currently offline Jens von PilgrimFriend
Messages: 295
Registered: July 2009
Senior Member
On 28.05.10 14:08, Ed Merks wrote:
> I think this is the GMF difference between synchronized and
> unsynchronized. I don't think there's a dynamic switch for it.

Oh, yes, thank you (I've read Section 11.4.2 "Gen Diagram" in [Gro09]
now...). But, frankly, I'm a little bit ... surprised: In order to
change that behavior, I have to REGENERATE the editor? Does that mean,
since the "default" Ecore tools editor does not support synchronization,
that I have to create my very own version of the Ecore tools? That
cannot be, can it? And why is synchronization disabled in the Ecore
diagram editor?

Actually, I'm using the same TransactionalEditingDomain in the tool
modifying the (semantic) model and the GMF editor (GEF3D provides a
features for sharing a TransactionalEditingDomain across several
GEF/GMF-editors combined in a multi-editor and additional tools). This
is working with the UML tools editors (class diagram, use case diagram
etc.) and my own GEF-based editor. So, I assume, it is the missing
synchronization feature of the Ecore tools, preventing Ecore diagrams to
be updated automatically. If there is no "dynamic switch", there may be
a "dynamic hack"?

Cheers

Jens

[Gro09] Gronback, Richard C.: Eclipse Modeling Project: A
Domain-Specific Language (DSL) Toolkit. 1st. Addison-Wesley, 2009 (The
Eclipse Series). – ISBN 978–0–321–53407–1
Re: [Ecore Tools] Diagram editor: reflect model changes automatically [message #536483 is a reply to message #536482] Fri, 28 May 2010 13:03 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26289
Registered: July 2009
Senior Member
Jens,

Comments below.

Jens v.P. wrote:
> On 28.05.10 14:08, Ed Merks wrote:
>> I think this is the GMF difference between synchronized and
>> unsynchronized. I don't think there's a dynamic switch for it.
>
> Oh, yes, thank you (I've read Section 11.4.2 "Gen Diagram" in [Gro09]
> now...). But, frankly, I'm a little bit ... surprised: In order to
> change that behavior, I have to REGENERATE the editor? Does that mean,
> since the "default" Ecore tools editor does not support
> synchronization, that I have to create my very own version of the
> Ecore tools? That cannot be, can it? And why is synchronization
> disabled in the Ecore diagram editor?
Personally I'd not want it. For Ecore itself, for example, I have five
diagrams, each showing a meaningful subset/view of Ecore. I can't
imagine that for large models one would want just a single synchronized
diagram that shows all things.
>
> Actually, I'm using the same TransactionalEditingDomain in the tool
> modifying the (semantic) model and the GMF editor (GEF3D provides a
> features for sharing a TransactionalEditingDomain across several
> GEF/GMF-editors combined in a multi-editor and additional tools). This
> is working with the UML tools editors (class diagram, use case diagram
> etc.) and my own GEF-based editor. So, I assume, it is the missing
> synchronization feature of the Ecore tools, preventing Ecore diagrams
> to be updated automatically. If there is no "dynamic switch", there
> may be a "dynamic hack"?
I don't think Ecore Tools uses an editing domain that shared with
anything else. Where are you changing Ecore that you're expecting to
also see in the diagram editor?
>
> Cheers
>
> Jens
>
> [Gro09] Gronback, Richard C.: Eclipse Modeling Project: A
> Domain-Specific Language (DSL) Toolkit. 1st. Addison-Wesley, 2009 (The
> Eclipse Series). – ISBN 978–0–321–53407–1
Re: [Ecore Tools] Diagram editor: reflect model changes automatically [message #536529 is a reply to message #536483] Fri, 28 May 2010 14:57 Go to previous messageGo to next message
Jens von Pilgrim is currently offline Jens von PilgrimFriend
Messages: 295
Registered: July 2009
Senior Member
Ed,

On 28.05.10 15:03, Ed Merks wrote:
>> And why is synchronization disabled in the Ecore diagram editor?
> Personally I'd not want it.

Well, sometimes I'd want it, sometimes I'd not want it. Actually, this
is why I'm so much surprised to learn that there is no dynamic switch.
IMHO a graphical editor for models should be able to sync, otherwise
it's simply a drawing tool (and I prefer to use real drawing tools in
that case). Without sync, the Ecore diagram editor cannot be used in
combination with transformation tools, as it doesn't reflect the
changes. And how do you keep your manually created diagrams
synchronized? That is, what if you create a new class in one diagram? Is
there any way to see that new class in another diagram?

> I don't think Ecore Tools uses an editing domain that shared with
> anything else. Where are you changing Ecore that you're expecting to
> also see in the diagram editor?

I'm not changing Ecore, I'm only sharing the same
TransactionalEditingDomain across the Ecore diagram editor, a UML Use
Case editor and my personal transformation tool. I had to modify (not to
say "hack") the EcoreDiagramEditor and the UML*DiagramEditors to use my
editing domain. This is a problem indeed, IMHO it is a bug and there
already exists an apparently forgotten bug report for the UML2 Tools
(http://bugs.eclipse.org/189974) about that.

Cheers,

Jens
Re: [Ecore Tools] Diagram editor: reflect model changes automatically [message #536559 is a reply to message #536529] Fri, 28 May 2010 16:29 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26289
Registered: July 2009
Senior Member
Jens,

Comments below.

Jens v.P. wrote:
> Ed,
>
> On 28.05.10 15:03, Ed Merks wrote:
>>> And why is synchronization disabled in the Ecore diagram editor?
>> Personally I'd not want it.
>
> Well, sometimes I'd want it, sometimes I'd not want it. Actually, this
> is why I'm so much surprised to learn that there is no dynamic switch.
I'm just guessing there isn't.
> IMHO a graphical editor for models should be able to sync, otherwise
> it's simply a drawing tool (and I prefer to use real drawing tools in
> that case).
There are things like restore related items. I imagine an action to
add all missing objects to a diagram might be possible too...
> Without sync, the Ecore diagram editor cannot be used in combination
> with transformation tools, as it doesn't reflect the changes.
I imagine most automated changes would make a mess though...
> And how do you keep your manually created diagrams synchronized?
Very carefully. :-P
> That is, what if you create a new class in one diagram? Is there any
> way to see that new class in another diagram?
Not automatically. There's not much development activity in Ecore Tools
so perhaps you want to try to contribute to it...
>
>> I don't think Ecore Tools uses an editing domain that shared with
>> anything else. Where are you changing Ecore that you're expecting to
>> also see in the diagram editor?
>
> I'm not changing Ecore, I'm only sharing the same
> TransactionalEditingDomain across the Ecore diagram editor, a UML Use
> Case editor and my personal transformation tool. I had to modify (not
> to say "hack") the EcoreDiagramEditor and the UML*DiagramEditors to
> use my editing domain. This is a problem indeed, IMHO it is a bug and
> there already exists an apparently forgotten bug report for the UML2
> Tools (http://bugs.eclipse.org/189974) about that.
There isn't even much bug fixing going on. :-(
>
> Cheers,
>
> Jens
Re: [Ecore Tools] Diagram editor: reflect model changes automatically [message #536581 is a reply to message #536559] Fri, 28 May 2010 18:19 Go to previous message
Jens von Pilgrim is currently offline Jens von PilgrimFriend
Messages: 295
Registered: July 2009
Senior Member
Ed,

I have added some lines to my editor, now the diagram is synchronized at
least in my special use case. As I have my own version of the
DiagramEditPart anyway (a 3D-fied version), I can simply install a new
edit policy there
( https://dev.eclipse.org/svnroot/technology/org.eclipse.gef3d /trunk/org.eclipse.gef3d.examples.ecore/src/java/org/eclipse /gef3d/examples/ecore/diagram/parts/DiagramEditPart3D.java).


On 28.05.10 18:29, Ed Merks wrote:
>> Actually, this
>> is why I'm so much surprised to learn that there is no dynamic switch.
> I'm just guessing there isn't.

From my code change, I'd assume there is no dynamic switch.
Interestingly, the EPackageCanonicalEditPolicy, which is responsible for
creating new views on model changes, explicitly removes that feature for
nodes. The method is marked with "generated NOT". My hack restores the
behavior of the base class (more or less).

> There are things like restore related items. I imagine an action to add
> all missing objects to a diagram might be possible too...

Are there? Where? I haven't found any tools, actions or menu items.

>> And how do you keep your manually created diagrams synchronized?
> Very carefully. :-P

LOL :-) I'll mark your words ;-)

> Not automatically. There's not much development activity in Ecore Tools
> so perhaps you want to try to contribute to it...
[..]
> There isn't even much bug fixing going on. :-(

If only someone would pay me for doing that ;-)

Cheers,

Jens
Re: [Ecore Tools] Diagram editor: reflect model changes automatically [message #622945 is a reply to message #536440] Fri, 28 May 2010 12:08 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 26289
Registered: July 2009
Senior Member
Jens,

I think this is the GMF difference between synchronized and
unsynchronized. I don't think there's a dynamic switch for it.


Jens v.P. wrote:
> Hi all,
>
> while the UML2 Tools diagram editors automatically reflect model
> changes, the Ecore Tools diagram editor doesn't. Is it possible to
> activate that somehow (via preferences, diagram properties or
> programmatically)? E.g., when a new class is created in the Ecore
> model, I want at new figure to be created automatically.
>
> Cheers
>
> Jens
Re: [Ecore Tools] Diagram editor: reflect model changes automatically [message #622946 is a reply to message #536469] Fri, 28 May 2010 12:44 Go to previous message
Jens von Pilgrim is currently offline Jens von PilgrimFriend
Messages: 295
Registered: July 2009
Senior Member
On 28.05.10 14:08, Ed Merks wrote:
> I think this is the GMF difference between synchronized and
> unsynchronized. I don't think there's a dynamic switch for it.

Oh, yes, thank you (I've read Section 11.4.2 "Gen Diagram" in [Gro09]
now...). But, frankly, I'm a little bit ... surprised: In order to
change that behavior, I have to REGENERATE the editor? Does that mean,
since the "default" Ecore tools editor does not support synchronization,
that I have to create my very own version of the Ecore tools? That
cannot be, can it? And why is synchronization disabled in the Ecore
diagram editor?

Actually, I'm using the same TransactionalEditingDomain in the tool
modifying the (semantic) model and the GMF editor (GEF3D provides a
features for sharing a TransactionalEditingDomain across several
GEF/GMF-editors combined in a multi-editor and additional tools). This
is working with the UML tools editors (class diagram, use case diagram
etc.) and my own GEF-based editor. So, I assume, it is the missing
synchronization feature of the Ecore tools, preventing Ecore diagrams to
be updated automatically. If there is no "dynamic switch", there may be
a "dynamic hack"?

Cheers

Jens

[Gro09] Gronback, Richard C.: Eclipse Modeling Project: A
Domain-Specific Language (DSL) Toolkit. 1st. Addison-Wesley, 2009 (The
Eclipse Series). – ISBN 978–0–321–53407–1
Re: [Ecore Tools] Diagram editor: reflect model changes automatically [message #622947 is a reply to message #536482] Fri, 28 May 2010 13:03 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 26289
Registered: July 2009
Senior Member
Jens,

Comments below.

Jens v.P. wrote:
> On 28.05.10 14:08, Ed Merks wrote:
>> I think this is the GMF difference between synchronized and
>> unsynchronized. I don't think there's a dynamic switch for it.
>
> Oh, yes, thank you (I've read Section 11.4.2 "Gen Diagram" in [Gro09]
> now...). But, frankly, I'm a little bit ... surprised: In order to
> change that behavior, I have to REGENERATE the editor? Does that mean,
> since the "default" Ecore tools editor does not support
> synchronization, that I have to create my very own version of the
> Ecore tools? That cannot be, can it? And why is synchronization
> disabled in the Ecore diagram editor?
Personally I'd not want it. For Ecore itself, for example, I have five
diagrams, each showing a meaningful subset/view of Ecore. I can't
imagine that for large models one would want just a single synchronized
diagram that shows all things.
>
> Actually, I'm using the same TransactionalEditingDomain in the tool
> modifying the (semantic) model and the GMF editor (GEF3D provides a
> features for sharing a TransactionalEditingDomain across several
> GEF/GMF-editors combined in a multi-editor and additional tools). This
> is working with the UML tools editors (class diagram, use case diagram
> etc.) and my own GEF-based editor. So, I assume, it is the missing
> synchronization feature of the Ecore tools, preventing Ecore diagrams
> to be updated automatically. If there is no "dynamic switch", there
> may be a "dynamic hack"?
I don't think Ecore Tools uses an editing domain that shared with
anything else. Where are you changing Ecore that you're expecting to
also see in the diagram editor?
>
> Cheers
>
> Jens
>
> [Gro09] Gronback, Richard C.: Eclipse Modeling Project: A
> Domain-Specific Language (DSL) Toolkit. 1st. Addison-Wesley, 2009 (The
> Eclipse Series). – ISBN 978–0–321–53407–1
Re: [Ecore Tools] Diagram editor: reflect model changes automatically [message #622950 is a reply to message #536483] Fri, 28 May 2010 14:57 Go to previous message
Jens von Pilgrim is currently offline Jens von PilgrimFriend
Messages: 295
Registered: July 2009
Senior Member
Ed,

On 28.05.10 15:03, Ed Merks wrote:
>> And why is synchronization disabled in the Ecore diagram editor?
> Personally I'd not want it.

Well, sometimes I'd want it, sometimes I'd not want it. Actually, this
is why I'm so much surprised to learn that there is no dynamic switch.
IMHO a graphical editor for models should be able to sync, otherwise
it's simply a drawing tool (and I prefer to use real drawing tools in
that case). Without sync, the Ecore diagram editor cannot be used in
combination with transformation tools, as it doesn't reflect the
changes. And how do you keep your manually created diagrams
synchronized? That is, what if you create a new class in one diagram? Is
there any way to see that new class in another diagram?

> I don't think Ecore Tools uses an editing domain that shared with
> anything else. Where are you changing Ecore that you're expecting to
> also see in the diagram editor?

I'm not changing Ecore, I'm only sharing the same
TransactionalEditingDomain across the Ecore diagram editor, a UML Use
Case editor and my personal transformation tool. I had to modify (not to
say "hack") the EcoreDiagramEditor and the UML*DiagramEditors to use my
editing domain. This is a problem indeed, IMHO it is a bug and there
already exists an apparently forgotten bug report for the UML2 Tools
(http://bugs.eclipse.org/189974) about that.

Cheers,

Jens
Re: [Ecore Tools] Diagram editor: reflect model changes automatically [message #622952 is a reply to message #536529] Fri, 28 May 2010 16:29 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 26289
Registered: July 2009
Senior Member
Jens,

Comments below.

Jens v.P. wrote:
> Ed,
>
> On 28.05.10 15:03, Ed Merks wrote:
>>> And why is synchronization disabled in the Ecore diagram editor?
>> Personally I'd not want it.
>
> Well, sometimes I'd want it, sometimes I'd not want it. Actually, this
> is why I'm so much surprised to learn that there is no dynamic switch.
I'm just guessing there isn't.
> IMHO a graphical editor for models should be able to sync, otherwise
> it's simply a drawing tool (and I prefer to use real drawing tools in
> that case).
There are things like restore related items. I imagine an action to
add all missing objects to a diagram might be possible too...
> Without sync, the Ecore diagram editor cannot be used in combination
> with transformation tools, as it doesn't reflect the changes.
I imagine most automated changes would make a mess though...
> And how do you keep your manually created diagrams synchronized?
Very carefully. :-P
> That is, what if you create a new class in one diagram? Is there any
> way to see that new class in another diagram?
Not automatically. There's not much development activity in Ecore Tools
so perhaps you want to try to contribute to it...
>
>> I don't think Ecore Tools uses an editing domain that shared with
>> anything else. Where are you changing Ecore that you're expecting to
>> also see in the diagram editor?
>
> I'm not changing Ecore, I'm only sharing the same
> TransactionalEditingDomain across the Ecore diagram editor, a UML Use
> Case editor and my personal transformation tool. I had to modify (not
> to say "hack") the EcoreDiagramEditor and the UML*DiagramEditors to
> use my editing domain. This is a problem indeed, IMHO it is a bug and
> there already exists an apparently forgotten bug report for the UML2
> Tools (http://bugs.eclipse.org/189974) about that.
There isn't even much bug fixing going on. :-(
>
> Cheers,
>
> Jens
Re: [Ecore Tools] Diagram editor: reflect model changes automatically [message #622953 is a reply to message #536559] Fri, 28 May 2010 18:19 Go to previous message
Jens von Pilgrim is currently offline Jens von PilgrimFriend
Messages: 295
Registered: July 2009
Senior Member
Ed,

I have added some lines to my editor, now the diagram is synchronized at
least in my special use case. As I have my own version of the
DiagramEditPart anyway (a 3D-fied version), I can simply install a new
edit policy there
( https://dev.eclipse.org/svnroot/technology/org.eclipse.gef3d /trunk/org.eclipse.gef3d.examples.ecore/src/java/org/eclipse /gef3d/examples/ecore/diagram/parts/DiagramEditPart3D.java).


On 28.05.10 18:29, Ed Merks wrote:
>> Actually, this
>> is why I'm so much surprised to learn that there is no dynamic switch.
> I'm just guessing there isn't.

From my code change, I'd assume there is no dynamic switch.
Interestingly, the EPackageCanonicalEditPolicy, which is responsible for
creating new views on model changes, explicitly removes that feature for
nodes. The method is marked with "generated NOT". My hack restores the
behavior of the base class (more or less).

> There are things like restore related items. I imagine an action to add
> all missing objects to a diagram might be possible too...

Are there? Where? I haven't found any tools, actions or menu items.

>> And how do you keep your manually created diagrams synchronized?
> Very carefully. :-P

LOL :-) I'll mark your words ;-)

> Not automatically. There's not much development activity in Ecore Tools
> so perhaps you want to try to contribute to it...
[..]
> There isn't even much bug fixing going on. :-(

If only someone would pay me for doing that ;-)

Cheers,

Jens
Previous Topic:EMF Compare with large files
Next Topic:EMF Compare
Goto Forum:
  


Current Time: Tue Dec 23 01:39:12 GMT 2014

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

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