Book a Demo

Author Topic: Show Complexity on element in diagram  (Read 4858 times)

Robert Lelieveld

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Show Complexity on element in diagram
« on: April 10, 2015, 06:09:58 pm »
In the general settings of e.g. the Interface object of the UML deployment diagram, there is a standard property called Complexity.

I'd like to show that on the element in the diagram.
How can this be done?

Tagged values can be shown, but I rather not create a duplicate field.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Show Complexity on element in diagram
« Reply #1 on: April 10, 2015, 06:23:28 pm »
You can't show that (directly). Without checking this personally: a shape script would be able to display it, but only for stereotyped elements.

q.

Robert Lelieveld

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Re: Show Complexity on element in diagram
« Reply #2 on: April 10, 2015, 09:19:49 pm »
Hi qwerty,

Thanks!
I didn't know about Shape Script.

Currently I added this:
Code: [Select]
shape Main
{
      PrintWrapped("#Complexity#");
      DrawNativeShape();
}

Is it possible to have EA add this below the already shown Type and Name ? I tried to add a compartment (nothing happens) or add a decoration (in the center right over the Name), but can't make it to work.

- Robert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Show Complexity on element in diagram
« Reply #3 on: April 10, 2015, 10:09:15 pm »
Try this one:
Code: [Select]
decoration c {
  orientation = "s";
  PrintWrapped("#Complexity#");
}
and have a look into my Shape Script book :)

q.

Robert Lelieveld

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Re: Show Complexity on element in diagram
« Reply #4 on: April 10, 2015, 10:57:38 pm »
Nice!

Tried this:
Code: [Select]
decoration c {
      orientation = "s";
      PrintWrapped("Complexity #Complexity#");
}
However, this code will create two lines of which the second is outside of the shape.


Also tried this one:
Code: [Select]
shape Main
{
      SetCompartmentName("Complexity");
      AppendCompartmentText("#Complexity#");
      DrawNativeShape();
}

But no compartment is added?

The example in your book in chapter 2.5 is very nice. Might that only work with child elements and not with Main properties and values?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Show Complexity on element in diagram
« Reply #5 on: April 11, 2015, 01:01:53 am »
The compartment will not work this way. You can try a subshape instead (see p. 19). Shape Script has its peculiarities...

q.
« Last Edit: April 11, 2015, 01:02:54 am by qwerty »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Show Complexity on element in diagram
« Reply #6 on: April 15, 2015, 12:18:32 pm »
SetCompartmentName and AppendCompartmentText are only available for child/related element shapes.

Try just changing PrintWrapped to Print.