Book a Demo

Author Topic: Visualizing element complexity  (Read 6857 times)

mrblack12

  • EA User
  • **
  • Posts: 67
  • Karma: +0/-0
    • View Profile
Visualizing element complexity
« on: September 06, 2016, 06:46:01 pm »
Hi,

I'm wondering whether it's possible to show an element's complexity - defined in the General properties window - on a diagram, perhaps by use of colours (like how you can show the status of an element). Any thoughts on this?

Thanx,
Rick

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Visualizing element complexity
« Reply #1 on: September 06, 2016, 07:22:29 pm »
Try t this one:

Code: [Select]
shape main {
  if (HasProperty("Complexity", "Difficult")) {
    setfillcolor(255,0,0);
  }
  drawnativeshape();
}

q.

mrblack12

  • EA User
  • **
  • Posts: 67
  • Karma: +0/-0
    • View Profile
Re: Visualizing element complexity
« Reply #2 on: September 06, 2016, 07:54:51 pm »
Qwerty,

without coming over like a complete noob: what do I do with this? It looks like a script but I'm not really that comfortable with scripts. How do I run it?
Rick

OpenIT Solutions

  • EA User
  • **
  • Posts: 555
  • Karma: +9/-1
    • View Profile
Re: Visualizing element complexity
« Reply #3 on: September 06, 2016, 08:11:54 pm »
Hi,

A simpler approach that might meet your requirement might be Diagram Filters. Search the help for 'Diagram Filters' you will see that you can apply filters based on attributes, such as 'Complexity'. You could create a different filter for each Complexity value. Then apply the filter as required, ie to highlight elements with Complexity set to 'Difficult'.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Visualizing element complexity
« Reply #4 on: September 06, 2016, 08:24:29 pm »
It's a shape script. You need to assign it to a stereotype which can be applied to an element. Any such stereotyped element will appear in red if the complexity is set to Complex.

Open Project/Settings/UML Types
Create (or choose) a stereotype (e.g. complexity)
Assign the base class (generally that would be class or <all>)
Choose Override Appearance/Shape Script/Edit
Paste the script above and save

Now assign the stereotype <<complexity>> to class on a diagram and change its complexity in the properties and see what happens.

q.
« Last Edit: September 06, 2016, 08:29:08 pm by qwerty »

mrblack12

  • EA User
  • **
  • Posts: 67
  • Karma: +0/-0
    • View Profile
Re: Visualizing element complexity
« Reply #5 on: September 07, 2016, 12:21:28 am »
Qwerty,

works like a charm, man! Cheers... All I have to figure out now is what the most appropriate colours are and whether I want the how fill to bechanged or maybe just the border (= SetPenColor, i'm guessing?).

And @OpenITSolutions: I was aware of the diagram filtering option, gonna give that a try as well....

Thanks alot you guys!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Visualizing element complexity
« Reply #6 on: September 07, 2016, 01:34:49 am »
Just type "Set" in the shape editor and hit ctrl-space :-)

q.

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1353
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Visualizing element complexity
« Reply #7 on: September 07, 2016, 07:04:03 am »
Or the easy way is just add a diagram legend and use auto legend to set up a colour for each value of complexity value.
See the V12.1 user guide for example using priority [just change that to complexity]
http://www.sparxsystems.com/enterprise_architect_user_guide/12.1/building_models/diagram_legends.html

The dialog box is showing here describing all the settings
http://www.sparxsystems.com/enterprise_architect_user_guide/12.1/building_models/add_a_legend.html

Couldn't be easier  ;)
Happy to help
:)