Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: André Ribeiro on November 07, 2013, 08:03:55 am
-
Hi everyone!
In my UML Profile I've created a stereotype which extends the metaclass Boundary and consequently is represented as a rectangle.
Now, I would like to know how can I represent it instead as a rectangle with rounded corners.
Thanks in advance!
-
You can right click on any Boundary in EA and select Appearance | Shape | Rounded Rectangle.
What I'm not sure of is if you can specify that as the default from a profile.
-
Could you write a shape script for a boundary???
q.
-
Thank you for the answers, but I never used Shape scripts.
Is it possible to achieve what I want?
Some hints would be appreciated.
Many thanks!
-
Well, I just assigned a simple shape to a boundary and that worked. There are quite some examples in the help. Should not be too difficult when using RoundedRect.
q.
-
Hi everyone,
I was able to create a boundary with the rounded corners, but now I would like to know how can I specify a transparent background color to this boundary?
My script:
shape main
{
SetPenWidth(2);
RoundRect(0, 0, 100, 100, 20, 20);
addsubshape("stereotypecompartment", 100, 10);
addsubshape("namecompartment", 100, 10);
shape stereotypecompartment
{
h_align = "center";
editablefield = "stereotype";
println("«#stereotype#»");
}
shape namecompartment
{
h_align = "center";
editablefield = "name";
println("#name#");
}
}
Thanks in advance!
-
None of the elements has transparency. Neither shape script offers that.
q.
To create a transparent shape in a shape script, use StrokePath() instead of FillAndStrokePath(), e.g.
shape main
{
startpath();
roundrect(0,0,100,100,30,30);
endpath();
strokepath();
}
Commands like rectangle(), roundrect() and ellipse() have an implicit FillAndStrokePath() but this technique bypasses that.
-
It worked! ;D
Many thanks KP!