I've been playing with MDGs and stereotypes and have found a lot of difficulty getting deterministic results for what will render given a set of stereotypes. I've asked Sparx for the algorithm and they've kindly provided one (I'm not sure they've got it all right - but that's another story). In my original researches - which caused me to ask Sparx for "how does it work", I discovered the bug: Wrong stereotype identified (http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1271782999).
This post concerns another bug in shapescripts that affects how stereotypes are rendered.
If you define a stereotype with a shapescript, you can define the fill colour and the border colour (but not the font colour >:( - See: Can't set Font Colour in Shapescripts (http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1270705405/0#1)) with:
setfillcolor(...) and setpencolor(...) /setpen(...).
Now, one may create a shapescript ab initio, in which case the settings for the "Default Colors" panel of the stereotype are all set to "Default Color". Everything works as it should: Issuing a drawnativeshape() will result in the fill colour specified with setfillcolor and the border colour specified with setpen will be rendered.
If you've been using EA for a while, you might have a set of stereotypes with non default "Default Colours" specified. You may wish to convert them to shapescripts. So you set the fill colour and bordercolour to agree with the current settings of the "Default Colors" panel. So you don't notice anything funny...
However, it turns out that while the fill colour specified in the shapescript overrides the settings in the "Default Colours" panel, the border color and pen size specified in the shape script DON'T override that in the "Default Colours" panel.
Steps:
Create a new stereotype.
Set the shapescript to specify the fill color and border colour.
Apply stereotype. Observe shape takes on the fill & border colour specified.
Change the "Default Colours" panel settings for the stereotype to values other than Default Color and those specified in the shapescript.
Save Stereotype.
Observe the fill colour remains as specified (in the shape script) but the border colour has changed to that last specified in the Default Colours panel.
This inconsistent behaviour can make debugging what's going a bit problematic...
The Font colour also overrides the shape script - but since there's no mechanism for specifying the font colour in a shape script - I guess I can't complain about the overriding... ;)
Reported,
Paolo
If you want to vote for a fix for this, submit a Registered Bug Report (http://www.sparxsystems.com/registered/reg_bug_report.html) or Bug Report (http://www.sparxsystems.com/support/bug_report.html)
with the same name, leaving a note here to say you've done it
- so we users have an indication of the level of support.