Book a Demo

Author Topic: Stereotype Icon: how to get it with Shapescript? (again!)  (Read 12026 times)

Giu Platania

  • EA User
  • **
  • Posts: 88
  • Karma: +4/-0
  • As Above so Below
    • View Profile
    • Linkedin
Stereotype Icon: how to get it with Shapescript? (again!)
« on: April 02, 2022, 03:18:21 am »
Hello all,
after 2 years I'm back to the same question: How can we deactivate the decorator using shape script?
In each diagram property you have:
- Show Element Stereotype (react to 
Code: [Select]
if(hasproperty("stereotypehidden","false"))

- Use Stereotype Icon
is undocumented.
However, the following technologies are using it:
- Data modeling
- Documentation
- Business Modeling

so we know that is possible and it's not "rectanglenotation".
SO I suspect it's a non documented property.
Has anyone a clue about that???

 
Giuseppe Platania
Enterprise Architect
Door Business Consulting
+++
"As above so below, to accomplish the miracles of the One Thing" - Trismegistus
===
The above content reflects my own opinion and is not endorsed by Monthy Python
***
The above is NOT a reference to Monty Python

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Stereotype Icon: how to get it with Shapescript? (again!)
« Reply #1 on: April 02, 2022, 03:56:18 am »
Is that not one of those user selected settings?

See https://sparxsystems.com/enterprise_architect_user_guide/15.2/modeling/query_methods.html in the middle.

Geert


Giu Platania

  • EA User
  • **
  • Posts: 88
  • Karma: +4/-0
  • As Above so Below
    • View Profile
    • Linkedin
Re: Stereotype Icon: how to get it with Shapescript? (again!)
« Reply #2 on: April 02, 2022, 05:23:44 am »
No this is a standard property of any element with a shapescript. As the diagram menu for element shows.
Giuseppe Platania
Enterprise Architect
Door Business Consulting
+++
"As above so below, to accomplish the miracles of the One Thing" - Trismegistus
===
The above content reflects my own opinion and is not endorsed by Monthy Python
***
The above is NOT a reference to Monty Python

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Stereotype Icon: how to get it with Shapescript? (again!)
« Reply #3 on: April 02, 2022, 07:09:39 am »
You add an empty decorator shape. That's just it. In order to control it add a diagram property you can tic. Then in your shape script use the HasProperty to query it. We do that for quite a number of shapes.

q.
« Last Edit: April 02, 2022, 07:12:56 am by qwerty »

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Stereotype Icon: how to get it with Shapescript? (again!)
« Reply #4 on: April 02, 2022, 01:36:56 pm »
Giu,
Your problem is that (with apologies to George Orwell) "all icons are equal, but some are more equal than others".  What you see at the top right of your shape may look like icons, but they're not.  As qwerty says, they are decorations.  The setting DOES indeed suppress icons, but ONLY real icons rendered on very few (typically, the earliest) shapes.  It does not suppress decorations (it can't really because Sparx has no mechanism to identify the decoration as an icon - a design flaw).

HTH,
Paolo

