Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 Tools » Interface viewmap of Component Diagram
Interface viewmap of Component Diagram [message #475289] Mon, 11 August 2008 10:56 Go to next message
Niels Brouwers is currently offline Niels Brouwers
Messages: 67
Registered: July 2009
Member
Hi all,

as you might have guessed from me previous posts, I am trying to customize
an UML2 diagram generated by the UML2Tools to suit our needs. Are wish is
to add some elements to the element, which allows the user to add domain
specific elements to a standard UML2 structure diagram. Domain specific
elements actually are realized by applying a stereotype from our profile.

Currently, I have come this far that I have created my own diagram plugin
with a customized palette, preference page, property page etc etc. I have
based the diagram on the UML2 Component diagram. As such, it shows all the
elements of the Component diagram + plus some domain specific elements.
These elements are:
- customized component
- customized interface
- customized operation

Now, I would like to be able to add customized operations to a customized
interface. Unfortunately, adding operations to an interface is currently
not supported (UML2Tools RC4) by the component diagram. I have noticed
that it is possible to do this on the Class diagram. I suspect the biggest
problem is that the component diagram does not support the interface from
having a rectangular shape.

So, at this point I am trying to reverse engineer the way UML2 Class
diagram deal with interfaces and try to copy this to the customized
component diagram. To start simple, I have placed a node mapping in the
gmfmap model to realize a Rectangle shape figure Interface node when I
click on the customized interface on the palette. Later on, I would like
to make it exactly as implemented in the class diagram (dynamically
changeable between circle figure and rectangle figure by means of the
context menu).

Problem:
- when I try to place a rectangle figure on the diagram using the palette,
It is still showing a circle figure.
- how to implement the dynamically changeable context menu action in the
models?

In general, why are there separate structure diagrams such as component
and class diagrams? Why not making a general structure diagram?

Thank you for your answers!

Kind regards,
Niels Brouwers.



Kind regards,
Niels Brouwers.
Re: Interface viewmap of Component Diagram [message #475291 is a reply to message #475289] Thu, 14 August 2008 03:31 Go to previous message
Tatiana Fesenko is currently offline Tatiana Fesenko
Messages: 530
Registered: July 2009
Senior Member
Hi Niels,

There is a little trick in UML2Tools to treat elements that can change their
notation.
Interface is not the only example of such elements. UseCase, Actor, Class
elements can be shown using different notations. That's why we decided to
generate needed code. However, xPand templates don't have all needed information,
to provide tempaltes all required info, GMFGen metamodel was extended. We
use SubstitutableByAttributes to mark nodes in *.gmgen files that can take
alternative notation.

In order to allow the element to change its presentation
1) Open *.gmfgen file
2) Find GenNodes that will represents the element.
3) Expand first edit GenNode. Choose its child Viewmap. In the context menu
of Viewmap element choose 'New Child/Substitutable By Attributes'.
4) Select newly created SubstitutableBy Attributes. Open its properties view.
In 'SubstitutableByIDs' set VisualID of alternative notation.
5) Repeat with other GenNodes that will show the element in alternative notation.

6) Generate UML2Tools diagrams. All needed code, including code for actions,
will be generated.

InterfaceEditPart and Interface2EditPArt GenNodes from classDiagram.gmfgen
use 'SubstitutableByAttributes' to tag EditParts for Rectangle and Circle
Interfaces.

A bit more information can be found in my EclipseCon slides - http://www.eclipsecon.org/2008/sub/attachments/Bitter_GMF_or _How_We_did_UML_with_GMF.pdf

Best wishes,
Tanya.

