Author Topic: New Profile - Override ArchiMate - Shape Script  (Read 1448 times)

duncan.greenyer

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
    • View Profile
New Profile - Override ArchiMate - Shape Script
« on: March 31, 2023, 09:09:43 pm »
I'm extending Archimate using a profile when I add a shapescript the ArchiMate Actor icon is still being drawn how do I override this?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 12783
  • Karma: +532/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: New Profile - Override ArchiMate - Shape Script
« Reply #1 on: March 31, 2023, 09:46:50 pm »
I guess you'll have to redefine the decorations as well in your shapescript. See https://github.com/GeertBellekens/Enterprise-Architect-Shapescript-Library/tree/master/Archimate3 for the original Archimate shapescript.

Geert

duncan.greenyer

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
    • View Profile
Re: New Profile - Override ArchiMate - Shape Script
« Reply #2 on: March 31, 2023, 09:55:36 pm »
Its strange but redefining the decoration does not seem to prevent the original decoration from being rendered. This means I can still see the original decoration underneath.

qwerty

  • EA Guru
  • *****
  • Posts: 13428
  • Karma: +390/-299
  • I'm no guru at all
    • View Profile
Re: New Profile - Override ArchiMate - Shape Script
« Reply #3 on: April 01, 2023, 07:01:34 am »
IIRC, Paolo dealt with a similar issue and he plastered the original icon with some rectangle (though the color at the border won't match exactly due to the gradient of the base color).

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8508
  • Karma: +250/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: New Profile - Override ArchiMate - Shape Script
« Reply #4 on: April 01, 2023, 04:10:58 pm »
IIRC, Paolo dealt with a similar issue, and he plastered the original icon with some rectangle (though the color at the border won't match exactly due to the gradient of the base color).

q.
As q says, we had to turn off gradient fill otherwise, it looked "wrong".  Some might say "gradient fill" is an affectation, and we really haven't missed it.

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

duncan.greenyer

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
    • View Profile
Re: New Profile - Override ArchiMate - Shape Script
« Reply #5 on: April 03, 2023, 05:11:02 pm »
The problem is, if you use decoration to add a rectangle over the icon the decoration is 16x16 and the ArchiMate icons are larger and therefore are not completely covered. I have opted to create a new decoration icon with NW orientation so that both are displayed. Since its a specialization of ArchiMate it shouldn't matter butI hope one day we can dump shape script and move to SVG for better control.

qwerty

  • EA Guru
  • *****
  • Posts: 13428
  • Karma: +390/-299
  • I'm no guru at all
    • View Profile
Re: New Profile - Override ArchiMate - Shape Script
« Reply #6 on: April 03, 2023, 05:37:55 pm »
I doubt that SVG would be an alternative since you can not script it.

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8508
  • Karma: +250/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: New Profile - Override ArchiMate - Shape Script
« Reply #7 on: April 04, 2023, 08:02:18 am »
The problem is, if you use decoration to add a rectangle over the icon the decoration is 16x16, and the ArchiMate icons are larger and therefore are not completely covered. I have opted to create a new decoration icon with NW orientation so that both are displayed. Since it's a specialization of ArchiMate, it shouldn't matter but I hope one day we can dump the shape script and move to SVG for better control.
Just keep increasing the size until the underlying decoration is covered.  From memory, we've gone as high as 120x115.


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

duncan.greenyer

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
    • View Profile
Re: New Profile - Override ArchiMate - Shape Script
« Reply #8 on: April 04, 2023, 05:25:42 pm »
Cannot script SVG? I assume you mean there is not exposed object model in EA? Obviously SVG by its very nature is scriptable. You take the SVG parse it into an object model which then gives you the ability to call methods on those objects, the same way you can script SVG in a browser, just add the script to the SVG event.

qwerty

  • EA Guru
  • *****
  • Posts: 13428
  • Karma: +390/-299
  • I'm no guru at all
    • View Profile
Re: New Profile - Override ArchiMate - Shape Script
« Reply #9 on: April 04, 2023, 06:40:05 pm »
Cannot script SVG? I assume you mean there is not exposed object model in EA? Obviously SVG by its very nature is scriptable. You take the SVG parse it into an object model which then gives you the ability to call methods on those objects, the same way you can script SVG in a browser, just add the script to the SVG event.

How would you include "if x then render A else render B" in an XML structure?

q.

duncan.greenyer

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
    • View Profile
Re: New Profile - Override ArchiMate - Shape Script
« Reply #10 on: April 04, 2023, 07:23:48 pm »
I would use the same technique as in a browser:

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500">
    <script>//<![CDATA[
        …code…
    //]]>
    </script>
</svg>


qwerty

  • EA Guru
  • *****
  • Posts: 13428
  • Karma: +390/-299
  • I'm no guru at all
    • View Profile
Re: New Profile - Override ArchiMate - Shape Script
« Reply #11 on: April 04, 2023, 07:42:00 pm »
Oh! I was not aware of that. Probably means you have to code some Java-like stuff?

q.

duncan.greenyer

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
    • View Profile
Re: New Profile - Override ArchiMate - Shape Script
« Reply #12 on: April 04, 2023, 07:51:55 pm »
Well it would be Javascript but the level of control would far exceed ShapeScript as we could not only have If then else but loops etc... or event make other calls when elements are about to be rendered

qwerty

  • EA Guru
  • *****
  • Posts: 13428
  • Karma: +390/-299
  • I'm no guru at all
    • View Profile
Re: New Profile - Override ArchiMate - Shape Script
« Reply #13 on: April 04, 2023, 09:21:56 pm »
Yes, probably. But then you would stumble over the performance issue in quite some cases. Which is why shape script is so primitive. Anyway, unless we all are supplied with enough Q-bits there will likely be no progress in that direction.

q.

duncan.greenyer

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
    • View Profile
Re: New Profile - Override ArchiMate - Shape Script
« Reply #14 on: April 04, 2023, 10:13:46 pm »
I don't think its going to take quantum computing just a better Javascript engine like V8.