|
Re: Position of elements on a DDiagram (Layout Provider) [message #1690494 is a reply to message #1688385] |
Fri, 27 March 2015 15:49 |
Franck MIMET Messages: 28 Registered: August 2014 |
Junior Member |
|
|
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 16:13 |
|
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
Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Re: Position of elements on a DDiagram (Layout Provider) [message #1690949 is a reply to message #1690944] |
Wed, 01 April 2015 08:34 |
|
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
Steve Monnier - Obeo Canada
Need training or 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 14:27 |
Franck MIMET Messages: 28 Registered: August 2014 |
Junior Member |
|
|
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
Have you got an explanation?
Regards,
Franck
[Updated on: Wed, 01 April 2015 14:50] Report message to a moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03965 seconds