|
Re: Custom Layout for Containers [message #1404011 is a reply to message #1403830] |
Tue, 29 July 2014 07:25 |
|
Hi Aleksandar,
Take a look on this post which is similar to your need:
https://www.eclipse.org/forums/index.php/mv/msg/639946/1234795/#msg_1234795
Regards,
Florian
On 07/28/2014 07:02 PM, Aleksandar Kanchev wrote:
> Hello, I'm new to creating diagram editors using frameworks like GMF and
> Sirius. However it looks quite easy creating diagram editors with
> Sirius, so we're giving it a try in our project. Currently we have a
> problem where we need a container with an advanced layout. Our goal
> could be achieved by chaining small containers together with the
> currently available layouts but this will complicate the graphical model
> and there are concerns about maintainability and performance.
>
> One very nice solution would be if we could define our own layout
> manager, which would take care of the positions of the contained child
> nodes. Since we're new to Sirius (and GMF) we couldn't easily find the
> place where we could just plug our custom layout provider. I was hoping
> that someone with more experience might point us to the right direction
> or even better provide us with an example. Thanks!
|
|
|
|
Re: Custom Layout for Containers [message #1404458 is a reply to message #1404376] |
Fri, 01 August 2014 13:50 |
|
Hi Aleksandar,
The GridLayoutProvider doesn't handle the container hierarchy. The
GridLayoutProvider is actually used as part of the
OrderedTreeLayoutProvider but not as a "ready to use" layout provider.
You could use it as your main structural layout in the case of your own
layout provider that will deal with the hierarchy.
Regards,
Florian
On 07/31/2014 07:01 PM, Aleksandar Kanchev wrote:
> Hi Florian,
>
> thanks a lot for the quick answer. So far I found a nice documentation
> about layout providers and view ordering:
>
> h_ttp://docs.obeonetwork.com/obeodesigner/6.2/viewpoint/developer/general/extensions-provide_custom_arrange-all.html
>
>
> The concept seems quite easy to understand but I'm stuck at arranging
> the child views of a container. I'm trying to use the GridLayoutProvider
> for my diagram but it seems that it won't go down the hierarchy and
> order the views of containers.
>
> For example the DefaultLayoutProvider would check if the current action
> is "Arrange All" i.e. it has the Diagram view itself, then it'll check
> if there's a custom layout provider registered for that diagram and
> it'll discover the GridLayoutProvider that I registered. Then it'll
> always call the GridLayoutProvider with the children of the diagram
> which would be the single root element of the diagram. The logic at that
> point is always the same: arrange the current elements as grid (so 1x1
> grid in this case) and layout the container of those elements (so the
> diagram itself). In another words:
>
> DefaultLayoutProvider.layoutEditParts(GraphicalEditPart diagramEditPart,
> IAdaptable layoutHint):
> -> GridLayoutProvider.layoutEditParts(diagramEditPart.getChildren(),
> layoutHint):
> ->-> childrenGrid =
> myViewOrdering.getSortedViewsAsGrid(diagramEditPart.getChildren())
> ->-> buildGridCommand(childrenGrid)
> ->-> buildContainerCommand(diagramEditPart)
>
> Am I missing something important here?
>
> Regards,
> Aleksandar
|
|
|
|
Powered by
FUDForum. Page generated in 0.27530 seconds