|Re: Display subset of model elements [message #1256592 is a reply to message #1256563]
||Tue, 25 February 2014 15:41
| Pierre-Charles David
Registered: July 2009
Le 25/02/2014 16:14, Wilbert Alberts a écrit :|
> 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
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
> 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.)
See the section called "Synchronization." in
Powered by FUDForum
. Page generated in 0.01983 seconds