Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: Tonu on December 07, 2005, 03:08:42 pm
-
I can not figure out how to use the shape script type "decoration".
I have upgraded to ver 6.0 hoping to customise some of the stereotypes I use. For instance, one of my needs is to make distinction between issues and requirements on a diagram.
I created a stereotype expanding Issue and tried to decorate the standard shape with this script:
---
decoration dot
{
orientation = "NE";
StartPath();
Ellipse(10,10,20,20);
Ellipse(12,12, 14, 14);
Ellipse(16,12, 18, 14);
moveto(14,18);
lineto(16,18);
EndPath();
FillAndStrokePath();
}
---
Even if the shape appears in the script editor preview, it does not have any effect on the shape displayed in diagram.
The problem can not be in using a wrong stereotype, as if I change the script to type "shape main" the appearance of items in diagram will change.
Has anyone managed to change decoration of existing shapes (I am using ver 6.0 build 779)
-
Tonu,
The number values you need to enter are % of the total size of the decoration, not pixel values. Try this version:
decoration dot
{
orientation = "NE";
StartPath();
Ellipse(0,0,100,100);
Ellipse(20,20,40,40);
Ellipse(60,20,80,40);
moveto(40,80);
lineto(60,80);
EndPath();
FillAndStrokePath();
}
Hope that helps,
Neil
-
Hi Neill,
The only effect it had was that the shape got bigger in script editor. No changes in diagram, though ...
First I suspected, that decoration depends on the base class, but now I have tried it with Issue stereotype and Class stereotype. Neither one works
Any other suggestions?
Tonu
-
Further to my previous reply, at build 779 decorations only work with classes and packages. We will add the functionality for other element types right away - should make it into 781. Sorry about that.
Neil
-
A hint, that is not related to the thread subject but rater to the problem that brough me to shape scripts. May be it will save those two hours I spent on palyng with scripts for someone else ...
I wanted to distinquish Requirements and Issues in a diagram. I discovered only now that there is an option "Show stereotype icon for requirements" that does the trick! (Tools->Options->Objects)
May be not as good-looking option as the small issue icon in the project tree, but solves the problem. The rest is a matter of taste anyway ;-)
Tonu
-
Did this make it into build 781 ?
thanks
-
Did extending this beyond class/package make it into 781, 785, 786 ?
-
Did extending this beyond class/package make it into 781, 785, 786 ?
785, yes. It now works for all most element types. [I've just found a couple that don't work (e.g. component and artifact, although maybe that was intentional since they have their own built in decorations). We will get those, and any others, fixed for 787.]
Neil
PS Try this one with an actor element:
decoration dot
{
orientation = "N";
setorigin("N",-9,11);
StartPath();
Ellipse(0,0,100,100);
Ellipse(20,20,40,40);
Ellipse(60,20,80,40);
moveto(40,80);
lineto(60,80);
EndPath();
FillAndStrokePath();
}
;D