Book a Demo

Author Topic: Hide stereotype label from UML component  (Read 3992 times)

rty

  • EA User
  • **
  • Posts: 28
  • Karma: +2/-1
    • View Profile
Hide stereotype label from UML component
« on: November 19, 2020, 03:20:48 am »
In a diagram, I want to not show the stereotype label of elements which are of a certain stereotype (because I need to modify the element's layout using shape script which I can only achieve for stereotyped elements).

According to the manual https://sparxsystems.com/enterprise_architect_user_guide/15.2/modeling/drawing_methods.html,

Code: [Select]
shape middlebottomlabel { print(""); }
should "suppress the default stereotype label", but it doesn't. Even if I use the middletoplabel. Or any other label. Even

Code: [Select]
hidelabel("middletoplabel")

or middlebottomlabel doesn't hide thelabel.

To hide all stereotype label as suggested at StackOverflow https://stackoverflow.com/questions/54693762/how-to-hide-stereotypes-labels-from-my-profile is not an option for me, since some elements need a visible stereotype.

What do I miss? Any hint?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Hide stereotype label from UML component
« Reply #1 on: November 19, 2020, 04:20:47 am »
That's only meant for connectors. For elements you need to draw the shape yourself and print just the element name. For actiions that will loose the ability to print the name in bold.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13471
  • Karma: +571/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Hide stereotype label from UML component
« Reply #2 on: November 19, 2020, 04:31:55 am »
The middlebottomlabel thing is only for relations.

You might need to rewrite the whole shape (without the stereotype) to pull that off, I'm not sure.

Geert

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: Hide stereotype label from UML component
« Reply #3 on: November 19, 2020, 07:47:24 am »
I think (I haven't tried it) the following might work for diagram objects:

Code: [Select]
shape label
{
    print("");
}

but it's of no help to you in hiding the stereotype from a Component because the stereotype isn't shown in a label. The Show Stereotypes option affects all elements on a diagram, so you will have to either use that or take control of drawing the whole Component shape.
« Last Edit: November 19, 2020, 07:53:21 am by KP »
The Sparx Team
[email protected]

rty

  • EA User
  • **
  • Posts: 28
  • Karma: +2/-1
    • View Profile
Re: Hide stereotype label from UML component
« Reply #4 on: November 19, 2020, 10:29:01 pm »
Code: [Select]
shape label
{
    print("");
}

A pity, but doesn't work for me.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Hide stereotype label from UML component
« Reply #5 on: November 20, 2020, 01:59:08 am »
As said you need to take care of the whole rendering in your case. Start with a
Code: [Select]
shape main {
Rectangle(0,0,100,100);
print("#name#");
}
and then go on bit by bit...

q.

rty

  • EA User
  • **
  • Posts: 28
  • Karma: +2/-1
    • View Profile
Re: Hide stereotype label from UML component
« Reply #6 on: December 04, 2020, 06:49:35 pm »
Ok, thanks. This works but is a ... rather inconvenient approach.  ;)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Hide stereotype label from UML component
« Reply #7 on: December 04, 2020, 09:16:58 pm »
Not invonvient but Sparxian :-/

q.