Book a Demo

Author Topic: Sparx Toolbox Icon  (Read 18974 times)

DavidM

  • EA User
  • **
  • Posts: 82
  • Karma: +0/-0
    • View Profile
Re: Sparx Toolbox Icon
« Reply #15 on: July 16, 2016, 11:02:57 am »
An update - Whatever image is generated in the Toolbar.XML is also being successfully transferred to the output XML generated by the MDG process.
I got that wrong earlier.

So I would say the error is either in the Toolbar.XML generation process (Does anyone know if there is a way to confirm the image?) or somehow when I Import the MDG XML into the target Sparx, something is going wrong.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13471
  • Karma: +571/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Sparx Toolbox Icon
« Reply #16 on: July 16, 2016, 04:24:55 pm »
what you have posted is the toolbox profile right?

You should not define the icon on the toolbox, only on the actual stereotype.
On the toolbox it is enough to select the stereotype, you don't have to set any other fields on the toolbox items.
If on the stereotype you have filled in the Metatype and linked to a correct bitmap image then it will appear on the toolbox.

This really is quite simple you know, I think you are trying to do too much.

Below an example of a toolbox profile of mine
Code: [Select]
<?xml version="1.0" encoding="windows-1252"?>
<UMLProfile profiletype="uml2">
<Documentation id="4F601B4B-B" name="BAM" version="1.0" notes="BAM"/>
<Content>
<Stereotypes>
<Stereotype name="BAM Instance" notes="Basic BAM instance Measures" cx="90" cy="70" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0">
<AppliesTo>
<Apply type="ToolboxPage"/>
</AppliesTo>
<TaggedValues>
<Tag name="BAM::BAM_Specification(UML::Activity)" type="" description="" unit="" values="" default="Specification"/>
<Tag name="BAM::BAM_ProcessSection(UML::Action)" type="" description="" unit="" values="" default="Process Section"/>
<Tag name="BAM::BAM_StartMarker(UML::Action)" type="" description="" unit="" values="" default="Start Marker"/>
<Tag name="BAM::BAM_EndMarker(UML::Action)" type="" description="" unit="" values="" default="End Marker"/>
<Tag name="BAM::BAM_ComposedBasicMeasure(UML::Action)" type="" description="" unit="" values="" default="Composed Basic Measure"/>
<Tag name="BAM::BAM_Duration(UML::Action)" type="" description="" unit="" values="" default="Duration"/>
<Tag name="BAM::BAM_DataValue(UML::Object)" type="" description="" unit="" values="" default="Data Value"/>
<Tag name="BAM::BAM_Frequency(UML::Action)" type="" description="" unit="" values="" default="Frequency"/>
<Tag name="BAM::BAM_DataStateOccurence(UML::Action)" type="" description="" unit="" values="" default="Data State Occurence"/>
<Tag name="BAM::BAM_ExecutionStateOccurence(UML::Action)" type="" description="" unit="" values="" default="Execution State Occurence"/>
</TaggedValues>
</Stereotype>
<Stereotype name="BAM Process" notes="Process Measures" cx="90" cy="70" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0">
<AppliesTo>
<Apply type="ToolboxPage"/>
</AppliesTo>
<TaggedValues>
<Tag name="BAM::BAM_Process(UML::Activity)" type="" description="" unit="" values="" default="Process"/>
<Tag name="BAM::BAM_AggregatedMeasure(UML::Action)" type="" description="" unit="" values="" default="Aggregated Measure"/>
<Tag name="BAM::BAM_ComposedAggregatedMeasure(UML::Action)" type="" description="" unit="" values="" default="Composed Aggregated Measure"/>
<Tag name="BAM::BAM_Filter(UML::Action)" type="" description="" unit="" values="" default="Filter"/>
<Tag name="BAM::BAM_TargetDefinition(UML::Action)" type="" description="" unit="" values="" default="Target Definition"/>
</TaggedValues>
</Stereotype>
<Stereotype name="BAM Actions and Dashboards" notes="" cx="90" cy="70" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0">
<AppliesTo>
<Apply type="ToolboxPage"/>
</AppliesTo>
<TaggedValues>
<Tag name="BAM::BAM_ProcessAbortion(UML::Action)" type="" description="" unit="" values="" default="Process Abortion"/>
<Tag name="BAM::BAM_ProcessSuspension(UML::Action)" type="" description="" unit="" values="" default="Process Suspension"/>
<Tag name="BAM::BAM_ProcessTrigger(UML::Action)" type="" description="" unit="" values="" default="Process Trigger"/>
<Tag name="BAM::BAM_Notification(UML::Action)" type="" description="" unit="" values="" default="Notification"/>
<Tag name="BAM::BAM_Dashboard(UML::Action)" type="" description="" unit="" values="" default="Dashboard"/>
</TaggedValues>
</Stereotype>
<Stereotype name="BAM Relations" notes="" cx="90" cy="70" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0">
<AppliesTo>
<Apply type="ToolboxPage"/>
</AppliesTo>
<TaggedValues>
<Tag name="BAM::BAM_Association(UML::Association)" type="" description="" unit="" values="" default="Association"/>
<Tag name="BAM::BAM_Flow(UML::ControlFlow)" type="" description="" unit="" values="" default="Flow"/>
<Tag name="ImagesOnly" type="" description="" unit="" values="" default="true"/>
</TaggedValues>
</Stereotype>
</Stereotypes>
<TaggedValueTypes/>
</Content>
</UMLProfile>

