Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » diagram partitioning / double click function doesnt work
diagram partitioning / double click function doesnt work [message #156374] Fri, 19 October 2007 08:15 Go to next message
Johannes Gross is currently offline Johannes GrossFriend
Messages: 28
Registered: July 2009
Junior Member
Dear all,

i´m trying to create a partitioned diagram after this proposal (Usecase
1) http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg06184.html
but all i get is a circle (stroken through by a line) when i double
click on the concerned element.

Any ideas what could be wrong in my model/ in the cookbook?

thx alot

hannes
Re: diagram partitioning / double click function doesnt work [message #156382 is a reply to message #156374] Fri, 19 October 2007 08:35 Go to previous messageGo to next message
Nicolai Kamenzky is currently offline Nicolai KamenzkyFriend
Messages: 82
Registered: July 2009
Member
Hi Hannes!

I also followed the instructions on diagram partitioning
but usecase 2!

Rarely I got that circle, too. The cause was that either
the wrong editor was loaded on double-click or the editor
was out of date. (The circle indicates an element which
can't be displayed because the editor has no graphical
representation for it.)

Maybe that helps a bit...

Nicolai


--

I'm using an evaluation license of nemo since 46 days.
You should really try it!
http://www.malcom-mac.com/nemo
Re: diagram partitioning / double click function doesnt work [message #156389 is a reply to message #156382] Fri, 19 October 2007 12:20 Go to previous messageGo to next message
Johannes Gross is currently offline Johannes GrossFriend
Messages: 28
Registered: July 2009
Junior Member
Hi Nicolai,

thx for your answer i also thought bout somethin being wrong at the end
of the chain.
but i dont get how the editor could not be loaded when i follow usecase
1 cause this means using the same editor twice...

for usecase 2 i had the same problem and here someone may tell me how i
can check which editor is loaded and which one does the job of the
"main" editor (cause sometimes they were changed).

many happy thanks










Nicolai Kamenzky schrieb:
> Hi Hannes!
>
> I also followed the instructions on diagram partitioning
> but usecase 2!
>
> Rarely I got that circle, too. The cause was that either
> the wrong editor was loaded on double-click or the editor
> was out of date. (The circle indicates an element which
> can't be displayed because the editor has no graphical
> representation for it.)
>
> Maybe that helps a bit...
>
> Nicolai
>
>
Re: diagram partitioning / double click function doesnt work [message #156505 is a reply to message #156389] Fri, 19 October 2007 15:57 Go to previous messageGo to next message
Stefan Kuhn is currently offline Stefan KuhnFriend
Messages: 355
Registered: July 2009
Senior Member
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hi, because this seems like a topic for the wiki, I added the stuff to
the eclipse-wiki under http://wiki.eclipse.org/Diagram_Partitioning

J. Groß schrieb:
> Hi Nicolai,
>
> thx for your answer i also thought bout somethin being wrong at the end
> of the chain.
> but i dont get how the editor could not be loaded when i follow usecase
> 1 cause this means using the same editor twice...
>
> for usecase 2 i had the same problem and here someone may tell me how i
> can check which editor is loaded and which one does the job of the
> "main" editor (cause sometimes they were changed).
>
> many happy thanks
>
>
>
>
>
>
>
>
>
>
> Nicolai Kamenzky schrieb:
>> Hi Hannes!
>>
>> I also followed the instructions on diagram partitioning
>> but usecase 2!
>>
>> Rarely I got that circle, too. The cause was that either
>> the wrong editor was loaded on double-click or the editor
>> was out of date. (The circle indicates an element which
>> can't be displayed because the editor has no graphical
>> representation for it.)
>>
>> Maybe that helps a bit...
>>
>> Nicolai
>>
>>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHGNP9IYVWjMSpDwwRAmjXAKDnigjP+bLKRj8IKt4WIDsbdOpYDACf dZVH
dd+rZedHQgBwdBbfdDEdtqg=
=fuaK
-----END PGP SIGNATURE-----
Re: diagram partitioning / double click function doesnt work [message #156555 is a reply to message #156389] Fri, 19 October 2007 21:14 Go to previous messageGo to next message
Nicolai Kamenzky is currently offline Nicolai KamenzkyFriend
Messages: 82
Registered: July 2009
Member
> but i dont get how the editor could not be loaded when i follow
> usecase 1 cause this means using the same editor twice...
I think it doesn't work because you chose an invalid EClass
topartition the diagram. Could you make your metamodel available
and tell me which EClass you chose. Maybe I can make a
suggestion then.
> for usecase 2 i had the same problem and here someone may tell me
> how i can check which editor is loaded and which one does the job
> of the "main" editor (cause sometimes they were changed).
It all depends on the OpenDiagramBehaviour which you add to a
figure in the main editor. If you double-click the figure
theOpenDiagramBehaviour is invoked and the other editor is opened.

If you are interested you can analyze my prototype which
appliesusecase 2 of the diagram partitioning cookbook.

You can access my repository at:
<https://forge.spline.inf.fu-berlin.de/svn/swte>

Checkout Editors/DiagramPartitioningPrototype and read the
README.

If you want no clutter check out Revision 461 which is
dubbed "V1". This is the state of the prototype where I
just applied usecase 2.

In revision 559 ("V2") I have also applied a shared Editing
Domain but its still buggy.

Cheers,
Nicolai


--

I'm using an evaluation license of nemo since 47 days.
You should really try it!
http://www.malcom-mac.com/nemo
Re: diagram partitioning / double click function doesnt work [message #156887 is a reply to message #156555] Wed, 24 October 2007 09:05 Go to previous messageGo to next message
Johannes Gross is currently offline Johannes GrossFriend
Messages: 28
Registered: July 2009
Junior Member
dear nicolai thanks alot for sharing your repostitory so i could get how
to do the partitioning.

i created a cheat sheet based on usecase 2 and will provide this when
its checked by my colleagues....





Nicolai Kamenzky schrieb:
>> but i dont get how the editor could not be loaded when i follow
>> usecase 1 cause this means using the same editor twice...
> I think it doesn't work because you chose an invalid EClass
> topartition the diagram. Could you make your metamodel available
> and tell me which EClass you chose. Maybe I can make a
> suggestion then.
>> for usecase 2 i had the same problem and here someone may tell me
>> how i can check which editor is loaded and which one does the job
>> of the "main" editor (cause sometimes they were changed).
> It all depends on the OpenDiagramBehaviour which you add to a
> figure in the main editor. If you double-click the figure
> theOpenDiagramBehaviour is invoked and the other editor is opened.
>
> If you are interested you can analyze my prototype which
> appliesusecase 2 of the diagram partitioning cookbook.
>
> You can access my repository at:
> <https://forge.spline.inf.fu-berlin.de/svn/swte>
>
> Checkout Editors/DiagramPartitioningPrototype and read the
> README.
>
> If you want no clutter check out Revision 461 which is
> dubbed "V1". This is the state of the prototype where I
> just applied usecase 2.
>
> In revision 559 ("V2") I have also applied a shared Editing
> Domain but its still buggy.
>
> Cheers,
> Nicolai
>
>
Re: diagram partitioning / double click function doesnt work [message #156943 is a reply to message #156887] Wed, 24 October 2007 11:52 Go to previous messageGo to next message
Nicolai Kamenzky is currently offline Nicolai KamenzkyFriend
Messages: 82
Registered: July 2009
Member
> i created a cheat sheet based on usecase 2 and will provide this
> when its checked by my colleagues....
That's awesome!

If get some time, I will add some useful info on the new wiki
page as well.

For the meantime, everyone may access my repository.

Cheers,
Nicolai


--

I'm using an evaluation license of nemo since 51 days.
You should really try it!
http://www.malcom-mac.com/nemo
Re: diagram partitioning / double click function doesnt work [message #158259 is a reply to message #156943] Mon, 05 November 2007 10:09 Go to previous messageGo to next message
Johannes Gross is currently offline Johannes GrossFriend
Messages: 28
Registered: July 2009
Junior Member
This is a multi-part message in MIME format.
--------------020708020203060806070204
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

dear nicolai / all,

heres my cheat sheet for diagram partitioning. i checked it several
times but since it contains quite much steps there may still remain some
unobviousities :).

if somebody improves it let me know the changes so we can post a
consistent version on the wiki page...


greez from southern germany...

hannes

--------------020708020203060806070204
Content-Type: text/xml;
name="CheatSheetDiagramPartitioning.xml"
Content-Transfer-Encoding: 8bit
Content-Disposition: inline;
filename="CheatSheetDiagramPartitioning.xml"

<?xml version="1.0" encoding="UTF-8"?>
<cheatsheet title="Diagram Partitioning">
<intro>
<description>
This cheat sheet may help you to make an diagram which is layered. Clicking on the &quot;partitioning element&quot; will open an editor with the particular toolbar entries for this element. It may help you to structure your information / model. To do the CheatSheet it may help you to have basic knowledge in editing ecore diagrams and working with EMF/GMF. But don´t hesitate just try...
</description>
</intro>
<item title="Ecore Model" dialog="true" skip="false">
<description>
We will do a partitioned Diagram from one ecore model. So at first we build a very basic ecore model.
Create a new ecore file and leave the blank name My.ecore.
</description>
<command serialization=" org.eclipse.ui.newWizard(newWizardId=org.eclipse.emf.ecore.p resentation.EcoreModelWizardID) " confirm="false">
</command>
</item>
<item title="Define Ecore" dialog="true" skip="false">
<description>
Now add three classes to your file. The first we call &quot;ModelBase&quot;, the second &quot;TopClass&quot; and the third one &quot;SubClass&quot;. Link the classes that ModelBase contains TopClass and name it &quot;aggregation&quot;. Link equally that TopClass contains SubClass and name it &quot;contain&quot;.
</description>
<subitem label="Click on your package element and define the properties &quot;Name&quot;, &quot;Ns Prefix&quot; and &quot;Ns URI&quot; with values of your own choice." skip="false">
</subitem>
</item>
<item title="Use Dashboard" dialog="true" skip="false">
<description>
To create the required Models you may use the GMF Dashboard. Go to Window -&gt; Show View -&gt; Other and find it in folder General. Now load the My.ecore as Domain Model.
</description>
</item>
<item title="Create Gen Model" dialog="true" skip="false">
<description>
Derive from your validated My.ecore the genmodel in the GMF Dashboard. Open it and generate the model and the edit code (right-click the toplevel node to do so).
</description>
</item>
<item title="Create TopModel" dialog="true" skip="false">
<description>
Derive a pair of .gmfgraph and .gmftool from your My.ecore, selecting your ModelBase element as diagram root. Combine them to a My.gmfmap and choose again ModelBase as diagram root. In each wizard leave all checkboxes with default value.
</description>
<subitem label="To make the My.gmfmap ready for stage we have to make some changes in the generated file. Open it and check the &quot;Tool&quot; and &quot;Diagram Node&quot; entries of all Node Mappings. Delete possibly existing Link mappings." skip="false">
</subitem>
</item>
<item title="Generate TopModel" dialog="true" skip="true">
<description>
Create the generator model for the super-mapping and open it with the GMFGen editor. Select the first sub-node called &quot;Gen Plugin&quot; node under &quot;Gen Editor Generator&quot;. Set as ID &quot;partitionsuper.diagram&quot; and as Name &quot;My SuperPlugin&quot; in the properties view.
</description>
</item>
<item title="Create SubModel My1" dialog="true" skip="false">
<description>
To get the dashboard cleared it helps to select another project in the package explorer (e.g. the one with your edit code). Derive a pair of .gmfgraph and .gmftool from your My.ecore, selecting your TopClass element as diagram root. Name them My1.gmfgraph and My1.gmftool. Combine them to a My1.gmfmap and select again your TopClass element as root.
</description>
<subitem label="Again we have to make some changes in the .gmfmap file. Open it and check the &quot;Tool&quot; and &quot;Diagram Node&quot; entries of all Node Mappings. Delete possibly existing Link mappings." skip="false">
</subitem>
</item>
<item title="Generator Model My1" dialog="true" skip="false">
<description>
Create the generator model for the sub-mapping and open it with the GMFGen editor. Select the first sub-node called &quot;Gen Editor Generator&quot;. Set your preferred diagram and domain file extensions.
Important: Make sure the &quot;Model ID&quot; property has a unique value, i.e. different from the one for the super-mapping. Set it to &quot;Mysub&quot; and save changes.
</description>
<subitem label="Select the &quot;Gen Editor View&quot; node and change the Class Name property to &quot;My1DiagramEditor&quot;. This will prevent the wrong editor being opened." skip="false">
</subitem>
</item>
<item title="Dublicate .genmodel" dialog="true" skip="false">
<description>
Copy your My.genmodel and paste it with the name My1.genmodel. Set the &quot;Model Name&quot; property to &quot;My1&quot;, save the file and generate again model and edit code.
</description>
</item>
<item title="Load Ressource" dialog="true" skip="false">
<description>
Go back to the My.gmfmap and select the node &quot;Mapping&quot;. Right-click and select &quot;Load Resource...&quot;. Browse your workspace to locate your My1.gmfmap file and load it to this file.
</description>
</item>
<item title="Link .gmfmap files" dialog="true" skip="false">
<description>
Now select the node mapping TopClass of My.gmfmap. In the properties view there is a &quot;Misc&quot; section having a property called &quot;Related Diagrams&quot;.When activated it opens a dialog where you can select from 2 &quot;Canvas Mapping&quot; choices. Just try selecting the second choice and save.
</description>
<subitem label="To make sure you selected the right Canvas open the super-mapping My.gmfmap in a text editor. There should be a new tag &quot;relatedDiagrams&quot; referencing your sub-mappings diagram node (in this case: href=&quot;My1.gmfmap#//@diagram&quot;)" skip="false">
</subitem>
</item>
<item title="Regenerate My.gmfgen" dialog="true" skip="false">
<description>
Create the generator model for the super-mapping and open it with the GMFGen editor. Select the first sub-node called &quot;Gen Editor Generator&quot;. Set your preferred diagram and domain file extensions to the same values as in the sub-mappings My1.gmfgen. Important: Make sure the &quot;Model ID&quot; property has a unique value, i.e. different from the one for the sub-mapping.
</description>
</item>
<item title="Set OpenDiagramBehaviour" dialog="true" skip="false">
<description>
Open the My.gmfgen. Locate the &quot;Gen Top Level Node TopClassEditPart&quot; (under &quot;Gen Diagram&quot;). Go to the OpenDiagramBehaviour element. For the &quot;Diagram Kind&quot; property fill in the name &quot;Mysub&quot;. For the &quot;Editor ID&quot; property you have to look up the value in the sub-mappings My1.gmfgen. It&apos;s the &quot;ID&quot; property under &quot;Gen Editor Generator&quot;-&gt;&quot;Gen Editor View&quot;. Copy it and paste it to the My.gmfgen.
</description>
<subitem label="So both values you usually have to look up in the sub-.gmfgen file. Its written in the &quot;blank&quot; fields where you find the values." skip="true">
</subitem>
</item>
<item title="Generate Code" dialog="true" skip="false">
<description>
If all goes well you can now generate two plugins with code for the super-mapping and the sub-mapping. Right-click My.gmfgen and select Generate Diagram Code. Do the same with My1.gmfgen.
</description>
</item>
<item title="Run Editor" dialog="true" skip="false">
<description>
In the Run dialog create a new Eclipse Application. Select the Plugin layer in the runtime config. Check all projects you built and add the required plugins. Run the editor.
</description>
<command serialization="org.eclipse.debug.ui.commands.OpenRunConfigurations " confirm="false">
</command>
</item>
<item title="Further" dialog="true" skip="false">
<description>
Create a new project, right-click it an select New -&gt; Example -&gt; My Diagram. Add a TopClass Node to the canvas.
The diagram should now open when double-clicking this node. This cheat sheet has been created basing on a cookbook by Norbert Schöpke found under http://wiki.eclipse.org/Diagram_Partitioning for your own, more elaborated approaches you may use this as guide.
</description>
</item>
</cheatsheet>

--------------020708020203060806070204--
Re: diagram partitioning / double click function doesnt work [message #158290 is a reply to message #158259] Mon, 05 November 2007 11:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: trommas.yahoo.com

It looks great!

I will report if I find any possibilities for improvement.

Also, I hope diagram partitioning becomes much easier in future versions
of gmf (while I'm at it: I really hope the Graphics department gets
enhanced - shared editing domain becomes easier/less buggy - and that
the wizards continue to evolve. IMHO the graph, tool and map wizard
could be combined)

Thanks again :)


Tomas Zijdemans


J. Groß wrote:
> dear nicolai / all,
>
> heres my cheat sheet for diagram partitioning. i checked it several
> times but since it contains quite much steps there may still remain some
> unobviousities :).
>
> if somebody improves it let me know the changes so we can post a
> consistent version on the wiki page...
>
>
> greez from southern germany...
>
> hannes
>
Re: diagram partitioning / double click function doesnt work [message #159714 is a reply to message #158259] Mon, 12 November 2007 14:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: trommas.yahoo.com

In step 10, the user is asked to duplicate the genmodel file. Shouldn't
the user, in addition, set the "Domain Gen Model" of sub.gmfgen to the
new genmodel?

Also, my property view disappeared after trying it.. Any ideas?

Best Regards,

Tomas Zijdemans


J. Groß wrote:
> dear nicolai / all,
>
> heres my cheat sheet for diagram partitioning. i checked it several
> times but since it contains quite much steps there may still remain some
> unobviousities :).
>
> if somebody improves it let me know the changes so we can post a
> consistent version on the wiki page...
>
>
> greez from southern germany...
>
> hannes
>
Re: diagram partitioning / double click function doesnt work [message #160975 is a reply to message #158259] Fri, 16 November 2007 14:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: andreas.behnke1.gmx.de

Hi Hannes,

Thank you very much for your great work. I'm new to the partitioning
topic, so instead of searching 100 threads I just tried your Cheat Sheet.
Just my 2 cents:

- Shouldn't the creation of an empty (EMF?) project be in the very first
step?
- The aggregations should be described more precise ( 0 to many etc.)
Perhapse provide an ecore file?
- explain which diagram will hold nodes of which type

I had no problems creating a partitioning example!

Thanks,
Andreas


J. Groß schrieb:
> dear nicolai / all,
>
> heres my cheat sheet for diagram partitioning. i checked it several
> times but since it contains quite much steps there may still remain some
> unobviousities :).
>
> if somebody improves it let me know the changes so we can post a
> consistent version on the wiki page...
>
>
> greez from southern germany...
>
> hannes
>
Re: diagram partitioning / double click function doesnt work [message #161124 is a reply to message #159714] Sun, 18 November 2007 20:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: andreas.behnke1.gmx.de

Hi,

what is the reason of duplicating the genmodel? Why should the sub
diagram use another domain model?

Tomas Zijdemans schrieb:
> In step 10, the user is asked to duplicate the genmodel file. Shouldn't
> the user, in addition, set the "Domain Gen Model" of sub.gmfgen to the
> new genmodel?
>
> Also, my property view disappeared after trying it.. Any ideas?
>
> Best Regards,
>
> Tomas Zijdemans
>
> am
> J. Groß wrote:
>> dear nicolai / all,
>>
>> heres my cheat sheet for diagram partitioning. i checked it several
>> times but since it contains quite much steps there may still remain
>> some unobviousities :).
>>
>> if somebody improves it let me know the changes so we can post a
>> consistent version on the wiki page...
>>
>>
>> greez from southern germany...
>>
>> hannes
>>
Re: diagram partitioning / double click function doesnt work [message #161132 is a reply to message #161124] Sun, 18 November 2007 21:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: trommas.yahoo.com

This is discussed earlier. It is a workaround for a prefix problem.


Regrads,

Tomas Zijdemans


Andreas Behnke wrote:
> Hi,
>
> what is the reason of duplicating the genmodel? Why should the sub
> diagram use another domain model?
>
> Tomas Zijdemans schrieb:
>> In step 10, the user is asked to duplicate the genmodel file.
>> Shouldn't the user, in addition, set the "Domain Gen Model" of
>> sub.gmfgen to the new genmodel?
>>
>> Also, my property view disappeared after trying it.. Any ideas?
>>
>> Best Regards,
>>
>> Tomas Zijdemans
>>
>> am
>> J. Groß wrote:
>>> dear nicolai / all,
>>>
>>> heres my cheat sheet for diagram partitioning. i checked it several
>>> times but since it contains quite much steps there may still remain
>>> some unobviousities :).
>>>
>>> if somebody improves it let me know the changes so we can post a
>>> consistent version on the wiki page...
>>>
>>>
>>> greez from southern germany...
>>>
>>> hannes
>>>
Re: diagram partitioning / double click function doesnt work [message #162060 is a reply to message #160975] Thu, 22 November 2007 12:15 Go to previous messageGo to next message
Johannes Gross is currently offline Johannes GrossFriend
Messages: 28
Registered: July 2009
Junior Member
This is a multi-part message in MIME format.
--------------040708050508060506000609
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

dear all

this is the updated version of cheatsheet..



andreas -> thx for your comments i implemented them...

tomas -> i beg your right but i cant select the "right" Domain Gen Model
/dont know why -> and it worked anyways



best regards

--------------040708050508060506000609
Content-Type: text/xml;
name="CheatSheetDiagramPartitioning.xml"
Content-Transfer-Encoding: 8bit
Content-Disposition: inline;
filename="CheatSheetDiagramPartitioning.xml"

<?xml version="1.0" encoding="UTF-8"?>
<cheatsheet title="Diagram Partitioning">
<intro>
<description>
This cheat sheet may help you to make an diagram which is layered. Clicking on the &quot;partitioning element&quot; will open an editor with the particular toolbar entries for this element. In the &quot;top-diagram&quot; you will be able to instanciate TopClass. Double-clicking on it will open the &quot;sub-diagram&quot; where you will be able to instanciate &quot;sub-class&quot;. It may help you to structure your information / model. To do the CheatSheet it may help you to have basic knowledge in editing ecore diagrams and working with EMF/GMF. But don´t hesitate just try...
</description>
</intro>
<item title="Create EMF Project" dialog="true" skip="false">
<description>
At first we have to create an empty EMF project with a fancy name of your choice.
</description>
<command serialization=" org.eclipse.ui.newWizard(newWizardId=org.eclipse.emf.codegen .ecore.ui.EmptyProjectWizard) " confirm="false">
</command>
</item>
<item title="Ecore Model" dialog="true" skip="true">
<description>
We will do a partitioned Diagram from one ecore model. You may download it here http://www.isd.uni-stuttgart.de/~hertkorn/eclipse/My.ecore , or do it on your own: Create a new ecore file and leave the blank name My.ecore.
</description>
<command serialization=" org.eclipse.ui.newWizard(newWizardId=org.eclipse.emf.ecore.p resentation.EcoreModelWizardID) " confirm="false">
</command>
</item>
<item title="Define Ecore" dialog="true" skip="false">
<description>
Now add three classes to your file. The first we call &quot;ModelBase&quot;, the second &quot;TopClass&quot; and the third one &quot;SubClass&quot;. Link the classes that ModelBase contains TopClass and name it &quot;aggregation&quot;. Set its upper bound to &quot;-1&quot; (in this way you express many). Link equally that TopClass contains SubClass, name it &quot;contain&quot; and set its upper bound to &quot;-1&quot;.
</description>
<subitem label="Click on your package element and define the properties &quot;Name&quot;, &quot;Ns Prefix&quot; and &quot;Ns URI&quot; with values of your own choice." skip="true">
</subitem>
</item>
<item title="Use Dashboard" dialog="true" skip="false">
<description>
To create the required Models you may use the GMF Dashboard. Go to Window -&gt; Show View -&gt; Other and find it in folder General. Now load the My.ecore as Domain Model.
</description>
</item>
<item title="Create Gen Model" dialog="true" skip="false">
<description>
Derive from your validated My.ecore the genmodel in the GMF Dashboard. Open it and generate the model and the edit code (right-click the toplevel node to do so).
</description>
</item>
<item title="Create TopModel" dialog="true" skip="false">
<description>
Derive a pair of .gmfgraph and .gmftool from your My.ecore, selecting your ModelBase element as diagram root. Combine them to a My.gmfmap and choose again ModelBase as diagram root. In each wizard leave all checkboxes with default value.
</description>
<subitem label="To make the My.gmfmap ready for stage we have to make some changes in the generated file. Open it and check the &quot;Tool&quot; and &quot;Diagram Node&quot; entries of all Node Mappings. Delete possibly existing Link mappings." skip="false">
</subitem>
</item>
<item title="Generate TopModel" dialog="true" skip="true">
<description>
Create the generator model for the super-mapping and open it with the GMFGen editor. Select the first sub-node called &quot;Gen Plugin&quot; node under &quot;Gen Editor Generator&quot;. Set as ID &quot;partitionsuper.diagram&quot; and as Name &quot;My SuperPlugin&quot; in the properties view.
</description>
</item>
<item title="Create SubModel My1" dialog="true" skip="false">
<description>
To get the dashboard cleared it helps to select another project in the package explorer (e.g. the one with your edit code). Derive a pair of .gmfgraph and .gmftool from your My.ecore, selecting your TopClass element as diagram root. Name them My1.gmfgraph and My1.gmftool. Combine them to a My1.gmfmap and select again your TopClass element as root.
</description>
<subitem label="Again we have to make some changes in the .gmfmap file. Open it and check the &quot;Tool&quot; and &quot;Diagram Node&quot; entries of all Node Mappings. Delete possibly existing Link mappings." skip="false">
</subitem>
</item>
<item title="Generator Model My1" dialog="true" skip="false">
<description>
Create the generator model for the sub-mapping and open it with the GMFGen editor. Select the first sub-node called &quot;Gen Editor Generator&quot;. Set your preferred diagram and domain file extensions.
Important: Make sure the &quot;Model ID&quot; property has a unique value, i.e. different from the one for the super-mapping. Set it to &quot;Mysub&quot; and save changes.
</description>
<subitem label="Select the &quot;Gen Editor View&quot; node and change the Class Name property to &quot;My1DiagramEditor&quot;. This will prevent the wrong editor being opened." skip="false">
</subitem>
</item>
<item title="Dublicate .genmodel" dialog="true" skip="false">
<description>
Copy your My.genmodel and paste it with the name My1.genmodel. Set the &quot;Model Name&quot; property to &quot;My1&quot;, save the file and generate again model and edit code.
</description>
</item>
<item title="Load Ressource" dialog="true" skip="false">
<description>
Go back to the My.gmfmap and select the node &quot;Mapping&quot;. Right-click and select &quot;Load Resource...&quot;. Browse your workspace to locate your My1.gmfmap file and load it to this file.
</description>
</item>
<item title="Link .gmfmap files" dialog="true" skip="false">
<description>
Now select the node mapping TopClass of My.gmfmap. In the properties view there is a &quot;Misc&quot; section having a property called &quot;Related Diagrams&quot;.When activated it opens a dialog where you can select from 2 &quot;Canvas Mapping&quot; choices. Just try selecting the second choice and save.
</description>
<subitem label="To make sure you selected the right Canvas open the super-mapping My.gmfmap in a text editor. There should be a new tag &quot;relatedDiagrams&quot; referencing your sub-mappings diagram node (in this case: href=&quot;My1.gmfmap#//@diagram&quot;)" skip="false">
</subitem>
</item>
<item title="Regenerate My.gmfgen" dialog="true" skip="false">
<description>
Create the generator model for the super-mapping and open it with the GMFGen editor. Select the first sub-node called &quot;Gen Editor Generator&quot;. Set your preferred diagram and domain file extensions to the same values as in the sub-mappings My1.gmfgen. Important: Make sure the &quot;Model ID&quot; property has a unique value, i.e. different from the one for the sub-mapping.
</description>
</item>
<item title="Set OpenDiagramBehaviour" dialog="true" skip="false">
<description>
Open the My.gmfgen. Locate the &quot;Gen Top Level Node TopClassEditPart&quot; (under &quot;Gen Diagram&quot;). Go to the OpenDiagramBehaviour element. For the &quot;Diagram Kind&quot; property fill in the name &quot;Mysub&quot;. For the &quot;Editor ID&quot; property you have to look up the value in the sub-mappings My1.gmfgen. It&apos;s the &quot;ID&quot; property under &quot;Gen Editor Generator&quot;-&gt;&quot;Gen Editor View&quot;. Copy it and paste it to the My.gmfgen.
</description>
<subitem label="So both values you usually have to look up in the sub-.gmfgen file. Its written in the &quot;blank&quot; fields where you find the values." skip="true">
</subitem>
</item>
<item title="Generate Code" dialog="true" skip="false">
<description>
If all goes well you can now generate two plugins with code for the super-mapping and the sub-mapping. Right-click My.gmfgen and select Generate Diagram Code. Do the same with My1.gmfgen.
</description>
</item>
<item title="Run Editor" dialog="true" skip="false">
<description>
In the Run dialog create a new Eclipse Application. Select the Plugin layer in the runtime config. Check all projects you built and add the required plugins. Run the editor.
</description>
<command serialization="org.eclipse.debug.ui.commands.OpenRunConfigurations " confirm="false">
</command>
</item>
<item title="Further" dialog="true" skip="false">
<description>
Create a new project, right-click it an select New -&gt; Example -&gt; My Diagram. Add a TopClass Node to the canvas.
The diagram should now open when double-clicking this node. This cheat sheet has been created basing on a cookbook by Norbert Schöpke found under http://wiki.eclipse.org/Diagram_Partitioning for your own, more elaborated approaches you may use this as guide.
</description>
</item>
</cheatsheet>

--------------040708050508060506000609--
Re: diagram partitioning / double click function doesnt work [message #162068 is a reply to message #162060] Thu, 22 November 2007 13:16 Go to previous message
Eclipse UserFriend
Originally posted by: trommas.yahoo.com

Great work! This should be included in GMF documentation (if it's not
already)

> tomas -> i beg your right but i cant select the "right" Domain Gen Model
> /dont know why -> and it worked anyways

Sorry, you lost me.. What do you mean?

I have som thoughts about the sheet:

Point 11 says:

"Duplicated .genmodel: ..., save the file and generate again model and
edit code."

- Is this necessary? (I don't do it and it works) If it is, it should
rather say: "right-click the new genmodel and generate model and edit code.

Also, I thought the point of duplicating the genmodel, was that the
subdiagram.gmfgen should use the dup rather then the original. I might
be wrong here, but loading the dup genmodel into the sub gmfgen - and
then set the property: "Editor -> Domain Gen Model" to the dup, seems to
work great for me.

Best Regards,

Tomas Zijdemans
Previous Topic:how to change the border item's direction?
Next Topic:Paint in FieldCompartment
Goto Forum:
  


Current Time: Thu Apr 25 04:26:28 GMT 2024

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

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

Back to the top