BTW: is Giu short for Giuliano?  (That was my father's name)
« Last Edit: April 02, 2022, 01:38:37 pm by Paolo F Cantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Giu Platania

  • EA User
  • **
  • Posts: 88
  • Karma: +4/-0
  • As Above so Below
    • View Profile
    • Linkedin
Re: Stereotype Icon: how to get it with Shapescript? (again!)
« Reply #5 on: April 03, 2022, 01:31:40 am »
Guys,
Even if I do not post a lot here I'm not exactly a newbie, in the past 15 years I wrote a variety of MDG and I know exactly what a decorator is.

e.g. this decorator Qwerty refears, it creates a 'dot' that
1. is activated when the custom property 'ActivateFlags' is true
2. Changes color when a tagged value is set

Code: [Select]
decoration Botton_left
{
orientation= "SW";
if (HasProperty("ActivateFlags","1"))
      {
if(HasTag("InvestmentStrategy","Retain"))
{
//blue
SetPenColor(107,203,236);
SetFillColor(107,203,236);
ellipse(0,0,100,100);
}
if(HasTag("InvestmentStrategy","Rehost"))
{
//Green
SetPenColor(155,187,89);
SetFillColor(155,187,89);
ellipse(0,0,100,100);
}
if(HasTag("InvestmentStrategy","Replatform"))
{
//dark blue
SetPenColor(79,129,189);
SetFillColor(79,129,189);
ellipse(0,0,100,100);
}
if(HasTag("InvestmentStrategy","Refactor"))
{
//Orange
SetPenColor(247,150,70);
SetFillColor(247,150,70);
ellipse(0,0,100,100);
}
if(HasTag("InvestmentStrategy","Retire"))
{
//red
SetPenColor(222,103,103);
SetFillColor(222,103,103);
ellipse(0,0,100,100);
}
if(HasTag("InvestmentStrategy","Rewrite"))
{
//yellow
SetPenColor(241,224,151);
SetFillColor(241,224,151);
ellipse(0,0,100,100);
}
}


what I'm asking which standard property EA uses to disable all decorators when
Show Element Stereotypes:

For elements that have whole shapes drawn by Enterprise Architect, if 'Use Stereotype Icons' is deselected, select this checkbox to display any stereotype on the element.

For elements that have an icon displayed in the top right corner, select this checkbox to indicate that a stereotype is present (icon if 'Use Stereotype Icons' is selected, text if not).

source
https://sparxsystems.com/enterprise_architect_user_guide/15.2/modeling/appearance_options_elem.html

to test the the expected behaviour:
1. drag a "table" from the Data modeling toolbox in a diagram, (I think that the 'icon' is the decorator is a shape script, not an image)
2. drag an archimate application component in the same diagram
3. Double click on the diagram, go to the element tab, uncheck "use the Stereotype icons"
4. the decorator for table is now hidden, the one for archimate application component is still visible

conclusion: it's a standard property, not a custom one (as in the above example) and it's undocumented and not supported by all MDG. How can we reproduce that?

Giuseppe Platania
Enterprise Architect
Door Business Consulting
+++
"As above so below, to accomplish the miracles of the One Thing" - Trismegistus
===
The above content reflects my own opinion and is not endorsed by Monthy Python
***
The above is NOT a reference to Monty Python

Giu Platania

  • EA User
  • **
  • Posts: 88
  • Karma: +4/-0
  • As Above so Below
    • View Profile
    • Linkedin
Re: Stereotype Icon: how to get it with Shapescript? (again!)
« Reply #6 on: April 03, 2022, 01:34:08 am »
BTW: is Giu short for Giuliano?  (That was my father's name)
after trying to teach american to pronounce my name correctly I just decided to keep it shorth a GIU. As a side consequence lot of people think I'm a GUI (Graphical User Interface) but I suspect to be deeper that that.....
Giuseppe Platania
Enterprise Architect
Door Business Consulting
+++
"As above so below, to accomplish the miracles of the One Thing" - Trismegistus
===
The above content reflects my own opinion and is not endorsed by Monthy Python
***
The above is NOT a reference to Monty Python

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Stereotype Icon: how to get it with Shapescript? (again!)
« Reply #7 on: April 03, 2022, 04:42:41 pm »
BTW: is Giu short for Giuliano?  (That was my father's name)
after trying to teach Americans to pronounce my name correctly I just decided to keep it short a GIU. As a side consequence lot of people think I'm a GUI (Graphical User Interface) but I suspect it to be deeper than that.....
Sorry, I didn't see it earlier.  I have my threads with the latest posts at the top and I didn't scroll down to the bottom of yours.

As to Americans mangling Italian names, I fly large radio-controlled helicopters and two of them are by a (formerly) Italian company.  They are the "Leggero" and "Evoluzione".  Hearing their names mangled on various podcasts causes me physical pain!   ::)   I even posted a link to a site that explained how to pronounce them, to no avail.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Stereotype Icon: how to get it with Shapescript? (again!)
« Reply #8 on: April 04, 2022, 08:34:40 am »
to test the the expected behaviour:
1. drag a "table" from the Data modeling toolbox in a diagram, (I think that the 'icon' is the decorator is a shape script, not an image)

The icon for <<EAUML::table>> does not come from a shape script.

You can of course put conditionals in shape script decorations. The only way to hide all decorations is if you have put conditionals in all decorations...
The Sparx Team
[email protected]

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Stereotype Icon: how to get it with Shapescript? (again!)
« Reply #9 on: April 04, 2022, 08:39:55 am »
1. drag a "table" from the Data modeling toolbox in a diagram, (I think that the 'icon' is the decorator is a shape script, not an image)
2. drag an archimate application component in the same diagram
3. Double click on the diagram, go to the element tab, uncheck "use the Stereotype icons"
4. the decorator for table is now hidden, the one for archimate application component is still visible

conclusion: it's a standard property, not a custom one (as in the above example) and it's undocumented and not supported by all MDG. How can we reproduce that?
Tables are not drawn using shape scripts. ArchiMate applications are drawn with shape scripts.

There is no shape script property to respond to that particular option.
« Last Edit: April 04, 2022, 09:25:11 am by Eve »

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Stereotype Icon: how to get it with Shapescript? (again!)
« Reply #10 on: April 04, 2022, 06:45:59 pm »
[SNIP]
Tables are not drawn using shape scripts.
Is this a legacy behaviour Sparx EA is planning to correct or an "enduring" feature?

Guiseppe - We have implemented something very similar but instead of changing the colour of the decoration, we are changing the colour of the entire element. We decided to do so in part because Sparx EA does not a good job rendering all decorations. We have had a few issues with some ShapeScripts that rendered more of less fine as elements  but rendered a weird looking decorations.

Giu Platania

  • EA User
  • **
  • Posts: 88
  • Karma: +4/-0
  • As Above so Below
    • View Profile
    • Linkedin
Re: Stereotype Icon: how to get it with Shapescript? (again!)
« Reply #11 on: April 04, 2022, 09:22:24 pm »
1. drag a "table" from the Data modeling toolbox in a diagram, (I think that the 'icon' is the decorator is a shape script, not an image)
2. drag an archimate application component in the same diagram
3. Double click on the diagram, go to the element tab, uncheck "use the Stereotype icons"
4. the decorator for table is now hidden, the one for archimate application component is still visible

conclusion: it's a standard property, not a custom one (as in the above example) and it's undocumented and not supported by all MDG. How can we reproduce that?
Tables are not drawn using shape scripts. ArchiMate applications are drawn with shape scripts.

There is no shape script property to respond to that particular option.

there is no shapescript, however EA hides the icon, changing the appearance of the diagram: can you elaborate on the mechanism?
Also, if this is a legacy function, why do we have the option to hide stereotype icons in the interface?
Giuseppe Platania
Enterprise Architect
Door Business Consulting
+++
"As above so below, to accomplish the miracles of the One Thing" - Trismegistus
===
The above content reflects my own opinion and is not endorsed by Monthy Python
***
The above is NOT a reference to Monty Python

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Stereotype Icon: how to get it with Shapescript? (again!)
« Reply #12 on: April 05, 2022, 08:47:28 am »
Is this a legacy behaviour Sparx EA is planning to correct or an "enduring" feature?
It's unlikely to change while it's working.

there is no shapescript, however EA hides the icon, changing the appearance of the diagram: can you elaborate on the mechanism?
Also, if this is a legacy function, why do we have the option to hide stereotype icons in the interface?
The mechanism is that EA has code compiled into it to draw tables, along with many other elements. That code responds to the option in question.

I didn't use the word legacy. It's not a legacy function. We can probably never remove that option without upsetting users with existing diagrams.
« Last Edit: April 11, 2022, 08:58:18 am by Eve »

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Stereotype Icon: how to get it with Shapescript? (again!)
« Reply #13 on: April 06, 2022, 01:16:32 am »
Eve, the issue with tables and how Sparx Systems has implemented and hard wired data modelling features into the tool is simply put that it is far from an optimal implementation and almost impossible to customise. I doubt that anybody will buy Sparx EA just for its data modelling capabilities, people buy Sparx EA because it can do many things, some of them sub-optimally.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Stereotype Icon: how to get it with Shapescript? (again!)
« Reply #14 on: April 06, 2022, 07:43:17 am »
I would guess that this fact is unknown to Sparx :-/

q.