In the profile itself a single stereotype looks like this:
Code: [Select]
<Stereotype name="BAM_AggregatedMeasure" metatype="Aggregated Measure" notes="" cx="90" cy="70" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0">
<Icon type="bitmap" xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="bin.base64">Qk02AwAAAAAAADYAAAAoAAAAEAAAABAAAAABABgAAAAAAAADAADEDgAAxA4AAAAAAAAAAAAA
wMDAwMDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwMDAwMDAwMDAwMDAwMDA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwMDAwMDAwMDAwMDAwMDAAAAAAAAA
AAAAHBwcS0tLS0tLS0tLS0tLS0tLS0tLS0tLwMDAwMDAwMDAwMDAwMDAT09PAAAAAAAACwsL
wMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAJiYmAAAAAAAAJCQkwMDA
wMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDACwsLAAAAAAAATk5OwMDAwMDA
wMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAoaGhAQEBAAAAAAAAhYW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Mi8aoK9SI0TVQbrEU0hYjEt/df2ZaeqMtaXranvPNP5dO
T32a05DWNCGDlrhbkEundEI7GWvkYG5LK9pQgGMr5B3VMT+hKWY8WMygEWDuNrSZYu4H6zZZ
5IvFGOtvUAqwshJ7ttxgJbbS0RZdH9wv7hp0TZfUpA7G85BUzgJp0wAaI4xRDg3oDRHPDOoT
jOyRfTSpBQVW0mtay0/UIG+tTFSPKM4aXeCw9k8DkAG9YnTpE9HbeJojnvbeF1N9ZP8N5h3X
BmJpSn5JwpE3wFpM9EBcgSsmWqhNXmUZ+omYNhiz1NPVAYIz/CjUvKmMrY248rFl/XJsWR32
/LR/svA+xsKaIcuxsl3UHRoLr3akZiZWiuuhfJZJx6VMp4LhqmUZ7YvDXVTcJ+n8lXrEuoPj
Ht4cnB44zlfPNB/AjyfK7I8V0z2erUH0PZS9G1NqWU20SqvUPaL7VKeHWlYx6e83Tx3+zou5
cp9d6bVypiddXp6f6pTXKY78GCrtjbvJxg6Wffe8FnWRJQx3igelL9jke4X5+NCZP7nqyL2t
OzTHtCDdz13smyvM8e5pEP8xRmAcsUjuremVnYwGCM7tJfyTsC7v4gPZteNMjZBeC+fCwgnJ
M3pGbn16wF09wWrEZec/UEsBAhcLFAAAAAgAsHAkRwta0pP1AQAA/AYAAAcACQAAAAAAAAAA
AACAAAAAAHN0ci5kYXRVVAUABxSl6VVQSwUGAAAAAAEAAQA+AAAAKwIAAAAA</Image>
<AppliesTo>
<Apply type="Action">
<Property name="_tagGroupings" value="includeIdleTime=Duration;includeProcessingTime=Duration;includeSuspendedTime=Duration;"/>
<Property name="_tagGroups" value="Duration"/>
<Property name="context" value=""/>
<Property name="effect" value=""/>
<Property name="kind" value=""/>
</Apply>
</AppliesTo>
</Stereotype>

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Sparx Toolbox Icon
« Reply #17 on: July 16, 2016, 04:28:46 pm »
I have published a few articles about MDG here. Maybe they can give you a bit insight.

