Bug 142270 - Display links from nodes within a collapsed compartment
Summary: Display links from nodes within a collapsed compartment
Status: REOPENED
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement
Target Milestone: ---   Edit
Assignee: Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-17 12:05 EDT by Jerome Louvel CLA
Modified: 2010-07-19 12:27 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jerome Louvel CLA 2006-05-17 12:05:17 EDT
From a newsgroup thread: "Subgraphs supported":
 1) I have root nodes of type A and B
 2) Root nodes A contain child nodes
 3) Root nodes B don't contain anything
 4) Child nodes of A can be connected to root nodes B
 5) Root nodes A can be collapsed/expanded while retaining the visual links to root nodes B

I was looking initially for something like subgraphs, but compartments could work well too. My main concern is about the handling of links:
 1) Will I be able to link child nodes of A (within their compartment) to root B nodes?
 2) If so, will the links still be displayed if I collapse the compartment? 

---

To this, Alex Shatalin replied:
> 1) Will I be able to link child nodes of A (within their
> compartment)
> to root B nodes?
 Yes it works now.

> 2) If so, will the links still be displayed if I collapse the
> compartment?
 No. Currently only "visible" links are drawn on diagram. If you'd like to "reconnect" your links on collapsing the compartment, I suppose you have to implement this functionality by hand. I think, you can create/remove corresponding links, but it's better to ask somebody from the runtime team about this part of functionality. 

---

Would it be possible to add support for this feature (collapsible) in the GMF runtime? If not, could someone give details on how to manually workaround this issue?

Regards,
Jerome
Comment 1 Steven R. Shaw CLA 2006-05-18 08:38:33 EDT
Not sure I understand this request.  Compartments are collapsible by default in the runtime as long as the view has the DrawerStyle installed on it (installed by default with ResizableCompartmentViewFactory) and the EditPart is subclassing from the ResizableCompartmentEditPart.

You can see this demonstrated in the logic example:
1. Create a circuit
2. Create a LED inside the circuit
3. Create a LED outside the circuit
4. Connection the 2 LED's together
5. Select the compartment and click on the triagle in the top-left corner
6. Notice the LED and the wire disappear.
7. Click triangle again and notice the LED and the wire reappear.
Comment 2 Jerome Louvel CLA 2006-05-18 11:44:08 EDT
Hi Steven,

Thanks for looking into that. Actually what is needed is a way to keep the wire (or link) visible despite the fact that the compartment is collapsed.

It could be even smarter if multiple wires were drawn, from LEDs inside the compartment to a single LED outside of it. In this case, if would be nice to collapse the two links into a single aggregate one.

Hope that clarifies the need.
Comment 3 Steven R. Shaw CLA 2006-05-18 11:57:21 EDT
There's no plans to address this explicitly in the runtime.  To me it depends on the specific domain and how they want to represent connections.  It would be presumptious of the runtime to decide where to reconnect the connections or how to aggregate them.

To do this:
- You would need to listen to the DrawerStyle in your compartment editpart or editpolicy.
- On handling of the collapse event, find the connections inside the container you wish to reorient and then send a ReconnectRequest to the new target. (i.e. parent EditPart that contains the connection.  Or for the aggregate usecase create a new connection that itself listens to the collapse event on the event notification to delete itself when the compartment is being reopened.
Comment 4 Jerome Louvel CLA 2006-05-18 12:06:28 EDT
I've worked with other graphical frameworks (JViews SDM) that had direct support for similar features so I was expecting something similar.

Ideally, you should have an option at modeling time to decide how to represent links attached to hidden nodes:
 1) Hide the link (current behavior)
 2) Show all the links by visually connecting them to the first visible ancestor compartment 
 3) Similar to 2) by with the automatic aggregation/expansion of links attached to the same "visual" source and target (even if the model source and target are different).

Maybe you want to consider that for a future release at least.

Thanks,
Jerome
Comment 5 Steven R. Shaw CLA 2006-05-18 12:11:54 EDT
sure... I'll move it to "enhancement"
Comment 6 Truong Ivan CLA 2008-03-07 13:01:10 EST
Hello Steven,

I would like to know the status of this enhancement.
I don't know if you did it or intend to do it but I want to tell that I share the opinion of Jerome as it should be a reasonable to ask this be native.

For an end-user I think it's quite annoying to see the links disappear.

Regards,
Ivan
Comment 7 Eclipse Webmaster CLA 2010-07-19 12:27:34 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Runtime Diagram was the original product and component for this bug