Book a Demo

Author Topic: Refresh all diagrams after updating style  (Read 8739 times)

Barb Szczesniak

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Refresh all diagrams after updating style
« on: December 13, 2016, 01:35:23 am »
Does anyone know if Sparx ever did anything to improve style usage in diagrams? I found this posting from several years ago: http://sparxsystems.com/forums/smf/index.php/topic,29070.msg215871.html#msg215871

I just upgraded to v13 and thought this might have been implemented by now, but it appears not.

I have about 100 diagrams under one package of my model, each with a Text Element that uses a style I called Title. Now my client wants me to change the color of these titles. I set the new color on one diagram and updated my Title style. Since all of the other diagrams are not automatically updated with this color change, is there a way to refresh or reapply the style without
  • opening each diagram,
  • selecting the Text Element on the screen, and
  • selecting the style from the drop-down list?
I could even handle a Project Browser script if someone could give me the keys on how to code it.

Thanks for your help.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Refresh all diagrams after updating style
« Reply #1 on: December 13, 2016, 03:42:48 am »
Maybe Paolo can comment (since he mumbled something about Sparx having accepted his feature request). I wouldn't be surprised if this request still waits in one of Sparx' drawers.

Now, what you can (and likely have to) do is to write a script (as you imagined). It's not too difficult - basically. Unfortunately there is (to my knowledge) no named style. That is, if you apply a named style, EA will use the settings there and apply them (color etc.). Now the element has the attributes, but no relation to the style table. So what you could do is to find elements having style A and apply style B to them. Or you have some other wizardry that tells you by name, tag, stereotype or whatever how to color things. Now that you found all objects in all diagrams you can apply a new style. That will probably end in a mess...

What I'd recommend instead is to use stereotypes from a MDG and tagged values to apply. This way you can control coloring (and other things) much straighter.

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Refresh all diagrams after updating style
« Reply #2 on: December 13, 2016, 10:41:21 am »
Paolo only submitted the request.  There was no acceptance by Sparx.

@Barb,  submit a NEW feature request.  If you like my proposed solution, you could reference it in your request.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Barb Szczesniak

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Refresh all diagrams after updating style
« Reply #3 on: December 14, 2016, 12:47:07 am »
Thank you, Paolo and qwerty. At least I now know that I haven't missed the feature somewhere. I am not a developer or architect, but, if my description below is adequate, I would be happy to submit it as a new feature request. 

I don't know the ins and outs of the database, but it seems to me that, wherever EA records the instance of element A on diagram B, it is now storing the fill/color/font/etc. details of the style at the time it was applied.

You could still store this information for the case where someone overrides the default or applied style, but there could also be:
  • A 3-state column to indicate Default Style, Style Applied, Style Overridden. Default Style is not defined in the t_trxtypes table. Style Overridden would mean the user made manual changes to the Default Style or after applying a saved style.
  • A column with a reference to t_trxtypes.TRX_ID to link to the saved style that is applied.
When the diagram is rendered, if the 3-state column indicates Style Applied, the renderer would get the information for the style from the t_trxtypes table; otherwise, it would use the default or override style information.

Also, a Style attribute could be added to the Stereotype Settings, so you could set the t_trxtypes.TRX_ID to use for the stereotype.

Does this make sense and cover all the aspects we'd like to see in this feature?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Refresh all diagrams after updating style
« Reply #4 on: December 14, 2016, 01:29:24 am »
I guess it would be possible to do that. Though given the fact that Paolo's initial request is 7 years old, I would not give much on seeing it realized until Christmas.

q.

PWarren

  • EA User
  • **
  • Posts: 34
  • Karma: +1/-0
  • EA User - 13 Years
    • View Profile
Re: Refresh all diagrams after updating style
« Reply #5 on: December 16, 2016, 02:05:34 am »
I have a similar issue and request. It clearly states in the ver 13.0 User Guide, topic, Set an Element's Default Appearance, that you can apply an appearance change to all diagrams containing that element. The one I am now having to target, yet again is the default appearance for the Checklist element, lite blue background color, client wants it white.
<Quote from topic.>
All elements that you use have global default appearance settings for:
•The fill, border and font colors
•Font styles, including font face and size
•The border thickness

