Book a Demo

Author Topic: MDG Techno / Shape script : overlap between decoration and text ?  (Read 9673 times)

Mesple

  • EA User
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Hi all,
I did a shape script for an extended element based on a class metatype (see below) and I have an overlap between the decoration (upper right position) and the name of the element depending of the lenght of the text.
Any idea to solve this issue?
Thanks a lot!
"
decoration Etape
{
 orientation="NE";
 image("Etape.png",0,0,100,100);
}

shape main
{
h_align = "center";
v_align = "center";
editablefield = "name";
roundrect(0, 0, 100, 100,10,10);
println("#name#");
   
} "

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: MDG Techno / Shape script : overlap between decoration and text ?
« Reply #1 on: June 05, 2017, 10:48:32 am »
Insert padding at the top of the shape so that the text doesn't overlap the decoration:
Code: [Select]
decoration Etape
{
orientation="NE";
image("Etape.png",0,0,100,100);
}

shape main
{
layouttype="border";
roundrect(0, 0, 100, 100,10,10);
addsubshape("padding","N");
addsubshape("name","center");

shape padding
{
preferredheight=16;
}

shape name
{
h_align = "center";
v_align = "top";
editablefield = "name";
println("#name#");
}
}
The Sparx Team
[email protected]

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: MDG Techno / Shape script : overlap between decoration and text ?
« Reply #2 on: June 06, 2017, 09:34:25 am »
Insert padding at the top of the shape so that the text doesn't overlap the decoration:
[SNIP]
There is, however, no such solution for drawnativeshape(); is there?

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

Mesple

  • EA User
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Re: MDG Techno / Shape script : overlap between decoration and text ?
« Reply #3 on: June 07, 2017, 04:18:22 pm »
Great, thanks a lot!
 :)
Olivier

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1353
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: MDG Techno / Shape script : overlap between decoration and text ?
« Reply #4 on: June 08, 2017, 06:10:00 am »
There is, however, no such solution for drawnativeshape(); is there?
Yeah I feel your pain. I've given up using drawnativeshape(); now as it just doesn't provide enough control. The point you make above is just one example. Many years ago I did create an archimate based MDG before it was available in sparx EA. When the Sparx EA archimate MDG came out I converted mine to using drawnativeshape() as all I wanted to do was add attributes. But then I found over the years I've converted them all back to having full shapescripts to provide the level of customisation needed. Kind of full circle.
Now Geert has provided all the shapescripts in Git you have a wide selection to choose from.
 
Happy to help
:)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: MDG Techno / Shape script : overlap between decoration and text ?
« Reply #5 on: June 08, 2017, 10:13:35 am »
There is, however, no such solution for drawnativeshape(); is there?
Yeah I feel your pain. I've given up using drawnativeshape(); now as it just doesn't provide enough control. The point you make above is just one example. Many years ago I did create an archimate based MDG before it was available in sparx EA. When the Sparx EA archimate MDG came out I converted mine to using drawnativeshape() as all I wanted to do was add attributes. But then I found over the years I've converted them all back to having full shapescripts to provide the level of customisation needed. Kind of full circle.
Now Geert has provided all the shapescripts in Git you have a wide selection to choose from.
So does that mean that you can fully simulate drawnativeshape()?  That is, generate a full rectangular form? 
Like you, we allow features (attributes and operations) to be allowed for any ArchiMate element.  But it seemed too hard to do it without drawnativeshape().  Also, are there performance issues?

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

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1353
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: MDG Techno / Shape script : overlap between decoration and text ?
« Reply #6 on: June 08, 2017, 07:39:52 pm »
So does that mean that you can fully simulate drawnativeshape()?  That is, generate a full rectangular form? 
Yes I have the following code to separate the shape for rectangular notation
Code: [Select]
if(hasproperty("rectanglenotation","0"))
{
...
}
else
{
...
}
Like you, we allow features (attributes and operations) to be allowed for any ArchiMate element.  But it seemed too hard to do it without drawnativeshape().  Also, are there performance issues

The attributes I add are via the MDG so they end up as tagged values. Don't add operations though not found a need whilst modelling in ArchiMate. No noticeable performance hit with a model of around 750MB and 42,000 elements, 2,300 Diagrams.

Only use ArchiMate for Enterprise Architecture level work. Integrate UML for detailed solution work and BPMN for modelling detailed processes in similar fashion mentioned in BizzDesigns blog
http://blog.bizzdesign.com/in-case-you-missed-it-combining-archimate-with-other-standards-techniques-summary

The reason I mentioned it is that I've seen a few architects try to use ArchiMate for detailed level design and end up struggling because the language was never meant for that level.


« Last Edit: June 08, 2017, 07:57:20 pm by Sunshine »
Happy to help
:)

Glassboy

  • EA Practitioner
  • ***
  • Posts: 1367
  • Karma: +112/-75
    • View Profile
Re: MDG Techno / Shape script : overlap between decoration and text ?
« Reply #7 on: June 09, 2017, 06:37:33 am »
The reason I mentioned it is that I've seen a few architects try to use ArchiMate for detailed level design and end up struggling because the language was never meant for that level.

It's actually remarkable how quickly Archimate becomes semantically void when trying to work at this level.

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1353
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: MDG Techno / Shape script : overlap between decoration and text ?
« Reply #8 on: June 09, 2017, 07:23:37 am »
It's actually remarkable how quickly Archimate becomes semantically void when trying to work at this level.
Its all about choosing the right tool for the job. ArchiMate is fine for the high level architectural models to link strategy, motivation, business, applications, infrastructure and migration. However you do need to switch modelling language when more details are needed. I can remember the days gone by before UML and I would see people trying to use notations from Booch, Rumbaugh, Jacobson, Yourdon etc. out of the intended purpose for which they were meant. Nothing seems to change. Kind of like my 9 year old daughter using a screw driver to hammer in a nail because that's what was in her hand at the time. That was a few years ago and she has since learnt when to use a hammer and a screw driver now.
Happy to help
:)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: MDG Techno / Shape script : overlap between decoration and text ?
« Reply #9 on: June 09, 2017, 09:46:58 am »
So does that mean that you can fully simulate drawnativeshape()?  That is, generate a full rectangular form? 
[SNIP]
Like you, we allow features (attributes and operations) to be allowed for any ArchiMate element.  But it seemed too hard to do it without drawnativeshape().  Also, are there performance issues

The attributes I add are via the MDG so they end up as tagged values. Don't add operations though not found a need whilst modelling in ArchiMate. No noticeable performance hit with a model of around 750MB and 42,000 elements, 2,300 Diagrams.

[SNIP]
Ah...so you didn't implement attributes as Attributes...   :D  My question was specifically about simulating the Feature compartments.

We do implement both Attributes and Operations (where appropriate) and every vertex has both a rectangular and one (or, occasionally, more than one) non-rectangular form.  We'd like to be able to better control widget placement in the rectangular form.

Paolo
« Last Edit: June 09, 2017, 10:33:42 am by Paolo F Cantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!