Author Topic: Appearance of stereotypes in new UML profile  (Read 1174 times)

MikkelS

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Appearance of stereotypes in new UML profile
« on: October 19, 2020, 05:10:57 pm »
Hi,

We are currently in the proces of creating our own UML profile to use for developers. Currently our profile looks like this: https://imgur.com/ONLe0kZ
Are problem is that we want to manually set the appearance of each of the stereotypes in the picture with an image. The images we have a .png or .jpg, but these are not supported.

We have tried using the image manager and setting the default appearance there, as you can see on the stereotypes "Script" and "MQ Component", but when we export the diagram as UML profile and import it again to create a toolbox with these stereotypes, the appearance of all the stereotypes look the same.

Has anyone solved this? :o
I am happy to elaborate the problem and send more screenshots if needed.

Kind regards
Mikkel

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 11238
  • Karma: +413/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Appearance of stereotypes in new UML profile
« Reply #1 on: October 19, 2020, 06:19:15 pm »
Mikkel,

You can set the appearance to an image from the image manager using a shapescript.

See the example here: https://www.sparxsystems.com/enterprise_architect_user_guide/15.2/modeling/example_scripts.html

Geert

MikkelS

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Appearance of stereotypes in new UML profile
« Reply #2 on: October 19, 2020, 09:51:31 pm »
Thank you Geert, you are the best!
Is there anyway we can get the images to appear in the toolbox as well? ;D

https://imgur.com/5WiNegn

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 11238
  • Karma: +413/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Appearance of stereotypes in new UML profile
« Reply #3 on: October 19, 2020, 10:05:30 pm »
Yes you can do that.

In that case you need to convert them to 16x16 bitmaps.
The color RGB(192.192.192) is considered to be transparent by EA.

Then you can add the path to the image in your steoreotype specification (use the profile helper)
(also make sure to set the metatype, or the icon won't work)

This will make the icon appear in both the toolbox as the project browser.

Geert

MikkelS

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Appearance of stereotypes in new UML profile
« Reply #4 on: October 19, 2020, 10:50:55 pm »
Awesome!
Works very well in the project browser, but for some reason something goes wrong when Sparx tries to show the icons in the toolbox.
Have you seen this before?

https://imgur.com/Bz35lUW

qwerty

  • EA Guru
  • *****
  • Posts: 12329
  • Karma: +347/-287
  • I'm no guru at all
    • View Profile
Re: Appearance of stereotypes in new UML profile
« Reply #5 on: October 19, 2020, 11:04:49 pm »
You're not converting it to the right bitmap format (16x16). There are different formats and you need the most primitive one (IIRC). I'm no specialist in image formats...

q.

MikkelS

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Appearance of stereotypes in new UML profile
« Reply #6 on: October 19, 2020, 11:13:55 pm »
Alright, thank you! I will try to experiment a bit with this.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 11238
  • Karma: +413/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Appearance of stereotypes in new UML profile
« Reply #7 on: October 20, 2020, 12:23:06 am »
Here's an example of an image that works: https://imgur.com/Du69Zmd

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 12329
  • Karma: +347/-287
  • I'm no guru at all
    • View Profile
Re: Appearance of stereotypes in new UML profile
« Reply #8 on: October 20, 2020, 12:39:23 am »
That downloads as png and will likely not work...

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 11238
  • Karma: +413/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Appearance of stereotypes in new UML profile
« Reply #9 on: October 20, 2020, 12:53:36 am »
That downloads as png and will likely not work...

q.
I guess you are right. Here another one from my google drive https://drive.google.com/file/d/1h_TNcHQYs8lJSBXlLmzaO7SpaMlfFTTt/view?usp=sharing

Geert

MikkelS

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Appearance of stereotypes in new UML profile
« Reply #10 on: October 22, 2020, 06:10:38 pm »
Hi,

After testing with some different images and formats, I figured it out: https://imgur.com/3MklUrB
It turns out that my images where scaled at 60px x 60px, which looked wierd in Sparx, so I downscaled then to 16px x 16px and now it is working. In addition it works fine with 256bit bitmap files, as you can see the colours are well represented :)