Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 Tools » How do I model the Package description in component diagram?
How do I model the Package description in component diagram? [message #476370] Tue, 07 April 2009 08:34 Go to next message
Ralf Heydenreich is currently offline Ralf HeydenreichFriend
Messages: 132
Registered: July 2009
Senior Member
Hi all,
I'm interested in GMF modeling and tried to model my own small editor.
In your UML2Tools Component diagram there is a Package symbol in the
upper left corner which holds the description of this diagram. Now I
want this to achieve in my own editor, but I don't know how to do this.
If I try to open the componentDiagram.gmfmap Eclipse complaints about
UML.ecore doesn't exist (despite I have installed the GMF SDK and all
files are there).
Can you please give me a hint how I can create the package symbol in the
upper left corner for every new diagram? Thanks in advance for your answer.

Greetings,
Ralf.
Re: How do I model the Package description in component diagram? [message #476372 is a reply to message #476370] Wed, 08 April 2009 15:56 Go to previous messageGo to next message
Tatiana Fesenko is currently offline Tatiana FesenkoFriend
Messages: 530
Registered: July 2009
Senior Member
Hello Ralf,

> If I try to open the componentDiagram.gmfmap Eclipse complaints about
> UML.ecore doesn't exist (despite I have installed the GMF SDK and all
> files are there).

Now we use the following configuration:
-Current sources of UML2Tools from CVS;
-Most dependencies(Eclipse SDK, EMF Query, EMF transaction, EMF validation,
GEF, GMF, UML2) -- Galileo M6 version,
OCL and QVT -- Galileo M5 version;
-You also have to check out several GMF plugins (use PSF from https://bugs.eclipse.org/bugs/attachment.cgi?id=131279).
The GMF plugins should be taken by state of 11th of February 2009;
-Make sure you have "org.eclipse.uml2.diagram.codegen" and "org.eclipse.uml2.diagram.codegen.edit"
plugins in your workspace.

For more information about how to generate UML2Tools reference http://wiki.eclipse.org/MDT-UML2Tools_How_To_Regenerage_Diag rams
page.

> Can you please give me a hint how I can create the package symbol in
> the
> upper left corner for every new diagram?

This is one of our 'know-how'. Open componentDiagram.gmfgen file, find GenTopLevelNode
Package2EditPart -- it represents the DiagramHeader, you will see Aux Secondary
Diagram Node element under it. This 'Aux Secondary Diagram Node' means that
the editpart should be shown as a diagram header. If you add such element
to the editpart in your *.gmfgen file and invoke 'Generate UML2Tools' action,
all the code needed to show header will be generated. You can find a little
bit more information on this topic at http://www.eclipsecon.org/2008/sub/attachments/Bitter_GMF_or _How_We_did_UML_with_GMF.pdf

Best wishes,
Tanya.
Re: How do I model the Package description in component diagram? [message #476373 is a reply to message #476372] Thu, 09 April 2009 08:46 Go to previous messageGo to next message
Ralf Heydenreich is currently offline Ralf HeydenreichFriend
Messages: 132
Registered: July 2009
Senior Member
Tatiana Fesenko schrieb:
> Hello Ralf,
>
>> If I try to open the componentDiagram.gmfmap Eclipse complaints about
>> UML.ecore doesn't exist (despite I have installed the GMF SDK and all
>> files are there).
>
> Now we use the following configuration:
> -Current sources of UML2Tools from CVS;
> -Most dependencies(Eclipse SDK, EMF Query, EMF transaction, EMF
> validation, GEF, GMF, UML2) -- Galileo M6 version,
> OCL and QVT -- Galileo M5 version;
> -You also have to check out several GMF plugins (use PSF from
> https://bugs.eclipse.org/bugs/attachment.cgi?id=131279). The GMF plugins
> should be taken by state of 11th of February 2009;
> -Make sure you have "org.eclipse.uml2.diagram.codegen" and
> "org.eclipse.uml2.diagram.codegen.edit" plugins in your workspace.
>
> For more information about how to generate UML2Tools reference
> http://wiki.eclipse.org/MDT-UML2Tools_How_To_Regenerage_Diag rams page.
>
>> Can you please give me a hint how I can create the package symbol in
>> the
>> upper left corner for every new diagram?
>
> This is one of our 'know-how'. Open componentDiagram.gmfgen file, find
> GenTopLevelNode Package2EditPart -- it represents the DiagramHeader, you
> will see Aux Secondary Diagram Node element under it. This 'Aux
> Secondary Diagram Node' means that the editpart should be shown as a
> diagram header. If you add such element to the editpart in your *.gmfgen
> file and invoke 'Generate UML2Tools' action, all the code needed to show
> header will be generated. You can find a little bit more information on
> this topic at
> http://www.eclipsecon.org/2008/sub/attachments/Bitter_GMF_or _How_We_did_UML_with_GMF.pdf
>
>
> Best wishes,
> Tanya.
>
>

Thanks for your answer, I will try it. Package2EditPart was one of the
classes I inspected. What is not clearly at the moment: how can I
achieve that the figure is displayed initially at opening the diagram?

Greetings,
Ralf.
Re: How do I model the Package description in component diagram? [message #476374 is a reply to message #476373] Thu, 09 April 2009 09:56 Go to previous message
Tatiana Fesenko is currently offline Tatiana FesenkoFriend
Messages: 530
Registered: July 2009
Senior Member
Hi Ralf,

In order to add such header to your own diagram you have to:
1) Create a mapping in your *.gmfmap file. It should look like TopNodeReference
<Package/SecondaryPackageNode> in componentDiagram.gmfmap.
2) Add "Aux Secondary Diagram Node" child to the appropriate TopLevelNode
in *.gmfgen file.
3) Generate code using 'Generate UML2Tools diagrams' action.

