Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Display subset of model elements
Display subset of model elements [message #1256563] Tue, 25 February 2014 15:14 Go to next message
Wilbert Alberts is currently offline Wilbert AlbertsFriend
Messages: 99
Registered: June 2010
Member
Hi,

Does Sirius support creation of an editor which, by default, starts with an empty canvas and allows the user to drag individual elements from the model explorer to the canvas?

Suppose that I have a large model of interconnected entities. I would like to be able to create a number of diagrams that contain a subset of these entities. If related entities are shown, the edge between them should also show up.

I would like to start with an empty diagram and have the ability to drop individual model entities on the canvas.

If I define a diagram and a mapping, how do I prevent creation of the mappings for all elements present in the model?

(Maybe this has been documented but in that case my eyes did not yet stumble over it.)

Greetings,
Wilbert.
Re: Display subset of model elements [message #1256592 is a reply to message #1256563] Tue, 25 February 2014 15:41 Go to previous message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 146
Registered: July 2009
Senior Member
Le 25/02/2014 16:14, Wilbert Alberts a écrit :
> Hi,

Hi.

> Does Sirius support creation of an editor which, by default, starts with
> an empty canvas and allows the user to drag individual elements from the
> model explorer to the canvas?

Yes. By default the mappings you define in a diagram are in
"Synchronized" mode, which means the diagram will always show all
matching instances in the model.

You can setup your mappings (all of them or just a subset) to "Not
Synchronized". In that mode Sirius will not create graphical views of
the matching instances by itself. You have to provide some tool (e.g. a
drop tool) invocable by the user which explicitly creates the view
(using the "Create View" model operation). Once a view is created, it
will stay on the diagram (unless explicitly removed) even if the
corresponding mapping in "Not synchronized".

You can control this setting in the "Advanced" section of the mappings'
properties. Note that there is a third value, with the (slightly
misleading) name "Unsynchronizable". In that mode, the user himself can
decide if theses mappings should behave as "Synchronized" or "Not
synchronized" using the corresponding entry in the diagram's context menu.

> Suppose that I have a large model of interconnected entities. I would
> like to be able to create a number of diagrams that contain a subset of
> these entities.

I encourage you to dig into the sources of the new version of Ecore
Tools 2.0 at http://www.eclipse.org/ecoretools/ and
https://git.eclipse.org/c/ecoretools/org.eclipse.ecoretools.git/. The
main VSM is at
org.eclipse.emf.ecoretools.design/description/ecore.odesign and I think
it contains at least one representation which works exactly like this.

> If related entities are shown, the edge between them
> should also show up.

This will happen by default (if the edge's mapping is Synchronized).

> I would like to start with an empty diagram and have the ability to drop
> individual model entities on the canvas.

Set all your node and container mappings to "Unsynchronized" and create
DnD tools which explicitly use the "Create View" operation. If the edge
mappings are Synchronized, they will appear automatically once both ends
are visible.

> If I define a diagram and a mapping, how do I prevent creation of the
> mappings for all elements present in the model?

See above.

> (Maybe this has been documented but in that case my eyes did not yet
> stumble over it.)

See the section called "Synchronization." in
http://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#graphical_elements

Regards,
Pierre-Charles David
Previous Topic:Custom Language for Queries
Next Topic:Deleting a project with open sessions
Goto Forum:
  


Current Time: Sun Dec 21 20:57:15 GMT 2014

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

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