Book a Demo

Author Topic: isComposite overlay icon for custom stereotypes  (Read 5334 times)

jakob

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
isComposite overlay icon for custom stereotypes
« on: June 30, 2011, 12:05:24 am »
Hi,

I'm working with custom shapescripts to visualize my stereotypes. I was wondering how I can display the EA default overlay icon for elements that are composite. This icon seems to be always of the same size at the same position. No matter of the element's size.

Thanks for your help,
Jakob

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: isComposite overlay icon for custom stereotype
« Reply #1 on: June 30, 2011, 01:31:38 am »
This is created by EA as soon as the element is marked as composite. Set IsComposite to true (after placing a diagram inside).

q.

jakob

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: isComposite overlay icon for custom stereotype
« Reply #2 on: June 30, 2011, 07:10:46 am »
But it seems not to work when you're using a custom shapescript to visualize the composite elements...

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: isComposite overlay icon for custom stereotype
« Reply #3 on: June 30, 2011, 09:02:53 am »
Add something like this to the end of your shape script:

Code: [Select]
decoration composite
{
      orientation="SE";
      if(hasproperty("iscomposite","true"))
      {
            ellipse(0,40,40,60);
            ellipse(60,40,100,60);
            moveto(30,50);
            lineto(70,50);
      }
}
The Sparx Team
[email protected]

jakob

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: isComposite overlay icon for custom stereotype
« Reply #4 on: July 01, 2011, 12:09:55 am »
That's it!

Thank you very much!