Author Topic: stereotype appearance  (Read 4311 times)

mkopf

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
stereotype appearance
« on: November 29, 2005, 06:55:06 am »
Hello,
does anyone know, how to modify the appearence of a stereotype, so that it has a small icon in the upper-right corner? Looking like, for example, as the stereotype "client page".
Thanks!!

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: stereotype appearance
« Reply #1 on: November 29, 2005, 02:28:06 pm »
A new feature of EA 6 is you can assign a shape script for the stereotype. Here's how...

From the main menu, Settings | UML | Stereotypes. Find and select the stereotype in the list, or create a new one. Select the "Shape Script" radio button and click "Assign". Enter your shape script, click "Refresh" to make sure it looks how you like, then click "OK", then "Save" and "Close".

So what should the shape script look like. Here's a very simple example to put a pale yellow rectangle in the top-right corner of an element:
Code: [Select]
Decoration Testing
{

Orientation="NE";

SetFillColor(255,255,200);

StartPath();

Rectangle(0,0,80,100);

EndPath();

FillAndStrokePath();
}

The orientation command positions the decoration according to compass position. Valid values are N, S, E, W, NE, NW, SE, SW and CENTER. The rectangle command works with percentage values. Decorations are a fixed size so this script draws a rectangle the full height but 80% of the width of a full-sized decoration. The startpath, endpath and fillandstrokepath commands when used together will fill whatever is drawn between the start and end with the defined fill colour (which is defined as a standard RGB value).

Shape scripts can have conditional logic based on most of the properties of the chosen element, and there's a large variety of drawing commands available. I don't think the help for shape scripts is finished yet, so we will give any assistance you need - just let me know what shape you want and I'll have a go...

:)
The Sparx Team
[email protected]

mkopf

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: stereotype appearance
« Reply #2 on: December 01, 2005, 01:46:32 am »
Thank you for the answer.
Unfortunately, I work with EA version 4.51.750 (Build: 750).
Best Regards.
M.Kopf

mcoletti

  • EA User
  • **
  • Posts: 45
  • Karma: +0/-0
    • View Profile
Re: stereotype appearance
« Reply #3 on: March 30, 2006, 07:40:31 am »
Hi,

I have the need of a stereotype icon representing a wall-mounted video camera, to add aesthetic to a deployment diagram for top management.

Is there any starting point?

Many thanks,

Massimo

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: stereotype appearance
« Reply #4 on: March 30, 2006, 02:54:11 pm »
Quote
I have the need of a stereotype icon representing a wall-mounted video camera, to add aesthetic to a deployment diagram for top management.

Is there any starting point?

The starting point is probably to decide whether you want a photographic image or a stylized drawing. Try a Google image search for ideas.
The Sparx Team
[email protected]

mcoletti

  • EA User
  • **
  • Posts: 45
  • Karma: +0/-0
    • View Profile
Re: stereotype appearance
« Reply #5 on: March 31, 2006, 12:35:50 am »
sorry, I was not clear.

I need to create a stereotype image script, as in the "yellow box" example above in the topic.

I was asking wether there is an example of a shape script for a similar shape, to copy and use as a reference and a starting point.

Thanks,

Massimo