Sparx Systems Forum
Enterprise Architect => Suggestions and Requests => Topic started by: Paolo F Cantoni on April 29, 2009, 06:11:41 pm
-
I'm sure there are others out there playing around with Shape Scripts.
I'm looking for a means to draw the component glyph - using a ShapeScript. (I want to simulate a Packaging Component using a real Package (until Sparx upgrade the PackagingComponent functionality).
It seems to me that we could all profit from an additional section in the forums for shareable stuff (like shape scripts).
Obviously, I can develop one myself (and if no one shares, I'll do that) but if Sparx can come to the party it would be good...
PS: If Sparx provided a standard set of shape scripts for each of the glyphs they use that would make things REALLY consistent! (Hint hint) ;)
TIA,
Paolo
-
There might be something in the works Paolo. I will write soon on the 'back channel' to discuss this. If you don't hear from me in the next little while please bug me on the subject.
David
-
Would love to see this happen, I have recently been developing shape scripts for what our org needs. The 5 examples in Sparx documentation are just not enough.
Please get this rolling sparx, and paolo if they dont... maybe you and I should pump some code out, wouldn't be hard.
-
Here's the component glyph...
I've set it up to be conditional on whether the element is a package or not...
shape main
{
drawnativeshape();
if (hasproperty("type", "Package"))
{
setorigin("NE",-20,5);
addsubshape("PackagingComponent", 0, 0);
}
Shape PackagingComponent
{
scalable = false;
Rectangle(0,0,15,25);
Rectangle(-5,5,5,10);
Rectangle(-5,15,5,20);
}
}Couple of issues:
1) The subshape changes aspect ratio with the change in aspect ratio of the base nativeshape. (whereas the proper component glyph doesn't) Fixed as a result of post below - NEW code supplied!
2) For some elements, I get slightly differnet renderings - not sure why yet. (But I'm pretty sure it's related to EAUI wrt to the three different ways to specify element rendering.
Enjoy,
Paolo
-
Hi Paolo,
I think there was an easy way to prevent subshapes from scaling, just setting shape attribute 'scalable' to false in the subshapes definition.
WBR
Günther
-
Hi Paolo,
I think there was an easy way to prevent subshapes from scaling, just setting shape attribute 'scalable' to false in the subshapes definition.
WBR
Günther
Thanks Günther,
As you can see, I've changed the code above (and as a result had to adjust the sizings...). The new shape looks really good!
Paolo
-
For this concept to get very far, we really need to see some of those many enhancements to shape scripts we have asked for. I see no reason why shape scripts can't be extended ... and not with huge effort ... such that everything we see is basically the result of an underlying shapescript rather than something hard coded. And, once we have that, then we can have source for them, subclass them, etc. in the way we have been requesting for some time.
-
For this concept to get very far, we really need to see some of those many enhancements to shape scripts we have asked for. ...
Indeed!
Paolo