You define these settings on the 'Preferences' dialog. However, you can change the default appearance for a specific element on all diagrams on which it is found, using the 'Default Appearance' dialog.
</Quote from topic.>

I have yet to discover how to get this to work, in my prior versions of EA and now 13.
« Last Edit: December 16, 2016, 02:07:59 am by PWarren »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Refresh all diagrams after updating style
« Reply #6 on: December 16, 2016, 03:13:55 am »
The default appearance for elements can be accessed with F4. Though it can be locally overridden in a diagram.

q.

PWarren

  • EA User
  • **
  • Posts: 34
  • Karma: +1/-0
  • EA User - 13 Years
    • View Profile
Re: Refresh all diagrams after updating style
« Reply #7 on: December 16, 2016, 05:36:10 am »
Yup, know about the keyboard shortcuts and menu access. Issue is it does not apply changes 'globally' as noted above to all identical elements in all diagrams, just that diagram you are currently in.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Refresh all diagrams after updating style
« Reply #8 on: December 16, 2016, 06:35:17 am »
It does. There are 2 reasons why F4 won't apply. 1) you have local override in diagrams. 2) a shape script from a MDG is doing whatever it wants.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Refresh all diagrams after updating style
« Reply #9 on: December 16, 2016, 08:39:44 am »
The third reason is that you're not using the same element in multiple diagrams. Select the element and press Ctrl+U. If it is the same element you should see all of your diagrams there.

RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1297
  • Karma: +21/-4
  • Read The Help!
    • View Profile
Re: Refresh all diagrams after updating style
« Reply #10 on: December 16, 2016, 09:49:14 am »
Yes. Your statement "the default appearance for the Checklist element, lite blue background color, client wants it white" suggests that you want to change all elements of type Checklist. Or are you working on all uses of a single element named 'Checklist'?
There are many ways in which you can apply and, in most cases, change the appearance of objects on diagrams. All the options listed here are described in greater detail in the Help.

To set the global appearance of all elements throughout a model, use the 'Preferences' dialog; select the 'Start > Workspace > Preferences' ribbon option, then select 'Standard Colors' and 'Diagram | Appearance' from the options tree. There is an option on the Appearance page called 'Use Element Group Style', which will apply a particular colour to each element of a particular type or extensions of that type. I don't believe that you can change that colour as a preference definition.

To set the appearance of all elements of a specific type (e.g. Checklist) so that they have the required appearance as you create them, define or edit that appearance on an element template diagram in a Template Package. Alternatively, and with the same effect, define the elements in a Profile.

To override the global appearance and define a default appearance of a specific element (e.g. MyAccount) on all diagrams on which it occurs, set the Default Appearance for that element; right-click on the element and choose the 'Appearance | Default Appearance' option.

To override the global or default appearances of a specific INSTANCE of an element (e.g. MyAccount just on the Class diagram 'PayThem') select that element on that diagram and use the options on the Style panel of the Layout ribbon.

Some elements of a specific type (e.g. elements of type Class) might have a customized appearance that is applied using a stereotype that either defines fill, border and font settings, or that actions a ShapeScript. To change the appearance of all elements of that type and that stereotype, edit the stereotype settings or the ShapeScript. A stereotype overrides all other appearance definitions.

You can also apply a standard or customized Theme to all of your diagrams, or to specific diagrams. I'm not sure how flexible that is in changing the fill colour of all elements of a specific type; I don't think it was designed for that purpose.
Best Regards, Roy

PWarren

  • EA User
  • **
  • Posts: 34
  • Karma: +1/-0
  • EA User - 13 Years
    • View Profile
Re: Refresh all diagrams after updating style
« Reply #11 on: December 18, 2016, 11:38:13 am »
Thanks everyone for the feedback! I'll try these Monday. And yeah this is a standard element/artifact Checklist, which literally gives a custom 'list' of items to check off as completed, in our case a simple status progress. (I'm actually hoping to convince the client to replace it though.)