Book a Demo

Author Topic: Colouring Lines  (Read 9320 times)

Guy Manning

  • EA User
  • **
  • Posts: 74
  • Karma: +0/-0
  • UML Newbie :0)
    • View Profile
Colouring Lines
« on: August 21, 2015, 10:39:29 pm »
Hi
Just starting to look into MDG and wanted to know how (if possible) I can change all Association Links betrween Elements to be BLUE
Anybody scripted something like this and can givee me a "Dummies guide..." as to how to...
Ta
Guy

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Colouring Lines
« Reply #1 on: August 21, 2015, 11:17:46 pm »
You can write an add-in or script to change the color of the existing links yes.
If you are thinking about creating your own UML profile and create your own stereotype extending UML Association then you can set the color in a shape script.

Why don't you explain a bit more about what you are trying to achieve. That might lead to more specific, helpful comments.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Colouring Lines
« Reply #2 on: August 21, 2015, 11:41:56 pm »
You could define stereotyped connectors in your MDG and assign a shape script that makes them blue.

q.

Guy Manning

  • EA User
  • **
  • Posts: 74
  • Karma: +0/-0
  • UML Newbie :0)
    • View Profile
Re: Colouring Lines
« Reply #3 on: August 21, 2015, 11:44:35 pm »
Ok here is the reason for the visible colour...

We are working on quite big Projects with quite a number of Requirements. These arrive in a BRD from the Business.
This includes a matrix with Requirements and Aggregations plus Requirements where there is deeemd to be some 'Association' beteeen them (Some ad-hoc relationship)

Having IMPORTED these into an EA Diagram via the MDG Office integration, the Diagram is ful of Elements which are very densely interconnected through a variety of links (Trace, Aggregation, Association)

Although we will seperate these into smaller related packages soon...I wanted to see if we could colour code the links so e.g. Associations were Blue, Trace were Red etc to be able to see at a glance what type of relationship they were.

I wanted to apply this across the Prioject as Standard

Does that make sense?  :)
Guy
« Last Edit: August 24, 2015, 11:51:27 pm by GuyM »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Colouring Lines
« Reply #4 on: August 22, 2015, 04:46:28 am »
In that case you could run a simple script to apply the colors at your wish.

q.

Guy Manning

  • EA User
  • **
  • Posts: 74
  • Karma: +0/-0
  • UML Newbie :0)
    • View Profile
Re: Colouring Lines
« Reply #5 on: August 24, 2015, 11:50:17 pm »
Ok Qwerty thanks, can you tell me how this is done please?
so as to update the existing diagrams and also set it so that new diagrams also inherit the same colour scheme

Ta
Guy
« Last Edit: August 24, 2015, 11:52:44 pm by GuyM »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Colouring Lines
« Reply #6 on: August 25, 2015, 05:50:37 am »
I can't write the script for you.

But basically you iterate over DiagramLinks of the according diagram. Then you need to modify the style property of each according to your rules. If you have a decent set of rules it will take you one hour to stitch a basic script.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Colouring Lines
« Reply #7 on: August 25, 2015, 04:21:09 pm »
Guy,

I could write it for you if you are willing to pay for it.
Email me if you are interested and we'll work out the details

Geert

Guy Manning

  • EA User
  • **
  • Posts: 74
  • Karma: +0/-0
  • UML Newbie :0)
    • View Profile
Re: Colouring Lines
« Reply #8 on: August 25, 2015, 06:09:42 pm »
Hi Geert
Thanks for the offer but I am keen to learn how to do it for myself
As I have not created any scripts before, I was looking for pointers!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Colouring Lines
« Reply #9 on: August 25, 2015, 06:36:49 pm »
As a starter you can watch the webinar Introduction to Scripting

The example script I used there already deals with the style of connectors, so that should help get started.

Geert

Guy Manning

  • EA User
  • **
  • Posts: 74
  • Karma: +0/-0
  • UML Newbie :0)
    • View Profile
Re: Colouring Lines
« Reply #10 on: August 25, 2015, 10:41:30 pm »
Thanks Geert
 :)
« Last Edit: August 25, 2015, 10:41:48 pm by GuyM »

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Colouring Lines
« Reply #11 on: August 26, 2015, 06:02:14 pm »
Quote
Although we will seperate these into smaller related packages soon...I wanted to see if we could colour code the links so e.g. Associations were Blue, Trace were Red etc to be able to see at a glance what type of relationship they were.

I wanted to apply this across the Prioject as Standard

Does that make sense?  :)
Guy
Hi Guy,

Well, it does and it doesn't.

Telling an association apart from a trace is already simple -- associations are solid lines, and traces are dashed. Realization, another common relationship in requirement models, is also dashed but has a triangular arrow head instead of the open, plain V shape of trace and (directed) association.

So if that's all you're after, the colour won't add any information. Fundamentally, colour is not an information carrier in UML. The entire standard works in monochrome.

That said, there's nothing keeping you from adding colour to denote certain things in your own models. What triggered this response is really the last thing you said, about wanting to apply this colour-coding as a standard.

If you want that, you probably want any new or changed connectors to display the right colour automatically. The way to do that in EA is to create a UML profile where you define your own stereotypes for your connectors. In those stereotypes you specify the appearance of the connector, including its colour, by writing a shape script. You may also wish to create your own custom diagram type (with related toolbox pages) to facilitate creating these new connectors.

If you write an in-EA script, you have to run it manually every time you change something. For anything but a trivial model, this is unmanageable. Going the stereotype-and-shape-script route means EA runs the shape script for you whenever necessary (every refresh of the diagram).

Put another way, creating a profile is the proper UML way of doing it. If you want to create UML models, rather than draw pictures, that's the way to go.

Cheers,


/Uffe
My theories are always correct, just apply them to the right reality.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Colouring Lines
« Reply #12 on: August 26, 2015, 06:06:39 pm »
Going back over your OP I see you actually mentioned MDG Technologies there. That's EA's way of packaging adaptations such as UML profiles, so you're already in the right place.

For specifics on shape scripts, refer to the Help file under Extending UML Models -- MDG Technology SDK -- Shape Scripts.

/U
My theories are always correct, just apply them to the right reality.

Guy Manning

  • EA User
  • **
  • Posts: 74
  • Karma: +0/-0
  • UML Newbie :0)
    • View Profile
Re: Colouring Lines
« Reply #13 on: August 26, 2015, 09:42:08 pm »
Thanks Uffe
I have now used MDG to create new Bespoke Elements and Connectors for us