Author Topic: Controlling the compartment title/heading  (Read 3598 times)

PeteC

  • EA User
  • **
  • Posts: 91
  • Karma: +1/-0
    • View Profile
Controlling the compartment title/heading
« on: December 03, 2020, 01:01:00 am »
Depending on the diagram, elements sometimes have the heading or title of the compartment (e.g. Parts, Properties) followed by the list of objects in that compartment.

But I have a diagram on which none of the compartments have their heading/title. It makes it hard to understand the diagram. It is my own Block extended from a Class and generalised from a SysML Block.

There is an example here exactly how I'd like it to appear: https://sparxsystems.com/enterprise_architect_user_guide/14.0/modeling_tools/example_scripts.html
Scroll down about half way to the Attenuator element. Where the Tags have a heading (appropriately of "tags"). There is nothing in the shapescript of that example that adds the heading.
If I paste that exact example into my shapescript I also don't get the "tags" heading.

Do I need to write the text in my own shapescript? If so, how does that integrate with the Diagram properties to turn compartments on and off?

Or (maybe more likely) is there a menu item that I have not been able to find that controls whether compartments have titles or not?
« Last Edit: December 03, 2020, 01:18:05 am by PeteC »

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Controlling the compartment title/heading
« Reply #1 on: December 06, 2020, 08:34:31 pm »
Hi Pete,


I think you're after custom compartments. These allow you to add your own compartments with their own headers.

Do I need to write the text in my own shapescript? If so, how does that integrate with the Diagram properties to turn compartments on and off?

The integration is a bit shaky, but you'll see the names of your custom compartments show up in the Compartment Visibility dialog. I think they only appear if the shape script's conditions are met so that the compartment will have contents; this means you can enable a compartment, make changes to the element, and then the conditions change and the option vanishes so you can't disable the compartment, that kind of fun stuff.
In general this functionality is too cumbersome and buggy to be worth the effort, but if it's for a very limited situation where the modeller knows exactly what they're doing and how the whole thing works, it can be made to sort of work. Ish.

HTH,


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