| Summary: | Subgraph doesn't obey Graph's direction if EAST | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Craig Laurent <craiglaurent> | ||||||
| Component: | GEF-Legacy Draw2d | Assignee: | Alexander Nyßen <nyssen> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | major | ||||||||
| Priority: | P3 | CC: | aboyko, ahunter.eclipse, nyssen | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | 3.7.1 (Indigo SR1) | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Craig Laurent
Created attachment 48195 [details]
CompoundTransposeMetrics to fix the problem
Fixing this is just a matter of changing the CompoundDirectedGraphLayout to use a custom version of the TransposeMetrics. The new version should flip the subgraphs...as the current TransposeMetrics already does for the Nodes and Edges.
Attached is a working example that could be added to the project, and then reference it from the CDGL.java instead of the TransposeMetrics.
problem solved.
(now just need to get the subgraphs to be able to have a different orientation from the regular graph!!)
When do you think this fix will make it into the HEAD, and then the released product? Additionally, why are all of the parts of this formatter class security "friendly", such that I can't use them or subclass them? e.g. TransposeMetrics. I had to put this directly in the draw2d framework package. This makes it very difficult to extend the capabilitied for custom needs. We will be forced to have a private build of the codebase until this can make its way to a release. If we could have subclassed and used this, we could have made a custom layout that worked just like the Compound one, with the customization of the Transposer. But we can't. I looked at the attached CompoundTransposeMetrics class and have a few questions: 1) Shouldn't we transpose subgraphs on the visit as well? 2) Shouldn't we transpose the children of the subgraph too? The answer to both questions is no. The list of nodes on the graph object is a flat list of all nodes that belong to the graph. The proposed fix seems to be valid - the layout algorithm moves subgraphs from list of nodes to the list of subgraphs. Comment on attachment 48195 [details]
CompoundTransposeMetrics to fix the problem
Patch does not fix the issue.
Updated DirectedGraphDemo and CompoundGraphDemo within org.eclipse.draw2d.examples.graph to allow selection of graph direction via combo box for all examples. Created attachment 190608 [details]
Patch for CompoundDirectedGraphLayout, using CompoundTransposeMetrics
For me, the following seems to work. I tested it with all examples (I modified them so one can easily change direction) and they all look good to me. However, Anthony, as you have rejected the former patch, I am not going to commit this directly, but will leave it to you to confirm its validity first.
Anthony, can we still put this in for M7, or does it have to be postponed to post-Indigo? Removing milestone. As we are past API-freeze, this will have to go into 3.8. Applied patch to R3_7_maintenance branch as well as HEAD. Resolving as fixed. |