Book a Demo

Author Topic: Stereotypes for alternate notations  (Read 3931 times)

Ralf

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Stereotypes for alternate notations
« on: October 24, 2009, 02:32:46 am »
Hi!

stereotypes are a nice feature. Alternate notations are also nice.
It often makes sense to use a component like an interface on different diagrams with different notations - once as detailed rectangle notation, once just as lillipop.
Now I would like to create a stereotype which is aware of these two states and draws different images.
A tag like the one in the manual (http://www.sparxsystems.com/uml_tool_guide/sdk_for_enterprise_architect/example_scripts.html) doesn't seem to be the right solution: the shape will change for all diagrams.
Is there some kind of special property I can query in the shape script?

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Stereotypes for alternate notations
« Reply #1 on: October 24, 2009, 09:48:23 am »
Quote
[size=18]...[/size]
Is there some kind of special property I can query in the shape script?
Hi Ralf,

you can use a combination of diagram.type, diagram.stereotype (if you stereotype your diagrams) diagram.mdg and diagram.name to target specific shapes to specific diagrams...

Works a treat for us...

HTH,
Paolo
« Last Edit: October 24, 2009, 09:55:03 am by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Ralf

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Re: Stereotypes for alternate notations
« Reply #2 on: October 26, 2009, 05:07:22 am »
Perfect! Even better than what I was looking for :-)

Thanx!
Ralf

Shawn Oberst

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Stereotypes for alternate notations
« Reply #3 on: October 27, 2009, 08:36:54 am »
How do you add Diagram Stereotypes.  I see that in the General tab of the properties dialog of a diagram there is a "Stereotype" drop down listbox.  However, I can't figure out how to put anything in that drop down listbox.  How do I do that?

Ralf

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Re: Stereotypes for alternate notations
« Reply #4 on: October 27, 2009, 07:47:20 pm »
yes, it is a drop down box which is empty. But it is also a combo box which means that you simply can type anything in this box (as with so many drop downs in ea).
Just type in the name of the stereotype...

HTH,
Ralf

Shawn Oberst

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Stereotypes for alternate notations
« Reply #5 on: October 28, 2009, 02:59:06 am »
I now know of two ways to put things into that drop down.  The nice folks at Sparx support told me (correctly) that you can do into Settings | Uml... | Stereotype tab and stereotype a Diagram (note that diagram does not appear on the list of things to stereotype so you must type it).  Every stereotype of a diagram that you create will appear in that drop down list.

On my own, I found that, within an MDG technology, if you create a metaclass and name it Diagram then you can create stereotypes that extend this metaclass naming those whatever you want and if you Generate this MDG technology from the tools menu in the usual way and then load this technology on the Settings menu in the usual way your stereotypes will also appear in that drop down list when you are using your technology.  Note again, "Diagram" is not a choice among metaclasses so you must select a different metaclass and then rename it to "Diagram".  The advantage of this last approach is that when you use different technologies you can have different things appear in the drop down list.

Thanks for replying and I hope this helps you.