How it works?
DiagramHeader is almost a usual GraphicalEditPart. It's EditPart because
it has its graphical presentation on the diagram and it references an element
from domain model. That's why you have to create a mapping in *.gmfmap file.
On the other hand, it has unusual behavior -- it is always displayed on the
diagram, it represents the element of the diagram one more time, its position
is always fixed, it cannot be selected and so on. It is achived by changes
in VisualIDRegistry, DiagramUpdater, ViewFactory and NodeEditPart. As UML2Tools
has such DiagramHeader in many diagram editors, we decided to generate all
required code. We decided to mark such nodes with "Aux Secondary Diagram
Node" element. We also extended xPand templates in order to generate proper
VisualIdRegistry, DiagramUpdater, ViewFactory and EditPart. If you are interested
in details of implementation you can take a look at DiagramHeader.qvto file
from org.eclipse.uml2.diagram.def/dynamic-templates and search for references
of 'isDiagramHeader' operation.

I hope it made thing clear,
Tanya.

> Tatiana Fesenko schrieb:
>
>> Hello Ralf,
>>
>>> If I try to open the componentDiagram.gmfmap Eclipse complaints
>>> about UML.ecore doesn't exist (despite I have installed the GMF SDK
>>> and all files are there).
>>>
>> Now we use the following configuration:
>> -Current sources of UML2Tools from CVS;
>> -Most dependencies(Eclipse SDK, EMF Query, EMF transaction, EMF
>> validation, GEF, GMF, UML2) -- Galileo M6 version,
>> OCL and QVT -- Galileo M5 version;
>> -You also have to check out several GMF plugins (use PSF from
>> https://bugs.eclipse.org/bugs/attachment.cgi?id=131279). The GMF
>> plugins
>> should be taken by state of 11th of February 2009;
>> -Make sure you have "org.eclipse.uml2.diagram.codegen" and
>> "org.eclipse.uml2.diagram.codegen.edit" plugins in your workspace.
>> For more information about how to generate UML2Tools reference
>> http://wiki.eclipse.org/MDT-UML2Tools_How_To_Regenerage_Diag rams
>> page.
>>
>>> Can you please give me a hint how I can create the package symbol in
>>> the
>>> upper left corner for every new diagram?
>> This is one of our 'know-how'. Open componentDiagram.gmfgen file,
>> find GenTopLevelNode Package2EditPart -- it represents the
>> DiagramHeader, you will see Aux Secondary Diagram Node element under
>> it. This 'Aux Secondary Diagram Node' means that the editpart should
>> be shown as a diagram header. If you add such element to the editpart
>> in your *.gmfgen file and invoke 'Generate UML2Tools' action, all the
>> code needed to show header will be generated. You can find a little
>> bit more information on this topic at
>> http://www.eclipsecon.org/2008/sub/attachments/Bitter_GMF_or _How_We_d
>> id_UML_with_GMF.pdf
>>
>> Best wishes,
>> Tanya.
> Thanks for your answer, I will try it. Package2EditPart was one of the
> classes I inspected. What is not clearly at the moment: how can I
> achieve that the figure is displayed initially at opening the diagram?
>
> Greetings,
> Ralf.
Re: How do I model the Package description in component diagram? [message #623636 is a reply to message #476370] Wed, 08 April 2009 15:56 Go to previous message
Tatiana Fesenko is currently offline Tatiana FesenkoFriend
Messages: 530
Registered: July 2009
Senior Member
Hello Ralf,

> If I try to open the componentDiagram.gmfmap Eclipse complaints about
> UML.ecore doesn't exist (despite I have installed the GMF SDK and all
> files are there).

Now we use the following configuration:
-Current sources of UML2Tools from CVS;
-Most dependencies(Eclipse SDK, EMF Query, EMF transaction, EMF validation,
GEF, GMF, UML2) -- Galileo M6 version,
OCL and QVT -- Galileo M5 version;
-You also have to check out several GMF plugins (use PSF from https://bugs.eclipse.org/bugs/attachment.cgi?id=131279).
The GMF plugins should be taken by state of 11th of February 2009;
-Make sure you have "org.eclipse.uml2.diagram.codegen" and "org.eclipse.uml2.diagram.codegen.edit"
plugins in your workspace.

For more information about how to generate UML2Tools reference http://wiki.eclipse.org/MDT-UML2Tools_How_To_Regenerage_Diag rams
page.

> Can you please give me a hint how I can create the package symbol in
> the
> upper left corner for every new diagram?

This is one of our 'know-how'. Open componentDiagram.gmfgen file, find GenTopLevelNode
Package2EditPart -- it represents the DiagramHeader, you will see Aux Secondary
Diagram Node element under it. This 'Aux Secondary Diagram Node' means that
the editpart should be shown as a diagram header. If you add such element
to the editpart in your *.gmfgen file and invoke 'Generate UML2Tools' action,
all the code needed to show header will be generated. You can find a little
bit more information on this topic at http://www.eclipsecon.org/2008/sub/attachments/Bitter_GMF_or _How_We_did_UML_with_GMF.pdf

Best wishes,
Tanya.
Re: How do I model the Package description in component diagram? [message #623637 is a reply to message #476372] Thu, 09 April 2009 08:46 Go to previous message
Ralf Heydenreich is currently offline Ralf HeydenreichFriend
Messages: 132
Registered: July 2009
Senior Member
Tatiana Fesenko schrieb:
> Hello Ralf,
>
>> If I try to open the componentDiagram.gmfmap Eclipse complaints about
>> UML.ecore doesn't exist (despite I have installed the GMF SDK and all
>> files are there).
>
> Now we use the following configuration:
> -Current sources of UML2Tools from CVS;
> -Most dependencies(Eclipse SDK, EMF Query, EMF transaction, EMF
> validation, GEF, GMF, UML2) -- Galileo M6 version,
> OCL and QVT -- Galileo M5 version;
> -You also have to check out several GMF plugins (use PSF from
> https://bugs.eclipse.org/bugs/attachment.cgi?id=131279). The GMF plugins
> should be taken by state of 11th of February 2009;
> -Make sure you have "org.eclipse.uml2.diagram.codegen" and
> "org.eclipse.uml2.diagram.codegen.edit" plugins in your workspace.
>
> For more information about how to generate UML2Tools reference
> http://wiki.eclipse.org/MDT-UML2Tools_How_To_Regenerage_Diag rams page.
>
>> Can you please give me a hint how I can create the package symbol in
>> the
>> upper left corner for every new diagram?
>
> This is one of our 'know-how'. Open componentDiagram.gmfgen file, find
> GenTopLevelNode Package2EditPart -- it represents the DiagramHeader, you
> will see Aux Secondary Diagram Node element under it. This 'Aux
> Secondary Diagram Node' means that the editpart should be shown as a
> diagram header. If you add such element to the editpart in your *.gmfgen
> file and invoke 'Generate UML2Tools' action, all the code needed to show
> header will be generated. You can find a little bit more information on
> this topic at
> http://www.eclipsecon.org/2008/sub/attachments/Bitter_GMF_or _How_We_did_UML_with_GMF.pdf
>
>
> Best wishes,
> Tanya.
>
>

Thanks for your answer, I will try it. Package2EditPart was one of the
classes I inspected. What is not clearly at the moment: how can I
achieve that the figure is displayed initially at opening the diagram?

Greetings,
Ralf.
Re: How do I model the Package description in component diagram? [message #623638 is a reply to message #476373] Thu, 09 April 2009 09:56 Go to previous message
Tatiana Fesenko is currently offline Tatiana FesenkoFriend
Messages: 530
Registered: July 2009
Senior Member
Hi Ralf,

In order to add such header to your own diagram you have to:
1) Create a mapping in your *.gmfmap file. It should look like TopNodeReference
<Package/SecondaryPackageNode> in componentDiagram.gmfmap.
2) Add "Aux Secondary Diagram Node" child to the appropriate TopLevelNode
in *.gmfgen file.
3) Generate code using 'Generate UML2Tools diagrams' action.

How it works?
DiagramHeader is almost a usual GraphicalEditPart. It's EditPart because
it has its graphical presentation on the diagram and it references an element
from domain model. That's why you have to create a mapping in *.gmfmap file.
On the other hand, it has unusual behavior -- it is always displayed on the
diagram, it represents the element of the diagram one more time, its position
is always fixed, it cannot be selected and so on. It is achived by changes
in VisualIDRegistry, DiagramUpdater, ViewFactory and NodeEditPart. As UML2Tools
has such DiagramHeader in many diagram editors, we decided to generate all
required code. We decided to mark such nodes with "Aux Secondary Diagram
Node" element. We also extended xPand templates in order to generate proper
VisualIdRegistry, DiagramUpdater, ViewFactory and EditPart. If you are interested
in details of implementation you can take a look at DiagramHeader.qvto file
from org.eclipse.uml2.diagram.def/dynamic-templates and search for references
of 'isDiagramHeader' operation.

I hope it made thing clear,
Tanya.

> Tatiana Fesenko schrieb:
>
>> Hello Ralf,
>>
>>> If I try to open the componentDiagram.gmfmap Eclipse complaints
>>> about UML.ecore doesn't exist (despite I have installed the GMF SDK
>>> and all files are there).
>>>
>> Now we use the following configuration:
>> -Current sources of UML2Tools from CVS;
>> -Most dependencies(Eclipse SDK, EMF Query, EMF transaction, EMF
>> validation, GEF, GMF, UML2) -- Galileo M6 version,
>> OCL and QVT -- Galileo M5 version;
>> -You also have to check out several GMF plugins (use PSF from
>> https://bugs.eclipse.org/bugs/attachment.cgi?id=131279). The GMF
>> plugins
>> should be taken by state of 11th of February 2009;
>> -Make sure you have "org.eclipse.uml2.diagram.codegen" and
>> "org.eclipse.uml2.diagram.codegen.edit" plugins in your workspace.
>> For more information about how to generate UML2Tools reference
>> http://wiki.eclipse.org/MDT-UML2Tools_How_To_Regenerage_Diag rams
>> page.
>>
>>> Can you please give me a hint how I can create the package symbol in
>>> the
>>> upper left corner for every new diagram?
>> This is one of our 'know-how'. Open componentDiagram.gmfgen file,
>> find GenTopLevelNode Package2EditPart -- it represents the
>> DiagramHeader, you will see Aux Secondary Diagram Node element under
>> it. This 'Aux Secondary Diagram Node' means that the editpart should
>> be shown as a diagram header. If you add such element to the editpart
>> in your *.gmfgen file and invoke 'Generate UML2Tools' action, all the
>> code needed to show header will be generated. You can find a little
>> bit more information on this topic at
>> http://www.eclipsecon.org/2008/sub/attachments/Bitter_GMF_or _How_We_d
>> id_UML_with_GMF.pdf
>>
>> Best wishes,
>> Tanya.
> Thanks for your answer, I will try it. Package2EditPart was one of the
> classes I inspected. What is not clearly at the moment: how can I
> achieve that the figure is displayed initially at opening the diagram?
>
> Greetings,
> Ralf.
Previous Topic:Where to get the GMF configuration files of UMLTools?
Next Topic:Arrange All for Activity
Goto Forum:
  


Current Time: Wed Dec 17 20:02:20 GMT 2014

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

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