| Summary: | Zest 2.0 layouts do no support reading model objects | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Zoltan Ujhelyi <zoltan.ujhelyi> | ||||
| Component: | GEF-Legacy Zest | Assignee: | gef-inbox <gef-inbox> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | minor | ||||||
| Priority: | P3 | CC: | steeg | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Zoltan Ujhelyi
Having a way to get the items that are being laid out would be useful indeed. To me it seems adding it to EntityLayout isn't ideal though, since that is also extended by SubgraphLayout for which such a method doesn't seem to make sense. Perhaps we could add a method only to NodeLayout which returns the node as an item - we could then access them from the layout context something like this: Item node1 = context.getNodes()[0].getItem(); // a GraphNode It would also allow access to node items in subgraphs: Item node2 = context.getSubgraphs()[0].getNodes()[0].getItem(); Could this be a sensible approach? Would it work for you? That seems exactly what I want, thanks. Maybe a common interface can be reached by adding a getAllNodes() method, that return an array of Items, that can contain all nodes in the subgraphs recursively. If you think, it would work as expected, then I will provide a patch solving it that way. Yes, that sounds like a nice way to do it. To avoid confusion in classes implementing SubgraphLayout (which defines the getNodes method that returns a NodeLayout[]), and since the new method would return an Item[], perhaps we should call it getItems? Created attachment 189380 [details]
A proposed patch
Added a patch that creates the corresponding methods.
As the EntityLayout interface does not reach GraphItem/GraphNode classes, the new method returns Object[]
Thanks - applied your patch, changing the return type to Item[] (the most specific we can get in the layouts bundle), and adding some tests (see LayoutAlgorithmTests). |