|
|
|
|
|
|
|
Re: diagram partitioning / double click function doesnt work [message #158259 is a reply to message #156943] |
Mon, 05 November 2007 10:09 |
Johannes Gross 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 "partitioning element" 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 "ModelBase", the second "TopClass" and the third one "SubClass". Link the classes that ModelBase contains TopClass and name it "aggregation". Link equally that TopClass contains SubClass and name it "contain".
</description>
<subitem label="Click on your package element and define the properties "Name", "Ns Prefix" and "Ns URI" 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 -> Show View -> 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 "Tool" and "Diagram Node" 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 "Gen Plugin" node under "Gen Editor Generator". Set as ID "partitionsuper.diagram" and as Name "My SuperPlugin" 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 "Tool" and "Diagram Node" 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 "Gen Editor Generator". Set your preferred diagram and domain file extensions.
Important: Make sure the "Model ID" property has a unique value, i.e. different from the one for the super-mapping. Set it to "Mysub" and save changes.
</description>
<subitem label="Select the "Gen Editor View" node and change the Class Name property to "My1DiagramEditor". 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 "Model Name" property to "My1", 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 "Mapping". Right-click and select "Load Resource...". 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 "Misc" section having a property called "Related Diagrams".When activated it opens a dialog where you can select from 2 "Canvas Mapping" 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 "relatedDiagrams" referencing your sub-mappings diagram node (in this case: href="My1.gmfmap#//@diagram")" 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 "Gen Editor Generator". Set your preferred diagram and domain file extensions to the same values as in the sub-mappings My1.gmfgen. Important: Make sure the "Model ID" 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 "Gen Top Level Node TopClassEditPart" (under "Gen Diagram"). Go to the OpenDiagramBehaviour element. For the "Diagram Kind" property fill in the name "Mysub". For the "Editor ID" property you have to look up the value in the sub-mappings My1.gmfgen. It's the "ID" property under "Gen Editor Generator"->"Gen Editor View". 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 "blank" 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 -> Example -> 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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Johannes Gross 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 "partitioning element" will open an editor with the particular toolbar entries for this element. In the "top-diagram" you will be able to instanciate TopClass. Double-clicking on it will open the "sub-diagram" where you will be able to instanciate "sub-class". 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 "ModelBase", the second "TopClass" and the third one "SubClass". Link the classes that ModelBase contains TopClass and name it "aggregation". Set its upper bound to "-1" (in this way you express many). Link equally that TopClass contains SubClass, name it "contain" and set its upper bound to "-1".
</description>
<subitem label="Click on your package element and define the properties "Name", "Ns Prefix" and "Ns URI" 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 -> Show View -> 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 "Tool" and "Diagram Node" 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 "Gen Plugin" node under "Gen Editor Generator". Set as ID "partitionsuper.diagram" and as Name "My SuperPlugin" 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 "Tool" and "Diagram Node" 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 "Gen Editor Generator". Set your preferred diagram and domain file extensions.
Important: Make sure the "Model ID" property has a unique value, i.e. different from the one for the super-mapping. Set it to "Mysub" and save changes.
</description>
<subitem label="Select the "Gen Editor View" node and change the Class Name property to "My1DiagramEditor". 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 "Model Name" property to "My1", 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 "Mapping". Right-click and select "Load Resource...". 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 "Misc" section having a property called "Related Diagrams".When activated it opens a dialog where you can select from 2 "Canvas Mapping" 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 "relatedDiagrams" referencing your sub-mappings diagram node (in this case: href="My1.gmfmap#//@diagram")" 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 "Gen Editor Generator". Set your preferred diagram and domain file extensions to the same values as in the sub-mappings My1.gmfgen. Important: Make sure the "Model ID" 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 "Gen Top Level Node TopClassEditPart" (under "Gen Diagram"). Go to the OpenDiagramBehaviour element. For the "Diagram Kind" property fill in the name "Mysub". For the "Editor ID" property you have to look up the value in the sub-mappings My1.gmfgen. It's the "ID" property under "Gen Editor Generator"->"Gen Editor View". 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 "blank" 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 -> Example -> 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 |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03623 seconds