> Hi all,
>
> as you might have guessed from me previous posts, I am trying to
> customize an UML2 diagram generated by the UML2Tools to suit our
> needs. Are wish is to add some elements to the element, which allows
> the user to add domain specific elements to a standard UML2 structure
> diagram. Domain specific elements actually are realized by applying a
> stereotype from our profile.
>
> Currently, I have come this far that I have created my own diagram
> plugin
> with a customized palette, preference page, property page etc etc. I
> have
> based the diagram on the UML2 Component diagram. As such, it shows all
> the
> elements of the Component diagram + plus some domain specific
> elements.
> These elements are:
> - customized component
> - customized interface
> - customized operation
> Now, I would like to be able to add customized operations to a
> customized interface. Unfortunately, adding operations to an interface
> is currently not supported (UML2Tools RC4) by the component diagram. I
> have noticed that it is possible to do this on the Class diagram. I
> suspect the biggest problem is that the component diagram does not
> support the interface from having a rectangular shape.
>
> So, at this point I am trying to reverse engineer the way UML2 Class
> diagram deal with interfaces and try to copy this to the customized
> component diagram. To start simple, I have placed a node mapping in
> the gmfmap model to realize a Rectangle shape figure Interface node
> when I click on the customized interface on the palette. Later on, I
> would like to make it exactly as implemented in the class diagram
> (dynamically changeable between circle figure and rectangle figure by
> means of the context menu).
>
> Problem:
> - when I try to place a rectangle figure on the diagram using the
> palette,
> It is still showing a circle figure.
> - how to implement the dynamically changeable context menu action in
> the
> models?
> In general, why are there separate structure diagrams such as
> component and class diagrams? Why not making a general structure
> diagram?
>
> Thank you for your answers!
>
> Kind regards,
> Niels Brouwers.
Re: Interface viewmap of Component Diagram [message #622603 is a reply to message #475289] Thu, 14 August 2008 03:31 Go to previous message
Tatiana Fesenko is currently offline Tatiana Fesenko
Messages: 530
Registered: July 2009
Senior Member
Hi Niels,

There is a little trick in UML2Tools to treat elements that can change their
notation.
Interface is not the only example of such elements. UseCase, Actor, Class
elements can be shown using different notations. That's why we decided to
generate needed code. However, xPand templates don't have all needed information,
to provide tempaltes all required info, GMFGen metamodel was extended. We
use SubstitutableByAttributes to mark nodes in *.gmgen files that can take
alternative notation.

In order to allow the element to change its presentation
1) Open *.gmfgen file
2) Find GenNodes that will represents the element.
3) Expand first edit GenNode. Choose its child Viewmap. In the context menu
of Viewmap element choose 'New Child/Substitutable By Attributes'.
4) Select newly created SubstitutableBy Attributes. Open its properties view.
In 'SubstitutableByIDs' set VisualID of alternative notation.
5) Repeat with other GenNodes that will show the element in alternative notation.

6) Generate UML2Tools diagrams. All needed code, including code for actions,
will be generated.

InterfaceEditPart and Interface2EditPArt GenNodes from classDiagram.gmfgen
use 'SubstitutableByAttributes' to tag EditParts for Rectangle and Circle
Interfaces.

A bit more information can be found in my EclipseCon slides - http://www.eclipsecon.org/2008/sub/attachments/Bitter_GMF_or _How_We_did_UML_with_GMF.pdf

Best wishes,
Tanya.

> Hi all,
>
> as you might have guessed from me previous posts, I am trying to
> customize an UML2 diagram generated by the UML2Tools to suit our
> needs. Are wish is to add some elements to the element, which allows
> the user to add domain specific elements to a standard UML2 structure
> diagram. Domain specific elements actually are realized by applying a
> stereotype from our profile.
>
> Currently, I have come this far that I have created my own diagram
> plugin
> with a customized palette, preference page, property page etc etc. I
> have
> based the diagram on the UML2 Component diagram. As such, it shows all
> the
> elements of the Component diagram + plus some domain specific
> elements.
> These elements are:
> - customized component
> - customized interface
> - customized operation
> Now, I would like to be able to add customized operations to a
> customized interface. Unfortunately, adding operations to an interface
> is currently not supported (UML2Tools RC4) by the component diagram. I
> have noticed that it is possible to do this on the Class diagram. I
> suspect the biggest problem is that the component diagram does not
> support the interface from having a rectangular shape.
>
> So, at this point I am trying to reverse engineer the way UML2 Class
> diagram deal with interfaces and try to copy this to the customized
> component diagram. To start simple, I have placed a node mapping in
> the gmfmap model to realize a Rectangle shape figure Interface node
> when I click on the customized interface on the palette. Later on, I
> would like to make it exactly as implemented in the class diagram
> (dynamically changeable between circle figure and rectangle figure by
> means of the context menu).
>
> Problem:
> - when I try to place a rectangle figure on the diagram using the
> palette,
> It is still showing a circle figure.
> - how to implement the dynamically changeable context menu action in
> the
> models?
> In general, why are there separate structure diagrams such as
> component and class diagrams? Why not making a general structure
> diagram?
>
> Thank you for your answers!
>
> Kind regards,
> Niels Brouwers.
Previous Topic:Interface viewmap of Component Diagram
Next Topic:Getting started
Goto Forum:
  


Current Time: Tue Jul 22 17:34:43 EDT 2014

Powered by FUDForum. Page generated in 0.01606 seconds