Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Coen on October 28, 2008, 01:41:20 am

Title: Show icon if notes are filled
Post by: Coen 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.
Title: Re: Show icon if notes are filled
Post by: Oliver F. 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
Title: Re: Show icon if notes are filled
Post by: Eve 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.
Title: Re: Show icon if notes are filled
Post by: Sygnus 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?

Title: Re: Show icon if notes are filled
Post by: KP 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
      }
}