Skip to main content



      Home
Home » Eclipse Projects » Sirius » Needs support with LayoutProvider extension
Needs support with LayoutProvider extension [message #1614688] Fri, 13 February 2015 07:22 Go to next message
Eclipse UserFriend
Hello,

I try to make my own layout with the LayoutProvider extension.
In my small example, I have two types of containers ContainerA and ContainerB.
A 'ContainerA' includes many 'ContainerB' and a 'ContainerB' contains 'Action' nodes.
My target layout is:
All the 'ContainerA's are ordered from left to right.
All of the 'ContainerB' within 'ContainerA' are also ordered from left to right.
All of the 'Action' nodes inside a 'ContainerB' are ordered from top to bottom.

I did the target layout manually below, but I do want to arrange it programmacally.
index.php/fa/20838/0/
What I did is:
I added a 'Composit Layout' to the diagram with the direction from left to right. It seems it only makes sure the arrows direction is from left to right, at least not for the 'B1','B2','B3' in 'A1'. It looks like:
index.php/fa/20837/0/
I tried to follow the link which was posted within another topic.

The java code and other modifications in 'MANIFEST.MF' are here:
index.php/fa/20840/0/
index.php/fa/20839/0/
I just wonder whether it is a correct way to customize layout. Since I don't see any customized feature is added to the runtime navigation bar or anywhere.
index.php/fa/20841/0/

Thanks for any suggestion.

Emi
Re: Needs support with LayoutProvider extension [message #1614827 is a reply to message #1614688] Fri, 13 February 2015 09:29 Go to previous messageGo to next message
Eclipse UserFriend
How does the Layout looks like if you select "Top to Bottom" in the Composite Layout?

Quote:

My target layout is:
All the 'ContainerA's are ordered from left to right.
All of the 'ContainerB' within 'ContainerA' are also ordered from left to right.
All of the 'Action' nodes inside a 'ContainerB' are ordered from top to bottom.


I assume that if Action X is connected Action Y, Action Y has to be placed below Action X?
Re: Needs support with LayoutProvider extension [message #1614897 is a reply to message #1614827] Fri, 13 February 2015 10:15 Go to previous messageGo to next message
Eclipse UserFriend
If I use 'Top to bottom' layout, it looks like:
index.php/fa/20845/0/
Within the container, the actions are ordered from top to bottom.
Then, the problems are:
The containers are also ordered from top to bottom.
The actions between two containers like (action5 and action4) in the image, the arrow's direction is 'Up'.

Re: Needs support with LayoutProvider extension [message #1619502 is a reply to message #1614688] Mon, 16 February 2015 11:27 Go to previous messageGo to next message
Eclipse UserFriend
Le 13/02/2015 13:22, Emi Su a écrit :
> Hello,
>
> I try to make my own layout with the LayoutProvider extension.
> In my small example, I have two types of containers ContainerA and ContainerB.
> A 'ContainerA' includes many 'ContainerB' and a 'ContainerB' contains 'Action' nodes.
> My target layout is:
> All the 'ContainerA's are ordered from left to right.
> All of the 'ContainerB' within 'ContainerA' are also ordered from left to right.
> All of the 'Action' nodes inside a 'ContainerB' are ordered from top to bottom.
>
> I did the target layout manually below, but I do want to arrange it programmacally.
>
> What I did is:
> I added a 'Composit Layout' to the diagram with the direction from left to right. It seems it only makes sure the arrows direction is from left to right, at least not for the 'B1','B2','B3' in 'A1'. It looks like:
>
> I tried to follow the link which was posted within another topic.
>
> The java code and other modifications in 'MANIFEST.MF' are here:
>
>
> I just wonder whether it is a correct way to customize layout. Since I don't see any customized feature is added to the runtime navigation bar or anywhere.

You will not see any customized feature to the navigation bar or
anywhere: the purpose of this layout provider extension is to replace
the arrange all behavior.

If you use your own layout provider you must not add a CompositeLayout
element as child of your diagram description: it might be called before
your layout provider. The first registered provider returning true
org.eclipse.sirius.diagram.ui.tools.api.layout.provider.LayoutProvider.provides(IGraphicalEditPart)
is selected by
org.eclipse.sirius.diagram.ui.tools.internal.layout.provider.LayoutService.getProvider(IGraphicalEditPart).

Then you can see several way to customize the layout (ie the layout
constraint of the GMF notation elements):
org.eclipse.sirius.diagram.ui.tools.internal.layout.provider.CompositeDownTopProvider
org.eclipse.sirius.diagram.ui.tools.internal.layout.provider.CompositeLeftRightProvider
org.eclipse.sirius.diagram.ui.tools.internal.layout.provider.CompositeTopDownProvider
org.eclipse.sirius.diagram.ui.tools.internal.layout.provider.CompositeTopDownProvider
org.eclipse.sirius.diagram.sequence.ui.tool.internal.provider.SequenceDiagramLayoutProvider


>
>
> Thanks for any suggestion.
>
> Emi
>


Regards

--
Maxime - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Needs support with LayoutProvider extension [message #1625423 is a reply to message #1619502] Fri, 20 February 2015 06:15 Go to previous messageGo to next message
Eclipse UserFriend
Hi Maxime,

I followed your suggestion. I tried to override getLayoutNodeProvider() method to apply my GridLayout. Now all the containers are arranged in one column:
index.php/fa/20935/0/

I still have several questions:
1) In order to arrange the elements(B1, B2, B3) inside A1, I have to selected them manually and arrange them. How to let the 'Arrange All' functionality also be applied inside the 'Container A'?

2) Another question is how to let the GridLayout in one line, like:
index.php/fa/20936/0/
I tried to switch height and width manually, but I think there must be a better solution.
3) It seems my InlineEdgeLayoutProvider doesn't work correctly. In this case, I tried let the edges horizotally, but they are all vertically. See the first figure.

My code related to layout is:
index.php/fa/20937/0/

Thanks again for your help in advance,

Emi
Re: Needs support with LayoutProvider extension [message #1630648 is a reply to message #1619502] Mon, 23 February 2015 05:00 Go to previous message
Eclipse UserFriend
Hoi,

I tried another way with LineLayoutProvider and reduced one container layer.
Now it looks like:
index.php/fa/20962/0/

It reduced several problems with two layers of containers. However, I still need to arrange the nodes within the container from top to down. These nodes may have connections among the different containers.

Any idea to solve it?

Thanks,
Emi
Previous Topic:Boader of workspace image
Next Topic:Creating a wizard
Goto Forum:
  


Current Time: Mon May 12 02:55:55 EDT 2025

Powered by FUDForum. Page generated in 0.03571 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top