Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Ian Mitchell on June 16, 2022, 08:38:01 pm

Title: MDG Extending 'Package' with new icon
Post by: Ian Mitchell on June 16, 2022, 08:38:01 pm
Does anyone know why EA doesn't allow MDGs to create alternate project browser images for extensions to 'package' ? There's just a 1-liner in the documentation (V15.2:  'This does not apply to package elements").
Has anyone tried to get around this by defining a specialization of an element instead - for example as a extension of 'class' - and using this in place of a specialized package? Seems like most things will still work, except stuff like 'show package contents' in diagrams. Are there any big gotchas out there ?
I seem to want this capability quite a lot, to show the modeler that not all packages are alike, and some should have certain kinds of element, and other ones other kinds. Seems intuitive.
Is it possible to decorate the built-in icon?
@Sparx - is this just something you didn't get around to yet, or is there some deep reason why we shouldn't do it?
Title: Re: MDG Extending 'Package' with new icon
Post by: Modesto Vega on June 16, 2022, 09:11:20 pm
Hi Ian,

My understanding is that it should work but you need to also set the metatype. But although I extended the package, I have never tried using a different icon.
Title: Re: MDG Extending 'Package' with new icon
Post by: Paolo F Cantoni on June 16, 2022, 09:54:54 pm
Does anyone know why EA doesn't allow MDGs to create alternate project browser images for extensions to 'package' ? There's just a 1-liner in the documentation (V15.2:  'This does not apply to package elements").
Has anyone tried to get around this by defining a specialization of an element instead - for example as an extension of 'class' - and using this in place of a specialized package? Seems like most things will still work, except stuff like 'show package contents' in diagrams. Are there any big gotchas out there?
I seem to want this capability quite a lot, to show the modeller that not all packages are alike, and some should have certain kinds of elements, and others ones other kinds. Seems intuitive.
Is it possible to decorate the built-in icon?
@Sparx - is this just something you didn't get around to yet, or is there some deep reason why we shouldn't do it?
Hi Ian,
It won't surprise you to find "I've been here, done that!"!  We have a number of package stereotypes each with its own icon.  They are managed in the normal way (icon attribute on the stereotype).  However, the instantiation of the icon in the browser during EA use can be intermittent.  Most of the time it's fine, but occasionally it "disappears" to return with a reload of the package content.

Sparx refused to fix what (to me and others) appeared to be a defect.

There you have it.
Paolo
Title: Re: MDG Extending 'Package' with new icon
Post by: Paolo F Cantoni on August 30, 2022, 01:46:08 pm
Hi Ian,

You may or may not be aware of this. v16 - Stereotyped Package Icons are incorrectly assigned to unstereotyped (https://sparxsystems.com/forums/smf/index.php/topic,47160.msg275192.html#msg275192)

Paolo