The management of line widths in EA is broken!
When creating a profile, you can specify the (default) line width of the Stereotype by the <context Menu>|> Appearance | Default Appearance [F4] | Border width dialog. When you generate the MDG, the value DOES appear in the Stereotype definition as the borderwidth="<value>" attribute. So far, so good!
When you use the toolbox or the QuickLinker to draw the line, the line will appear as the appropriate width. BUT ALL is NOT what it seems!
If you have a line width that is NOT "1" (say "2"), then the first diagram you draw the line on will be drawn width="2". But on any other diagram on which the line usually appears, EA will draw it width="1"!
Why is this?
Investigation reveals that in t_connector, the IsBold column is (apparently) used to hold the "Default" value of the line width using the <context Menu>|> Appearance | Default Appearance [F4] | Border width dialog on the drawn line. A value of "0" appears to imply "use the default value from the profile (since that is the value set when the line is created initially on the diagram and is the width made on the diagram). The values 1,2 & 3 correspond to the values selected in the dialog.
Now "the plot thickens"!
So, since the value is set ("0") to use the profile default, you would expect the lines on the other diagrams to be drawn with width=2. But they aren't! They are drawn with width="1"! Checking t_diagramlinks for the instance of the line indicates the Style.LWidth value is set to "0" for that diagram link, meaning "use the default value" (in this case, that is shown in t_connector.IsBold - which is set to "0", meaning use the profile value)! But instead of drawing the width="2" as required by the profile, they are drawn with width="1!
Why was the line on the first diagram drawn correctly?
Well, an investigation of the t_diagramlinks for the instance of the line indicates the Style.LWidth value is set to "2" (not "0"!) In other words, instead of saying "use the default value", it explicitly sets the width to the default value! Inconsistency!
This inconsistency means that if we change the value in t_connector.IsBold (say to "3"), then ALL the OTHER diagrams will change their line width to the new "default", but the original will remain at width="2"! Inconsistency!
What needs to be fixed?
Firstly, the "0" value in all the relevant locations must mean "use the applicable default". In t_digramlinks.Style.LWidth: this means using the setting in t_connector.IsBold! For t_connector.IsBold, this means using the value in the profile. The default value should then cascade so that if the width is set to "0" in both places and the profile changes, the rendering automatically changes (as one should expect)! The first time the line is drawn on the diagram, the t_digramlinks.Style.LWidth value should be set to "0" and only changed if the local value is changed using the widget! This rectification will maintain consistency across all diagrams when the linewidth has not been explicitly changed!
Lastly, there is NO getDefaultLineWidth() for shapescripts (analogous to getDefaultFillColor() and getDefaultLineColor()). This lack may have contributed to the problems described above (but may not). When fixing the defect reported above, adding the getDefaultLineWidth() to the "Color Queries" would allow better flexibility in shapescripts to achieve the desired ends.
Reported,
Paolo