Author Topic: Custom Image for Profile Stereotype  (Read 2517 times)

d.greenyer-sf

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Custom Image for Profile Stereotype
« on: August 01, 2011, 06:13:55 pm »
How do I associate an image (bmp/png/jpeg) with a stereotype in a profile?

The help is vague:

"In some cases, particularly MDG Technology Stereotype Profiles, your Shape Script might include externally-defined images. In this case the Shape Script would include the image method, specifying the image file name prefixed with the technology name."

What is the ofrmat of the tag to use with the initial property?

Any help would be much appreciated.


KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: Custom Image for Profile Stereotype
« Reply #1 on: August 02, 2011, 09:01:28 am »
Here's one way (not the only way, but it works for me):

Give your stereotype class an attribute named "_image". Click the "..." button next to the Initial Value field in the attribute's properties dialog and enter the following shape script:

Code: [Select]
shape main
{
    image("mypicture.jpg",0,0,100,100);
}
Then save your profile and deploy. The image named in the shape script must exist in the model at the time that you use it: Settings > Images... to add it, although I think the tidiest solution is to have an add-in that installs the profile (as part of a technology) and the images (as reference data) automagically.
« Last Edit: August 02, 2011, 09:04:15 am by KP »
The Sparx Team
[email protected]

Michael Proske

  • EA User
  • **
  • Posts: 72
  • Karma: +0/-0
    • View Profile
Re: Custom Image for Profile Stereotype
« Reply #2 on: August 10, 2011, 03:26:09 am »
The easiest way is to deploy the image with the profile together as a technology. But then you have to reference the image as <Technology Name>::<Image Name> because otherwise it is not found.