Book a Demo

Author Topic: custom stereotype apperance from Image Library  (Read 3947 times)

pittagentskip007

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
custom stereotype apperance from Image Library
« on: February 20, 2012, 01:36:06 am »
So I see that Sparx offers you the ability to import an image library, which I did and all the images look great. Have used the method given in the link to customize element apperance in certian diagrams and that works fine.
http://www.sparxsystems.com/resources/image_library.html

I also see I can override the default appearance of an element basd on stereotype, which is what I want to do for my users migrating from visio to EA so they dont have to go changing the default appearance all the time. Seems you can select a metafile from the file system and/or define a shape script to associate it with a stereotype.

http://www.sparxsystems.com/enterprise_architect_user_guide/modeling_languages/creatingcustomstereotypes.html

HOWEVER, it would be nice to assign a sterotype a default appearance USING METAFILE IMAGES from THE IMAGE LIBRARY!

Seems like a pretty big feature gap to me!

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: custom stereotype apperance from Image Library
« Reply #1 on: February 20, 2012, 08:34:42 am »
The way I do this is to give a stereotype a shape script like this:

Code: [Select]
shape main
{
    image("imagename",0,0,100,100);
}
The Sparx Team
[email protected]

pittagentskip007

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: custom stereotype apperance from Image Library
« Reply #2 on: February 20, 2012, 12:34:39 pm »
Yup that worked. You might want to add that to the image library help page on the website because others may be wondering the same thing.

pittagentskip007

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: custom stereotype apperance from Image Library
« Reply #3 on: February 22, 2012, 01:23:12 am »
Hey when doing this approach I lose the label? How do I get it back?

pittagentskip007

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: custom stereotype apperance from Image Library
« Reply #4 on: February 22, 2012, 05:51:17 am »
Nevermind, I figured it out. Here is one way to do it. May be a better way!


shape main
{
      
      
      addsubshape("myimage",100,100);
      addsubshape("myshape",100,100);
      
      shape myshape {
            println("#NAME#");
      }
      
      shape myimage {
            image("Server-Database",0,0,100,100);
      }
}