archimatetool / archi

Archi: ArchiMate Modelling Tool
https://www.archimatetool.com
MIT License
969 stars 270 forks source link

[Feature Request] Line style for elements (dotted, dashed) #702

Open johmut65 opened 3 years ago

johmut65 commented 3 years ago

Our company uses the outline style of EA concepts to visualize validation status: Draft = Dotted Line, Proposed = Small Dashes, Confident = Large Dashes, Validated = Solid Line. I believe this would be a great feature to add to Archi ... I can imagine "Outline Style" to be configurable by a manual selection out of a dropdown box, as it is in Visio, PowerPoint, ... Even better would be to add the ability to link the Outline Style to a custom Property that can be named "Validation Status" and assign an Outline Style to the different values for that property: Draft = Dotted Line, Proposed ...., Confident ...., Validated ......

Phillipus commented 3 years ago

Outline styles might be something for a future update but, like colours, won't be tied to a particular status or meaning. However, if outlines are implemented in a future update, it should be possible to set them according to some criteria using a jArchi script.

jbsarrodie commented 3 years ago

+1 on being able to customize outline. Agree with Phil that implementation should be kept as simple as possible and not include dynamic changes based on properties.

FWIW, I do have the same need though and I'm thinking about a potential implementation of such "dynamic" feature in jArchi. My idea is to define some standard behavior and some pseudo-language (based on jArchi API) to define them, e.g. el.fillColor = el.prop("Some Prop") ? "Critical" : red. Then a very generic script could be used to update the view.

johmut commented 9 months ago

Hi Guys, it's been a while.... Happy to see that element Line Colour, -Width and -Opacity made it into Archi. Would it now be possible to also add Line Style please? I could very well use: solid, dotted and dashed (short & long), the standard bunch really. Can I have your thoughts?

Phillipus commented 9 months ago

As I'm tied up with so many other developments on Archi (coArchi 2, profiles, important maintenance and build issues, etc.) and there's only one of me ;-) , this one will have to wait a bit longer.

johmut commented 1 month ago

Hello Guys,

It's been a few years ... I see that #1044 is marked as duplicate of this one and closed. Can you take this under consideration please? Being able to set the border line style of elements is something I dearly miss and does not conflict AFAIK with Archimate specifications. Shouldn't be too complicated, I fully agree.

Thx & BR, Johan

Phillipus commented 1 month ago

Shouldn't be too complicated, I fully agree.

Well, actually things are never simple.

In order to implement the feature request of "support different line styles in figures" there has to be a wider consensus on the requirements and what is needed for implementation.

  1. How many and what line styles should be supported? Dashed? Dotted? Dashed and dotted? What spacing between dashes and dots?
  2. Should the line styles apply to all figures? What about the ArchiMate icon-type figures?
  3. In the case of the icon-type figures, should the line styles apply to just the outline of a figure or the inside lines as well? Many of the figures will have to be re-coded. Look at the code here. This takes a lot of time.
  4. What to do about the Grouping figure? This is already using dashed lines. How do we support a default setting?
  5. What is the UI to select line styles? Is it something like this? Then we need some new controls, PNG images of the different styles to display in the drop-down.
  6. Format Painter support
  7. Help files need to be updated with text and new screen-shots
  8. Unit tests needed
  9. jArchi - this has to be supported there too. This requires agreement on the API. Then implementation and unit tests.

In order to proceed we need a broader agreement on (1), (2), (3) and (4) to start with.

Phillipus commented 4 weeks ago

I've renamed the issue title to make it clearer what this is about.

There's a branch here with the initial code.

We need consensus on the points made above.

johmut commented 4 weeks ago

Hi Phil, Thanks for picking this up. In search of consensus on the points made above, please find here my opening move:

  1. I propose the following border line styles: dotted, dashed and solid as Must Have; dash-dot and large-dash as Should Have, anything else as Could Have or Won't Have
  2. Setting Line Style on 'boxes' I see as Must Have. On 'Icons' is Could Have for me and on Connectors Won't Have. If on 'Icons', then only on the outline of the figure.
  3. I have no requirements on the Grouping figure line style.
  4. I propose 'solid' as a default line style setting, unless Archimate specifies differently, e.g. Grouping element
  5. As a UI, I propose a simple drop-down list box with a single selection of line styles represented by their names: solid, dotted ...
  6. Format Painter support is a Must Have I believe
  7. Help files need to be updated with text and new screen-shots, Sure
  8. Unit tests needed, Sure
  9. jArchi support, agreement on the API, implementation and unit tests, Sure, could be done in a later stage I suppose.

Does this help? Kind Regards, Johan

Phillipus commented 3 weeks ago

@johmut Thanks for your feedback.

The main issue now is what to do about the Grouping figure which is already using dashed lines. Let me explain...

  1. We add line styles - "solid", "dashed", "dotted".
  2. Internally in the .archimate file these are stored as 0, 1 and 2. For example: lineStyle=1
  3. The default is 0 (solid). This means that if this value is not present in the .archimate file we use the solid line style. And that works for existing models where this value is not present.
  4. But loading a model where the value is not set for the Grouping figure would mean it has a solid line and that would change the look of existing models. It needs to have lineStyle=1

When this type of situation has occurred before we had to write a special backward compatibility loader which, in this case, would work like this:

  1. When an .archimate file is loaded check its internal model version.
  2. If the model version is less than x.x.x (i.e before line styles were supported) iterate through the model contents and for each Grouping figure set lineStyle=1

Then this creates an issue for coArchi users who are now alerted to the fact that something has changed and a new commit is required, but they don't know what changed.

So we have to think about this impact. @jbsarrodie Do you have any thoughts on this?

Phillipus commented 3 weeks ago

If on 'Icons', then only on the outline of the figure.

Some might look a bit strange:

Screenshot 2024-10-11 at 11 39 25
johmut commented 3 weeks ago

Hi Guys,

My view on 1/ Outline for the Grouping object: Keep the current dashed line-style and do not offer a change of line-style for this element, as this is pre-defined by Archimate. In other words, hard-code line style to dashed for Grouping elements. 2/ Icon outlines: I can do without the ability to change the outline line style on Icon representations of elements. I need it for the boxed representations.

KR, Johan

Phillipus commented 2 weeks ago

1/ Outline for the Grouping object: Keep the current dashed line-style and do not offer a change of line-style for this element, as this is pre-defined by Archimate. In other words, hard-code line style to dashed for Grouping elements.

That's possible, but I wonder if other users will want to style the Grouping object with a solid or dotted line as well?

2/ Icon outlines: I can do without the ability to change the outline line style on Icon representations of elements. I need it for the boxed representations.

I wonder what other users think?

johmut commented 1 week ago

Other users seem to be OK with the proposed features ;-) Can you propose to add this to the scope of a next release?

Phillipus commented 1 week ago

Other users seem to be OK with the proposed features ;-)

I haven't had any feedback from anyone else about this, and I don't want to implement it based on only one person's feedback. Also, I think that other users will probably want to change the line style of the Grouping object. There still remains the unanswered question of impact of backward compatibility as mentioned. I shall ask @jbsarrodie at the next opportunity.

Can you propose to add this to the scope of a next release?

Yes, once the above issues are resolved we can aim for a major Archi release at some point, when some other features have been implemented.