Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: Rüdiger Engelberger on March 20, 2013, 11:29:50 pm

Title: Assign shape script to topic of mind map
Post by: Rüdiger Engelberger on March 20, 2013, 11:29:50 pm
Hi,

I think I don't understand the basic concept of profiles / stereotypes in EA.

What I would like to do:

Assign a shape script to a topic of a mind map.

My idea to do this:

When I create a new topic in a mind map the stereotype "Topic" is assigned by default. When I click on the button next to the stereotype field in the properties dialog then I see that there are several profiles. One of them is called "MindMapping". When I choose that then I see that the stereotype "Topic" is checked. Clear for me.

Then my idea was to find the stereotype "Topic" and define a shape script for that stereotype.

But the only way to define layout settings for stereotypes I found is in "Settings" / "UML Types". But in this dialog you only find UML stereotypes.

Does anybody have an idea how to access other "built in" stereotypes like "Topic" of profile "MindMapping"?

Thanks!

Rüdiger Engelberger
Title: Re: Assign shape script to topic of mind map
Post by: Paulus on March 21, 2013, 07:00:07 am
Hi Rüdiger,

You can't, at least not as a default for all Topic elements, and not using an UML stereotype since the Topic stereotype itself uses a shapescript to overrule the default shape of the Class element from which it derives, and this will also prevent shapescripts from UML stereotypes you add to take effect.

You can however change the way a single Topic element looks by selecting an alternate image (ctlr+shift+W).

[edit]I just found out that you -can- use a UML stereotype using a metafile iso shapescript to overrule the Topic shape (you can use <all> as base for the UML stereotype). You still need to set the additional stereotype by hand though[/edit]

best regards,

Paulus
Title: Re: Assign shape script to topic of mind map
Post by: Rüdiger Engelberger on April 03, 2013, 01:11:49 am
Hi Paulus,

Many thanks for your answer.

I think I got your hint to create a custom stereotype and additionally assign that to the element.

The only problem is that then you always have to assign that additional stereotype too.

What I basically want to do:

I want that topics (of a mind map) render differently (e.g.: different background color) if the status or the version has a specific value.

My idea was to have a shape script for the stereotype "Topic" which checks those attributes (status, version) and define a different color for  specific values.

I'm not even sure if it's possible to check for status and version. There are 2 methods HasTag and HasProperty ... is it possible to check those attributes with one of those methods?

Does anybody have an idea to solve my problem without additionally assigning custom stereotypes (which you would forget usually).

Thx!

Rüdiger
Title: Re: Assign shape script to topic of mind map
Post by: qwerty on April 03, 2013, 07:32:12 am
Try this one:
Code: [Select]
shape main {
      if (hasproperty("status", "Proposed")) {
            setfillcolor(255,0,0);
      }
      if (hasproperty("status", "Implemented")) {
            setfillcolor(0,255,0);
      }
      drawnativeshape();
}

q.
Title: Re: Assign shape script to topic of mind map
Post by: Rüdiger Engelberger on April 04, 2013, 02:53:58 am
The shape script works if I assign it to a custom stereotype and assign that stereotype to an object without stereotype (e.g.: class).

It also works when I assign it to a class with stereotype "table". So in that case 2 stereotypes are assigned ... "table" and my custom stereotype.

But when I assign my custom stereotype to a Topic (Mindmap) then it doesn't work. The rendering of the topic is not influenced by the shape script at all. In that case also 2 stereotypes are assigned: "Topic" and my custom stereotype.

So for me that whole stereotype stuff in combination with rendering seems a little bit strange to me.

Is there some logic which I don't understand!?

Thx!

Rüdiger




Title: Re: Assign shape script to topic of mind map
Post by: qwerty on April 04, 2013, 04:29:08 am
Mindmap elements are themselves drawn using a shape script. This is hidden in the according MDG. Only if you modify these, you will be able to see what you want.

q.
Title: Re: Assign shape script to topic of mind map
Post by: Rüdiger Engelberger on April 04, 2013, 10:59:58 pm
Hi,

Thx once more.

I figured out that the MDG for mindmapping consists of the file MindMapping.xml in C:\Program Files\Sparx Systems\EA\MDGTechnologies.

And I just found possibilities to activate / deactivate that MDG. For me it seems that there are no means to modify a MDG.

Only possibility to see is to manipulate the XML file. But shape scripts are binary, so little bit tricky.

Beside that ... if I modify that file then those changes relate to ALL my EA projects. And other people working on the same project doesn't have those changes until I provide the file to them.

Am I right or did I miss something?

Thx
Rüdiger Engelberger
Title: Re: Assign shape script to topic of mind map
Post by: OpenIT Solutions on April 04, 2013, 11:44:54 pm
No your right....

I beleive Sparx can provide a "Software Engineering" version of the built in MDG Technologies - ie a Sparx model of the MDG that you can edit...at a cost...
Title: Re: Assign shape script to topic of mind map
Post by: qwerty on April 05, 2013, 12:15:48 am
You are right with the implication on changes to the MDG. However, if you need to change the shape script inside you can do so. I posted it here more than once and now submitted an article on the community site (not yet published). I can post the unformatted contents here if you wish.

q.