Book a Demo

Author Topic: Dual decorations when switching MDG  (Read 6698 times)

Mats Gejnevall

  • EA User
  • **
  • Posts: 98
  • Karma: +1/-0
    • View Profile
Dual decorations when switching MDG
« on: January 28, 2017, 12:55:02 am »
I just had to change MDG from Archimate to my own since compartments does not work in Archimate. I exported my elements to a csv file, changed the Archimate sterotypes to my sterotypes and imported. I worked fine, but one problem occured. Now my elements have both the Archimate decoration and my decorations in the top right hand corner (NE).

Does anyone know how to remove the Archimate decoration? The alternative is to import my elements as new, but I have a lot of relations between the current elements and it would be a big job to redo them!!!!

Thanks for any help!!!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Dual decorations when switching MDG
« Reply #1 on: January 30, 2017, 11:13:58 am »
Hi Mats,

We've done the same thing.  Your "ArchiMate" icons may not be ArchiMate icons, but the underlying UML icons which are hard coded into Sparx.  We found that for certain types of base objects, such as Activity, we had to overlay the UML icon with a suitably coloured rectangle and then overly THAT with our own icon.  Not the most elegant solution, but it works.

If you have disabled the ALL the ArchiMate MDGs in the Configure | Technology dialog, then the icons are most likely the UML ones.  You can prove that by then disabling your MDG; the underlying icons will still remain - unchanged.  We use that behaviour to ensure that we have correctly applied our MDG when we upgrade our MDG "on the fly".

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Mats Gejnevall

  • EA User
  • **
  • Posts: 98
  • Karma: +1/-0
    • View Profile
Re: Dual decorations when switching MDG
« Reply #2 on: February 01, 2017, 02:08:13 am »
Thanks Paolo, it is the UML shapes. I tried creating overlay the the UML symbol and it works.... until you change the size of the element. Have not been able to find a away that really solves that problem. Could you share how you did it?

We alway disable all the other Technologies to have better control over what people enter.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Dual decorations when switching MDG
« Reply #3 on: February 01, 2017, 09:13:26 am »
Specifically, which stereotype?
The Sparx Team
[email protected]

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Dual decorations when switching MDG
« Reply #4 on: February 01, 2017, 10:42:30 am »
Thanks Paolo, it is the UML shapes. I tried creating overlay the UML symbol and it works.... until you change the size of the element. Have not been able to find a away that really solves that problem. Could you share howhttp://sparxsystems.com/forums/smf/Themes/default/images/bbc/code.gif you did it?

We alway disable all the other Technologies to have better control over what people enter.
We also ensure we have as few technologies as possible "in play".

Here's a snippet from one of our shapescripts.  It's used in the "decoration" subshape:
Code: [Select]
orientation="NE";
setorigin("NE",-20,5);
setpen(getuserfillcolor());
setfillcolor(getuserfillcolor());
rectangle(0,-10,110,120);
The origin location may vary depending upon the underlyuing non-rectangular shape.  After this snippet, you create the "real" decoration.

Is that enough detail?

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Mats Gejnevall

  • EA User
  • **
  • Posts: 98
  • Karma: +1/-0
    • View Profile
Re: Dual decorations when switching MDG
« Reply #5 on: February 02, 2017, 02:12:16 am »
Thanks Paolo
You shapescript actually did not work. It hid my own decoration, but not the UML decoration.

But it inspired me to try another solution. I have now added a much similar shapescript to the main of the elements with UML decorations which works well and does not scale (same as the UML decorations). It has one advantage, the rectangle actually makes the label text wrap (at least in my MDG file tests, but not in my full blown model). Earlier it was overwriting the decoration.

An addition small problem is that the getuserfillcolor() calls seem to return a slightly different color. It can be seen in the image I will try to include.

Here is the script:
shape main
{
   scalable = false; // Very important
   drawnativeshape();
   setorigin("NE",-31,1);
   setpen(getuserfillcolor());
   setfillcolor(getuserfillcolor());
   //Draw a rectangle around the UML decoration (rectangle notion)
   rectangle (0,0,28,23);
}
And I could not find any way of including a picture of the resulting element(s), but they have a slightly different color in the rectangle.
/Mats


Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Dual decorations when switching MDG
« Reply #6 on: February 02, 2017, 11:02:29 am »
Hi Mats,

You should be creating your icon in the decoration subshape (after the snippet I gave you).  It's not a good idea to do it in the main shape. As you discovered, decoration overwrites the main shape which makes it very powerful and useful.  Also, decoration appears to have scalable = false by default and doesn't affect your main shape which can still be scalable.   We've done a LOT of experimenting and come to the conclusion that rendering icons in a decoration subshape is the best approach.

If you are using a gradient fill. the colour appears different.  It's actually the same colour (as you can show by switching off gradient fill) but since EA seems to restart the gradient on a per sub-shape basis, the gradients are different and therefore stand out.

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Mats Gejnevall

  • EA User
  • **
  • Posts: 98
  • Karma: +1/-0
    • View Profile
Re: Dual decorations when switching MDG
« Reply #7 on: February 04, 2017, 02:05:37 am »
Hi Paolo
I tried doing that but the UML element decoration comes on top of my decoration. I have not found any setting that puts my decoration on top.

But the gradient setting removed the the other problem!!

Thanks
Mats