q.

DavidM

  • EA User
  • **
  • Posts: 82
  • Karma: +0/-0
    • View Profile
Re: Sparx Toolbox Icon
« Reply #18 on: July 17, 2016, 01:02:54 pm »
Thanks Geert and Qwerty.
Qwerty what I can see of you books looks great. Having a set of use cases that walk you through are what is needed I think in my opinion.  I'd certainly be interested in buying one. I am away from home for 1 week so I will check out when I get back.

Geert from what I can recall my steps were as follows :
I created a metatype toolboxitemimage.

I created a stereotype with the exact name as the element I referenced in the toolbox attribute to belong to the menu. In this stereo type I created an icon attribute which had the physical file and pathname. This stereo type was extent to the  toolboxitrmicon.

All of this was done following the one page example on the sparx web

site.http://www.sparxsystems.com/enterprise_architect_user_guide/10/extending_uml_models/icons_for_toolbox_items.html

I will be interested however in comparing your scripts to mine on my return to identify the issues.

I do believe somehow the official documentation is flawed however and I only know what I read there.


Thanks everyone!
Gary
« Last Edit: July 17, 2016, 01:11:26 pm by garyamz »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13471
  • Karma: +571/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Sparx Toolbox Icon
« Reply #19 on: July 17, 2016, 05:28:14 pm »
Gary,

They way you are doing is the hard way, in case you want the toolbox item to differ from the stereotype item.

The simple way is to set the icon on the stereotype (and not on the toolbox) and make sure to fill in the property metatype in the stereotype.

Then on the toolbox all you need to do is select the stereotype and you're done.

See also here:

http://sparxsystems.com/enterprise_architect_user_guide/12.1/building_models/supportedattributes_2.html

Quote
icon
Contains the bitmap file location of the 16x16-pixel icon displayed beside all elements defined by the Stereotype, in the Project Browser. This does not apply to Package elements. The icon is also automatically used as the Diagram Toolbox image wherever the stereotyped element is listed.
For a transparent background, you can use light grey - RGB (192,192,192).
For this attribute to work correctly, also set the _metatype attribute.

Geert

DavidM

  • EA User
  • **
  • Posts: 82
  • Karma: +0/-0
    • View Profile
Re: Sparx Toolbox Icon
« Reply #20 on: July 17, 2016, 07:04:00 pm »
Yes I'm with you Geert.
I'll give it a try as soon as I get home.
Thanks for your patience.

DavidM

  • EA User
  • **
  • Posts: 82
  • Karma: +0/-0
    • View Profile
Re: Sparx Toolbox Icon
« Reply #21 on: July 24, 2016, 05:30:07 am »
Hi Geert/Query
Just to let you know I tried the suggestions yesterday of putting the icon attribute in the original
Sterotype of the element and unbelievably - IT WORKED FIRST TIME.

When I think of the wasted days I spent trying to make it work as per the official Sparx instructions.

This is a lot leaner and cleaner and simpler.
Thank you all very much. True consultants!

Which begs the questions,why or why or why is Sparx documentation to such a poor standard?

If what they are suggesting doesn't work,or if there is something in addition that needs to be done, they need to fix it.

Thanks again
Gary

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Sparx Toolbox Icon
« Reply #22 on: July 24, 2016, 07:16:03 am »
Being polite I'd say: they give us a chance to make a bit of our living by writing better documentation ;-) It's weekend, so keep on being polite! Happy to see it worked for you finally. I had been in that valley of tears and feel with you. Luckily I have the opportunity to cry out (very) loud from time to time without shocking someone else.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13471
  • Karma: +571/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Sparx Toolbox Icon
« Reply #23 on: July 25, 2016, 05:09:10 pm »
To be fair, the "simple" way is also described somewhere in the help.
But being massive as it is it you can easily get lost in the documentation.

Geert