osate / osate2

Open Source AADL2 Tool Environment
http://osate.org
Eclipse Public License 2.0
36 stars 8 forks source link

Adding property associations can result in diagrams being changed #2020

Closed philip-alldredge closed 1 year ago

philip-alldredge commented 4 years ago

Which properties are displayed in a diagram is set for the entire diagram. Because of this, adding a property to an element displayed in the diagram will result in the diagram changing the next time it is opened. This can cause the diagram to not look as intended because of diagram element sizes changing.

Need to consider whether this is appropriate behavior. We recently reworked the diagram configuration system to reduce cases where diagrams are updated automatically to reflect new model elements. This is very similar.

@lwrage what are your thoughts? In the past you seemed less happy with things being automatically added to the diagram.

lwrage commented 4 years ago

@philip-alldredge I'll need to think about this.

philip-alldredge commented 4 years ago

@lwrage what were your thoughts?

lwrage commented 4 years ago

Is it possible to display property values in a separate layer such that they are not part of the layout?

philip-alldredge commented 4 years ago

Unless I'm misunderstanding you, no, that is not feasible without rethinking how property values are visualized. In many cases the property values are text labels that are contained inside the element for the shape to which they apply. They are inherently considered part of the shape and must be considered when determining the size of the shape.

example

philip-alldredge commented 4 years ago

If we want to change the behavior, I'd suggest the approach below.

As far as I recall, there shouldn't be any layout issues associated with automatically removing a property value that no longer has an association but that could be done either way.

Even with these changes could be broken in a few cases. For example if a property value is represented as connections(references) then adding another reference would add another connection. There might be other cases if the representation of the property value swapped from being a connection to being a label. However, the cases I can imagine that occurring are such that I don't think it would cause any real problems because the diagram is already being changed.

I haven't given much thought about how easily implementable this approach is but it would make the behavior more consistent with the other changes. Although, there are times when I miss the old behavior and I'm sure i would miss property values being automatically added in some cases.

lwrage commented 4 years ago

Is there a possibility to display properties in a textbox that has scrollbars if needed? Then for automatic layout the textbox size would adapt, but otherwise if would show a scrollbar if the text doesn't fit any longer.

philip-alldredge commented 4 years ago

Not at this time. But we aren't really slotted to resolve this in the immediate future anyways.

Once we are using GEF5/JavaFX, I believe it would be feasible. The labels at the top could be grouped together and placed in some sort of container. The scrollbar or the box could be shown only when it's cutoff(depending on how appealing it looks).