Author Topic: Stereotype and Icons  (Read 1959 times)

Philipp91

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Stereotype and Icons
« Reply #15 on: October 22, 2020, 04:46:30 am »
Sorry I did not get what you meant with "The open folder is something made in EA's guts."
To show to images cannot be done by any command via shape script?? Otherwise as a cheap solution I though i create only icons
as a stereotype and minimize them as much I can and add them inside the metaclass "action", any other way to achieve something like that?

Kind Regards,
Philipp

qwerty

  • EA Guru
  • *****
  • Posts: 11472
  • Karma: +305/-263
  • I'm no guru at all
    • View Profile
Re: Stereotype and Icons
« Reply #16 on: October 22, 2020, 05:53:59 am »
I thought you were talking about the icons in the tree view. Obviously not :-/

You can show images with shapescripts. Use Image(imageName,left,top,right,bottom) to do that. The image then needs to be in the images table in EA.

q.

Philipp91

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Stereotype and Icons
« Reply #17 on: October 22, 2020, 06:12:03 am »
Yes I was able to add some images to my stereotypes.
So to make my question more clear in the following link you can see a screenshot : https://paste.pics/5a8094cfde52d46e8bd36bd1d5125055 .

So as you see I added in the Migratable stereotype an icon of a laptop, and in restartable an icon of a smartphone. So actually my question is can i create a stereotype were it will has both icons next to each other in the right-top corner via shapescript or so?

Kind Regards,
Philipp

qwerty

  • EA Guru
  • *****
  • Posts: 11472
  • Karma: +305/-263
  • I'm no guru at all
    • View Profile
Re: Stereotype and Icons
« Reply #18 on: October 22, 2020, 07:08:39 am »
You can draw as many icons up there as you like. (The question is whether you will still be able to recognize any details.)

q.

Philipp91

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Stereotype and Icons
« Reply #19 on: October 22, 2020, 10:07:49 pm »
Any example/tip of how something like this can be achieved?

Kind Regards,
Philipp

qwerty

  • EA Guru
  • *****
  • Posts: 11472
  • Karma: +305/-263
  • I'm no guru at all
    • View Profile
Re: Stereotype and Icons
« Reply #20 on: October 22, 2020, 11:51:14 pm »
Well, you have your shape script, don't you? Just add the other icons.

q.

Philipp91

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Stereotype and Icons
« Reply #21 on: October 23, 2020, 12:43:41 am »
Yes, I tried.
My script is the simple cause of an image

decoration icon
{
    orientation="NE";
    image("laptop.png",0, 0, 100, 100);
}

So I tried things like

{
    orientation="NE";
    image("laptop.png",0, 0, 100, 100);
    image("computer.png",0,0,100,100);
}

Or 

decoration icon
{
    orientation="NE";
    image("laptop.png",0, 0, 100, 100);
}
decoration anothericon
{
    orientation="NE";
    image("computer.png",0, 0, 100, 100);
}

and so but I was not able to show 2 icons together

Kind Regards,
Philipp

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 10528
  • Karma: +358/-31
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Stereotype and Icons
« Reply #22 on: October 23, 2020, 12:46:06 am »
Showing both icons NorthEast, in the same location will make your second icon overwrite the first one.
You can either show them in a different corner, or show them next to each other by playing with the coordinates

Geert

Philipp91

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Stereotype and Icons
« Reply #23 on: October 23, 2020, 01:42:21 am »
Thanks, good idea. Dump of me that I did not though it.


Kind Regards,
Philipp

qwerty

  • EA Guru
  • *****
  • Posts: 11472
  • Karma: +305/-263
  • I'm no guru at all
    • View Profile
Re: Stereotype and Icons
« Reply #24 on: October 23, 2020, 03:13:22 am »
Ah, I was just thinking/talking of the coordinate variant and though it were obvious :-/

q.

Philipp91

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Stereotype and Icons
« Reply #25 on: October 24, 2020, 10:31:28 pm »
No problem, the discussion in general is already helpful enough :).
Still was not able to get what I want but I am close to it.

Kind Regards,
Philipp

Philipp91

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Stereotype and Icons
« Reply #26 on: October 28, 2020, 02:27:48 am »
Hello again,

I was thinking to open  a new topic but its related with this one so i thought to continue here.
So  I am still struggling with the icon thing..

What I want to achieve is to apply 2-3 stereotypes on a metaclass element and these stereotypes have also icons and I want all the icon to be displayed. As you can see in the screenshot: https://paste.pics/3544ce347a9dfb911be159af71c583c8, in the action search routes there are applied two stereotypes and both icons are displayed. However, I achieved this by making cheats and not by creating an official stereotype.

So when I create officially the stereotypes with their icons and I apply both on them on the same element they override each other even if they are have not the same coordinates. For example in :https://paste.pics/a640a6b23c44211a2cbfe6dd42133896 you can see that in Action6 there are applied 2 stereotypes but only one icon is displayed, where in https://paste.pics/871bd930b61572d4c22d45d94cc89f20 we have again the same stereotypes but the other icon is shown.

As I understood its just takes one( depends on which you choose first i think) and just shows these...And as you can see in the screenshots the two icons are not in the same spot.

Any suggestion of how to achieve that? It's the last thing I need to do with icons...

Kind Regards,
Philipp

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 10528
  • Karma: +358/-31
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Stereotype and Icons
« Reply #27 on: October 28, 2020, 02:38:24 am »
Stereotypes and shapescripts don't work like that.
There will only be one shapescript that will be executed.

Geert

PS. It looks like you are using activities instead of actions.

Philipp91

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Stereotype and Icons
« Reply #28 on: October 28, 2020, 03:33:06 am »
No its atomic actions, activities cannot have control flow between them.
So even if the shapescripts are on different stereotypes only the one will be executed?

So to display two icons my only option is to have both in the same shape script, right? If thats the only case
then can you give me any hint for the coordinates of how to add in one shape script 3 icons with a proper size?
I am trying so long I am really confused with this coordinates..

Kind Regards,
Philipp

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 10528
  • Karma: +358/-31
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Stereotype and Icons
« Reply #29 on: October 28, 2020, 05:33:56 am »
It doesn't seem possible to add multiple subshapes, or to escape the the designated corner when using decorations.

Alternative is something like this

Code: [Select]
shape main
{
layouttype = "leftright";
DrawNativeShape();
AddSubShape("EALogo",20,20,60,0);
AddSubShape("Favorites",20,20,60,0);
shape EALogo
{
Image("EA Logo",0,0,100,100);
}
shape Favorites
{
Image("Favorites",0,0,100,100);
}
}

Geert