Book a Demo

Author Topic: Add Decoration to Shapescripts for Arcs  (Read 4597 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Add Decoration to Shapescripts for Arcs
« on: September 04, 2015, 06:06:36 pm »
As we are creating our new MDG shapescripts, which provide MUCH enhanced surfacing of item properties onto the diagram, we're finding the use of the Decoration subshape to be VERY useful (in creating Aspect Oriented Shapescripts ©) :)

However, they are ONLY available for vertex shapescripts - not arcs!

It would be REALLY COOL if decoration sub-shapes could be added to Arc shapescripts.

Thoughts?

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

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Add Decoration to Shapescripts for Arcs
« Reply #1 on: September 04, 2015, 06:51:03 pm »
What do you mean by decoration? Shape script allows to alter the appearance of arcs.

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Add Decoration to Shapescripts for Arcs
« Reply #2 on: September 08, 2015, 09:52:29 am »
Quote
What do you mean by decoration? Shape script allows to alter the appearance of arcs.

q.
Vertex shapescripts allow the keyword: "Decoration" as in:
Decoration <name>
{
   //Shape Script code
}

This allows you to simulate Aspect Oriented Shapescripts ©  where you can have a code snippet that places a particular decoration on the shape under a condition that it can test for itself.  For example, if a shape is tagged "Associative", I place a small (horizontal lozenge at top left.  The code snippet just tests the TV and renders.  Nicely contained.

You can't do the same with Arcs.  For example, I want to implement consistent derived arc rendering.  If I had decorations in Aarcs, I'd just define:
Decoration Derived
{
}

I'd be able to put the same code in the shapescripts, nicely localised to the decoration snippet.  Easier to maintain than having to embed code within the main body.

Paolo
« Last Edit: September 08, 2015, 10:04:19 am by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!