archi icon indicating copy to clipboard operation
archi copied to clipboard

[feature] Shortcut/Link from view diagram elements to views

Open Andy-Turner opened this issue 9 years ago • 7 comments

When creating views I found that I wanted to link elements to views. For example, if I have image

I want to be able to double click on "Network" and have the detailed network view displayed. Currently I think I would have to do this: image

But it would be cleaner to have something like this: image

The code to actually do the linking already exists in DiagramModelReferenceEditPart, so the only real change is making the "Network Diagram" element look different. My initial proposal (given that I've only looked through the code for an hour or so) would be to create a new MiniDiagramModelReference class that has basically the same functionality but is represented by a new shortcut icon, doesn't display its name label, and is location pinned to the bottom right corner of its parent object. This would allow the current method of view shortcuts to remain in place, but also allow the more minimal linking view.

Andy-Turner avatar Dec 17 '15 17:12 Andy-Turner

Hi, not sure if you are interested in having this feature at some point, but I've implemented it. I actually just made the ArchimateDNDEditPolicy call a new AddMiniDiagramModelReferenceCommand class - which is exactly the same as the current class other than setting the object dimensions to 20x20 and inheriting the parents background color. Less than 10 lines of code changed. This way it uses all of the same canvas objects, just changes the default formatting when you DND. Example:

Works as previous behavior if you drag to base diagram container: image

Work as previous if you DND from diagram to parent: image

But, iff you DND a single diagram object directly to a container then the mini-formatiing is used and the object is placed at right-bottom.pos - (20,20): image

As the only change is the default formatting what a diagram is dragged to a container there should be minimal risk of this creating bugs: image

Perhaps a I should add a checkbox in the preferences to enable/disable this feature, unless you don't think this is useful, in which case I'll just use it in my own build.

Andy-Turner avatar Dec 21 '15 17:12 Andy-Turner

Hi,

Thank you for this idea and contribution. Could you make it available in your local fork of Archi (I've you have one) inside a new branch. This would allow me to have a look.

@Phillipus : A first step on the autolayout journey ;-)

JB

jbsarrodie avatar Dec 21 '15 19:12 jbsarrodie

Hi, commit is here: https://github.com/archimatetool/archi/compare/master...Andy-Turner:small_corner_diagram_refs?expand=1#diff-980afe7ab105d61cdcad898486eb0d58

Unfortunately it's showing the entire files as being replaced. Are you guys developing in Windows or Linux (I used windows)? I'm wondering if it's a CRLF issue, unless you know something else it could be?

Andy-Turner avatar Dec 21 '15 21:12 Andy-Turner

The CRLF issue is strange. I use Eclipse on Windows and it's always defaulted to CRLF.

Phillipus avatar Jan 13 '16 10:01 Phillipus

I've put a similar request on the forum at http://forum.archimatetool.com/index.php?topic=312.0 and was told that this feature request is on the list for future enhancements. Will this be implemented as part of one of the next (beta) version 4 releases?

BTW my proposal was a bit different than the above one which I like also and is perhaps more user-friendly than mine :+1:

ghost avatar Feb 18 '17 04:02 ghost

Will this be implemented as part of one of the next (beta) version 4 releases?

No. I want to gather a bunch of feature requests and prioritise them for a 4.x release.

Phillipus avatar Feb 18 '17 11:02 Phillipus

An issue as I see: the ArchiMate Exchange File Format might not allow linking to both a ArchiMate-view (for the actual link) and an ArchiMate-element (for the shape).

djoris avatar Oct 10 '19 09:10 djoris