Author Topic: Default appearance of elements in an MDG  (Read 6015 times)

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1137
  • Karma: +30/-8
    • View Profile
Default appearance of elements in an MDG
« on: February 19, 2022, 02:53:10 am »
We have developed an MDG and would like all elements to have a default appearance - specifically, white fill, and black border and font. Our original approach was to set the appearance in the ShapeScripts. However, this prevents users from later choosing other colours to better explain the diagrams.

What is the best way to have all elements in the MDG rendering with a default appearance without preventing users from choosing other colour later on.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Default appearance of elements in an MDG
« Reply #1 on: February 19, 2022, 03:20:08 am »
Well, you "could" query the user colors in the shape script. But that would require some flag to decide between user and shape defined colors. Maybe you could go with template packages?

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Default appearance of elements in an MDG
« Reply #2 on: February 19, 2022, 03:34:02 am »
You can set the default appearance (F4) in your stereotypes. Generating the UML profile will then copy that as the default for your stereotypes. (there are a few checkboxes in the generate dialog that you have to check)

The default color can be changed by the user (as opposed to the color in the shapescript)

Geert

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1319
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Default appearance of elements in an MDG
« Reply #3 on: February 19, 2022, 06:25:27 am »
You can set the default appearance (F4) in your stereotypes. Generating the UML profile will then copy that as the default for your stereotypes. (there are a few checkboxes in the generate dialog that you have to check)

The default color can be changed by the user (as opposed to the color in the shapescript)

Geert
The default appearance is the way to go if you creating own stereo types but not extending other MDG. Recently found that some but not all the ArchiMate elements colour is set using default appearance. Which reminds me I should raise a bug.
Happy to help
:)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Default appearance of elements in an MDG
« Reply #4 on: February 19, 2022, 08:32:58 am »
You can set the default appearance (F4) in your stereotypes. Generating the UML profile will then copy that as the default for your stereotypes. (there are a few checkboxes in the generate dialog that you have to check)

The default color can be changed by the user (as opposed to the color in the shapescript)

Geert
The default appearance is the way to go if you creating own stereo types but not extending other MDG. Recently found that some but not all the ArchiMate elements colour is set using default appearance. Which reminds me I should raise a bug.
I think ArchiMate 2 colors used to be all hard coded in the shapescript, IIRC this has been fixed in ArchiMate 3 (or maybe even a newer version of ArchiMate 2)
They might have forgotten a few of course.

Geert

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1137
  • Karma: +30/-8
    • View Profile
Re: Default appearance of elements in an MDG
« Reply #5 on: February 22, 2022, 01:28:41 am »
You can set the default appearance (F4) in your stereotypes. Generating the UML profile will then copy that as the default for your stereotypes. (there are a few checkboxes in the generate dialog that you have to check)

The default color can be changed by the user (as opposed to the color in the shapescript)

Geert
Thanks Geert, do you mean changing the default appearance of the metaclass being extended - i.e., select the metaclass, right click and change the default appearance? Do you mean something else? If so, what do you mean?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Default appearance of elements in an MDG
« Reply #6 on: February 22, 2022, 02:42:26 am »
No, select you stereotype (that extends a metatype) and press F4 to change the default appearance.

Geert

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1137
  • Karma: +30/-8
    • View Profile
Re: Default appearance of elements in an MDG
« Reply #7 on: February 22, 2022, 04:38:44 am »
No, select you stereotype (that extends a metatype) and press F4 to change the default appearance.

Geert
The results are really odd. The only setting that appears to be applied is the fill, the line colour and font colour seem to be ignored. I think I ticking the right boxes when generating the profile.

And the results are not consistent.
« Last Edit: February 22, 2022, 05:18:26 am by Modesto Vega »

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1137
  • Karma: +30/-8
    • View Profile
Re: Default appearance of elements in an MDG
« Reply #8 on: February 22, 2022, 05:20:12 am »
Jus to add something else to the mix. The profile XML file includes the following attributes for each stereotype:

Code: [Select]
<Stereotype name="Test" notes="" cx="0" cy="0" bgcolor="16777215" fontcolor="0" bordercolor="0" borderwidth="1" hideicon="0">
How do I decipher the  bgcolor, fontcolor and bordercolor values?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Default appearance of elements in an MDG
« Reply #9 on: February 22, 2022, 06:19:16 am »
I'm sure I've done it wiht fontcolor and bordercolor as well before.

I did sometimes get weird results where the colors were suddenly forgotten. I think it had something to do with loading the diagram or something.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Default appearance of elements in an MDG
« Reply #10 on: February 22, 2022, 08:20:52 am »
Jus to add something else to the mix. The profile XML file includes the following attributes for each stereotype:

Code: [Select]
<Stereotype name="Test" notes="" cx="0" cy="0" bgcolor="16777215" fontcolor="0" bordercolor="0" borderwidth="1" hideicon="0">
How do I decipher the  bgcolor, fontcolor and bordercolor values?
Make the decimal a hex number and you have 3 bytes for RGB. (see also p. 65 of my Inside book)

q.

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1137
  • Karma: +30/-8
    • View Profile
Re: Default appearance of elements in an MDG
« Reply #11 on: February 23, 2022, 02:19:42 am »
Judging by what I can see in profile XML, for example.
Code: [Select]
<Stereotype name="Test" notes="" cx="0" cy="0" bgcolor="16777215" fontcolor="0" bordercolor="0" borderwidth="1" hideicon="0">
Assuming 16777215 is #FFFFFF - i.e., white - and 0 is #000000 - i.e., black. Sparx is not honouring the colour when rendering the diagram. For elements using ShapeScripts not making use of the DrawNativeShape() method, the theme appears to be overriding the default colours.

Oddly if the shape script makes use of the DrawNativeShape() method, this is not the case.

I am also no convinced that 0 is black, I can see values of -1 in other elements of the profile.


Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1137
  • Karma: +30/-8
    • View Profile
Re: Default appearance of elements in an MDG
« Reply #12 on: February 23, 2022, 03:56:12 am »
As suspected 0 does not really mean black, it means something else. As soon as I change the font and border colour to something that does equal to 0 - e.g., fontcolor="263172" bordercolor="263172" (#40404 or RGB(4,4,4)) Sparx honours the default colours.

To allow a user to change the appearance the ShapeScript must not have any statement setting any colours.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Default appearance of elements in an MDG
« Reply #13 on: February 23, 2022, 04:26:27 am »
Yes, -1 is black. That's what I documented in my book... It's just sparxian.

q.