Book a Demo

Author Topic: Show icon if notes are filled  (Read 4099 times)

Coen

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Show icon if notes are filled
« on: October 28, 2008, 01:41:20 am »
In some diagrams we had quite a few notes which I've moved to the notes property of the elements concerned. This made the diagrams much easier to read and useable in presentations, etc... Now I would like to see on the diagram if there are notes added to an element, for instance by showing a pencil icon in the element like a stereotype. This pencil icon should only be shown when the notes are filled. When the notes are cleared, the pencil icon should disappear.

Is it possible to create a feature like this?

Kind regards,

Coen.

Oliver F.

  • EA User
  • **
  • Posts: 573
  • Karma: +2/-1
  • ArenĀ“t we all in the model business ?
    • View Profile
    • Karl Storz homepage
Re: Show icon if notes are filled
« Reply #1 on: October 28, 2008, 02:21:30 am »
Shape scripts associated with stereotypes will do this.

Take a look in the online help and search for shape scripts.
Basically you would call the standard drawing method and then conditionally add a some icon.

Hope this helps.

Oliver

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Show icon if notes are filled
« Reply #2 on: October 29, 2008, 08:30:49 am »
Or, only add a decoration script that shows the icon conditionally.

Of course, you can only do either of these if you have a stereotype on the element.

Sygnus

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: Show icon if notes are filled
« Reply #3 on: October 29, 2008, 10:10:20 pm »
Simon,

Are decoration scripts the ones treated on the "Show stereotype icons" option?

Could you give me an example of one such example?


KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Show icon if notes are filled
« Reply #4 on: October 30, 2008, 08:20:50 am »
Quote
Could you give me an example of one such example?
Code: [Select]
decoration notes
{
      orientation="NE";
      if(hasproperty("notes",""))
      {
            // it would really help if shape scripts had 'NOT'...
      }
      else
      {
            setfillcolor(255,0,0);
            ellipse(0,0,100,100);
            // or you could draw the pencil that the O.P. mentioned
      }
}
« Last Edit: October 30, 2008, 08:21:59 am by KP »
The Sparx Team
[email protected]