Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Label Position of BorderItems
Label Position of BorderItems [message #1651845] Thu, 05 March 2015 14:49 Go to next message
Martin Schreiber is currently offline Martin SchreiberFriend
Messages: 10
Registered: March 2015
Junior Member

I do have a Container with BorderItems. The border items do have a dot style and a label. Is there a way to specify where the label is placed by default? Can this be done with the StyleConfiguration/StyleConfigurationProvider extension point? I am already using this EP but I could not find any place where I can specify the location of the label.

thanks!
martin
Re: Label Position of BorderItems [message #1651985 is a reply to message #1651845] Thu, 05 March 2015 16:31 Go to previous messageGo to next message
Esteban Dugueperoux is currently offline Esteban DugueperouxFriend
Messages: 472
Registered: July 2009
Senior Member
Hi Martin,

Do you use StyleConfiguration.getNameBorderItemLocator() method to
provide your own IBorderItemLocator?

Best Regards.

Le 05/03/2015 15:49, Martin Schreiber a écrit :
>
> I do have a Container with BorderItems. The border items do have a dot
> style and a label. Is there a way to specify where the label is placed
> by default? Can this be done with the
> StyleConfiguration/StyleConfigurationProvider extension point? I am
> already using this EP but I could not find any place where I can specify
> the location of the label.
>
> thanks!
> martin



--
Esteban Dugueperoux - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Label Position of BorderItems [message #1653356 is a reply to message #1651985] Fri, 06 March 2015 07:25 Go to previous messageGo to next message
Martin Schreiber is currently offline Martin SchreiberFriend
Messages: 10
Registered: March 2015
Junior Member
Yes I am using my own StyleConfiguration which extends the SimpleStyleConfiguration:


@Override
public IBorderItemLocator getNameBorderItemLocator(DNode node, IFigure mainFigure) {
if (node.getTarget() instanceof Input) {
BorderItemLocator locator = new BorderItemLocator(mainFigure, PositionConstants.EAST);
locator.setBorderItemOffset(new Dimension(-5, -2));
return locator;
}
if (node.getTarget() instanceof Output) {
BorderItemLocator locator = new BorderItemLocator(mainFigure, PositionConstants.WEST);
locator.setBorderItemOffset(new Dimension(-5, -2));
return locator;
}
return super.getNameBorderItemLocator(node, mainFigure);
}

The position I am passing to BorderItemLocator does not have any affect where the label is placed.
Re: Label Position of BorderItems [message #1653487 is a reply to message #1653356] Fri, 06 March 2015 08:42 Go to previous messageGo to next message
Esteban Dugueperoux is currently offline Esteban DugueperouxFriend
Messages: 472
Registered: July 2009
Senior Member
Hi Martin,

Could you provide a minimal example to reproduce your issue?

Best Regards.

Le 06/03/2015 08:25, Martin Schreiber a écrit :
> Yes I am using my own StyleConfiguration which extends the
> SimpleStyleConfiguration:
>
>
> @Override
> public IBorderItemLocator getNameBorderItemLocator(DNode node,
> IFigure mainFigure) {
> if (node.getTarget() instanceof Input) {
> BorderItemLocator locator = new
> BorderItemLocator(mainFigure, PositionConstants.EAST);
> locator.setBorderItemOffset(new Dimension(-5, -2));
> return locator;
> }
> if (node.getTarget() instanceof Output) {
> BorderItemLocator locator = new
> BorderItemLocator(mainFigure, PositionConstants.WEST);
> locator.setBorderItemOffset(new Dimension(-5, -2));
> return locator;
> }
> return super.getNameBorderItemLocator(node, mainFigure);
> }
>
> The position I am passing to BorderItemLocator does not have any affect
> where the label is placed.



--
Esteban Dugueperoux - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Label Position of BorderItems [message #1663092 is a reply to message #1653487] Tue, 10 March 2015 09:00 Go to previous message
Martin Schreiber is currently offline Martin SchreiberFriend
Messages: 10
Registered: March 2015
Junior Member
Thanks for your help!

Please find attached an example how I tried to achieve having a container element (Man) with its children displayed as bordered items (boys on the west side, girls on the east side).
As you can see in the example diagram, it works fine, just the label of the girls are on the wrong side. I want to have the labels of the boys and girls inside the container, because in my diagram I want to connect these bordered items with each other.
Als an issue is, that on the girls side, the first item is not placed on the top right corner of the container. There is a space from the top right corner which is as high as the boys need on their side.
Any ideas how I can achieve that the boys are places left, girls right, label inside the container and the first boy and the first girl alligned on the top (or under the containers label)?

Thanks!
Previous Topic:Create new representation that is unsynchronized by default
Next Topic:Defining a dynamic context submenu
Goto Forum:
  


Current Time: Tue Jan 19 19:29:47 GMT 2021

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

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

Back to the top