Author Topic: Assign shape script to topic of mind map  (Read 5176 times)

Rüdiger Engelberger

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Assign shape script to topic of mind map
« 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

Paulus

  • EA User
  • **
  • Posts: 152
  • Karma: +0/-0
    • View Profile
Re: Assign shape script to topic of mind map
« Reply #1 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
« Last Edit: March 21, 2013, 07:08:54 am by pmaessen »

Rüdiger Engelberger

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Assign shape script to topic of mind map
« Reply #2 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

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Assign shape script to topic of mind map
« Reply #3 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.

Rüdiger Engelberger

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Assign shape script to topic of mind map
« Reply #4 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





qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Assign shape script to topic of mind map
« Reply #5 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.

Rüdiger Engelberger

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Assign shape script to topic of mind map
« Reply #6 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

OpenIT Solutions

  • EA User
  • **
  • Posts: 555
  • Karma: +9/-1
    • View Profile
Re: Assign shape script to topic of mind map
« Reply #7 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...

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Assign shape script to topic of mind map
« Reply #8 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.