Skip to main content



      Home
Home » Eclipse Projects » Sirius » Position of elements on a DDiagram (Layout Provider)
Position of elements on a DDiagram (Layout Provider) [message #1688385] Fri, 20 March 2015 11:41 Go to next message
Eclipse UserFriend
Hi,

I'm trying to define the position of elements on a DDiagram.

I read the document "Provide a custom arrange-all" to define my own layout provider.
I succeeded in positioning all the elements on a Grid with a GridLayoutProvider.

Now, my aim is to define the position of Bordered Node contained in a Node Container.
Typically, in my definition, the Node Containers is are "function" and the Bordered Node are their parameters.
I'd like to have the Input parameters on the left and the output parameters on the right of each container.

Can it to be done through a Layout Provider ?
I cannot find "BorderItemAwareLayoutProviderHelper" in the example from the last chapter "Enable the bordered nodes layout on a custom LayoutProvider", so I'm not sure to have miss something.

I checked that in my "provides()", I can find out to DNodeContainerEditPart and the DNode4EditPart which are corresponding to the Node Containers and the Bordered Nodes.

Could you give some advices to achieve that?

Thank you in advance.

Franck
Re: Position of elements on a DDiagram (Layout Provider) [message #1690494 is a reply to message #1688385] Fri, 27 March 2015 11:49 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

In a Diagram Description, I defined containers (which represent 'function') containing bordered nodes (which represent whever 'Input Parameters' or 'Ouput Parameters').

My aim is to define the position of the bordered nodes on the Diagram, such as 'Input Parameters' are on the left side, whereas 'Output Parameters' are on the right).

How can I do this ?
I tried to define my own layout provider, but without success.
In the document 'Provide a custom arrange-all', the last part concerning bordered node layout is not enough explicit for me.
It shows how to add a BorderItemAwareLayoutProvider, but not how to define the constrains, ie the way in which the bordered node should be placed.

Regards,
Franck
Re: Position of elements on a DDiagram (Layout Provider) [message #1690694 is a reply to message #1690494] Mon, 30 March 2015 12:13 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

You can have a look at similar post [1] and a feature request that seems
to correspond to your need [2].

[1] https://www.eclipse.org/forums/index.php/t/796142/
[2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=440296

Regards,
Steve

Le 27/03/2015 16:49, Franck MIMET a écrit :
> Hi,
>
> In a Diagram Description, I defined containers (which represent
> 'function') containing bordered nodes (which represent whever 'Input
> Parameters' or 'Ouput Parameters').
>
> My aim is to define the position of the bordered nodes on the Diagram,
> such as 'Input Parameters' are on the left side, whereas 'Output
> Parameters' are on the right).
>
> How can I do this ?
> I tried to define my own layout provider, but without success.
> In the document 'Provide a custom arrange-all', the last part concerning
> bordered node layout is not enough explicit for me.
> It shows how to add a BorderItemAwareLayoutProvider, but not how to
> define the constrains, ie the way in which the bordered node should be
> placed.
>
> Regards,
> Franck


--
Steve Monnier - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Position of elements on a DDiagram (Layout Provider) [message #1690944 is a reply to message #1690694] Wed, 01 April 2015 03:46 Go to previous messageGo to next message
Eclipse UserFriend
Thank you for help.

I noticed that several people were addressing the same issue and that a new feature was registered in Bugzilla.
Unfortunatly, that don't solve my problem Sad

From the document "Viewpoint - Provide a custom style", I created a StyleConfigurationProvider.
But it is clear how to provider a BorderItemLocator, but not how to define it, ...

The only Locator that is tunable is the NameBorderItemLocator, because it take a DNode and a IFigure in parameters.
Re: Position of elements on a DDiagram (Layout Provider) [message #1690949 is a reply to message #1690944] Wed, 01 April 2015 04:34 Go to previous messageGo to next message
Eclipse UserFriend
Hello Frank,

I think that you should take a look at
org.eclipse.sirius.diagram.sequence.ui.tool.internal.figure.SouthCenteredBorderItemLocator.
This BorderItemLocator is used in the sequence diagram to have the "end
of life" at the bottom of a lifeline and centered.
You will see that it overrides some methods to set the position as
PositionConstants.SOUTH and is defined in specificly provided EditPart,
by override of createBorderItemLocator.

Regards,
Steve

Le 01/04/2015 09:46, Franck MIMET a écrit :
> Thank you for help.
>
> I noticed that several people were addressing the same issue and that a
> new feature was registered in Bugzilla.
> Unfortunatly, that don't solve my problem :(
>
> From the document "Viewpoint - Provide a custom style", I created a
> StyleConfigurationProvider.
> But it is clear how to provider a BorderItemLocator, but not how to
> define it, ...
>
> The only Locator that is tunable is the NameBorderItemLocator, because
> it take a DNode and a IFigure in parameters.


--
Steve Monnier - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Position of elements on a DDiagram (Layout Provider) [message #1691007 is a reply to message #1690949] Wed, 01 April 2015 10:27 Go to previous messageGo to next message
Eclipse UserFriend
Hello Steve!

I'll have a look at org.eclipse.sirius.diagram.sequence.ui.tool.internal.figure.SouthCenteredBorderItemLocator.

I have created my own MyBorderItemLocatorProvider, greatly inspired from DefaultBorderItemLocatorProvider:

	public IBorderItemLocator getBorderItemLocator(final IFigure figure,
			final DDiagramElement vpElementOwner, final DDiagramElement diagramElementBorderItem) {

		BorderItemLocator locator = new BorderItemLocator(figure, PositionConstants.WEST, 1);		
		
		locator.setCurrentSideOfParent(PositionConstants.EAST);
		locator.setPreferredSideOfParent(PositionConstants.EAST);

		return locator;
	}


My container has 3 bordered nodes.
In debug, the function is called 3 times, one for each of the bordered nodes, but only the first bordered node is on the right, and the two last on the left.

Here is a picture of the result.
The green and red squares are the bordered nodes Wink

index.php/fa/21413/0/

Have you got an explanation?

Regards,
Franck

[Updated on: Wed, 01 April 2015 10:50] by Moderator

Re: Position of elements on a DDiagram (Layout Provider) [message #1746110 is a reply to message #1688385] Sat, 22 October 2016 01:46 Go to previous messageGo to next message
Eclipse UserFriend
Hi:
Can you tell me how to positioning the all element with a GridLayoutProvider.
I am trying to positioning the all element but failed.
Re: Position of elements on a DDiagram (Layout Provider) [message #1746111 is a reply to message #1688385] Sat, 22 October 2016 01:47 Go to previous messageGo to next message
Eclipse UserFriend
Hi:
Can you tell me how to positioning the all element with a GridLayoutProvider.
I am trying to positioning the all element but failed.
Re: Position of elements on a DDiagram (Layout Provider) [message #1817705 is a reply to message #1746111] Thu, 28 November 2019 00:46 Go to previous messageGo to next message
Eclipse UserFriend
hi Franck,
Have you solved this problem? how you make it?
Re: Position of elements on a DDiagram (Layout Provider) [message #1817721 is a reply to message #1817705] Thu, 28 November 2019 04:12 Go to previous message
Eclipse UserFriend
oh I solved this issue by using SouthCenteredBorderItemLocator
Previous Topic:How to replace SubDiagramDecorationDescriptorProvider class ?
Next Topic:ELK layouts doesn't work on Element-Based Edge
Goto Forum:
  


Current Time: Tue Jul 22 11:43:26 EDT 2025

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

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

Back to the top