Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: rty on November 19, 2020, 03:20:48 am

Title: Hide stereotype label from UML component
Post by: rty 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 (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 (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?
Title: Re: Hide stereotype label from UML component
Post by: qwerty 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.
Title: Re: Hide stereotype label from UML component
Post by: Geert Bellekens 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
Title: Re: Hide stereotype label from UML component
Post by: KP 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.
Title: Re: Hide stereotype label from UML component
Post by: rty on November 19, 2020, 10:29:01 pm
Code: [Select]
shape label
{
    print("");
}

A pity, but doesn't work for me.
Title: Re: Hide stereotype label from UML component
Post by: qwerty 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.
Title: Re: Hide stereotype label from UML component
Post by: rty on December 04, 2020, 06:49:35 pm
Ok, thanks. This works but is a ... rather inconvenient approach.  ;)
Title: Re: Hide stereotype label from UML component
Post by: qwerty on December 04, 2020, 09:16:58 pm
Not invonvient but Sparxian :-/

q.