Author Topic: Default color on UML Profile Stereotypes  (Read 3624 times)

windrider

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Default color on UML Profile Stereotypes
« on: September 26, 2012, 06:48:31 pm »
Hi all,

I created a UML Profile with stereotypes to incorporate it into an MDG Technology File with a Toolbox etc. That all works fine.

However, I have not figured out yet, how I can set the default color for a stereotype defined in a UML Profile like I can define it for custom stereotypes using the menu "Settings" -> "UML Types ...".

I can set the default appearance, but this is not applied automatically on existing instances of a stereotype when I change the color so I would like to leave the default appearance "fill" setting to "default" and define the default color.

I already tried to specify the custom stereotypes again a second time using the above mentioned menu, but this does not work either since the setting are not used when the custom stereotype is already defined in an MDG Technology.

Does anyone know to set the default color in the UML Profile?

Regards, Lars

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8038
  • Karma: +118/-20
    • View Profile
Re: Default color on UML Profile Stereotypes
« Reply #1 on: September 27, 2012, 09:24:44 am »
Your best bet is to set the default appearance in the profile.

That currently acts by setting the default appearance of any elements created with that stereotype, which is the cause of the behavior you have noted for existing elements.

Without going into details, I believe if you do that the colour will be applied to existing elements (which don't specify another colour) in a future version.

medina

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: Default color on UML Profile Stereotypes
« Reply #2 on: September 28, 2012, 06:46:57 pm »
Go to your MDG diagram where you have your stereotypes. Click on the Stereotype you want to change default color on and press F4. Choose default color and default border color. Generate MDG technology file and you are done.
 
To update in existing elements in all diagrams you click on the Stereotype in your toolbox and choose Synchronize Stereotype. I am not sure this will update to the new default color, someone here should know and confirm if this is true?

You should read this before you synchronize stereotype (at work right now so don't have time to read everything the page, i think it's the right one): http://www.sparxsystems.com/enterprise_architect_user_guide/modeling_languages/synchronizetagsandconstrain.html

windrider

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Default color on UML Profile Stereotypes
« Reply #3 on: September 28, 2012, 07:55:21 pm »
Now, here is the solution I got from the support team and this is working:

To have the stereotype's appearance apply to existing elements as you described you will need to use a shape script.  See the "Shape Scripts" topic in EA help for details.

The shape script appearance applies immediately when changing an element's stereotype.  If you want to use the default element shape with only minor variations you can achieve this by using the drawnativeshape() method.  For example...

shape main
{          
      setfillcolor(255,0,0);
      drawnativeshape();
}

Hope that might help others as well. The other suggestions made in this topic do not work, by the way.

Regards!