Skip to main content



      Home
Home » Eclipse Projects » Sirius » Different options to specify label position around border node
Different options to specify label position around border node [message #1701606] Tue, 14 July 2015 07:51 Go to next message
Eclipse UserFriend
Hello,

I was wondering if there are further options than the ones provided in the "Label" tab of a "Style" Mapping element on viewpoint specification level.

See this screenshot:
index.php/fa/22497/0/
Here it seems like there is only the possibility to set the "Label Position" to "border" or "node", but nothing like left, right, top, bottom.


I am looking for options that for example an end user has who is working with such a diagram. For example:
- Position a label on top, right, left, under a border node

See this screenshot:
index.php/fa/22498/0/
Here the label "BorderNode1" is in the default position and the label "BorderNode2" was moved to the left hand side of the border node manually.

Regards,
Benjamin.
Re: Different options to specify label position around border node [message #1701773 is a reply to message #1701606] Wed, 15 July 2015 09:59 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

Indeed currently you are not able to specify the label position in the
GMF. You will have to follow the documentation about how to provide a
custom style [1].
Note that in your case the customization will be quite light. First you
will need to add an extension point on
"org.eclipse.sirius.diagram.ui.styleConfigurationProvider" to provide
your own "IStyleConfigurationProvider".
In your class implementing IStyleConfigurationProvider, implement
"provides", to return true for your mapping, and
"createStyleConfiguration" to return your own SimpleStyleConfiguration
for your mapping.
In your class extending SimpleStyleConfiguration, override
getNameBorderItemLocator to return a BorderItemLocator set on your
prefered side.
Example for a label always located on the west border:
public IBorderItemLocator getNameBorderItemLocator(DNode node,
IFigure mainFigure) {
BorderItemLocator locator = new BorderItemLocator(mainFigure,
PositionConstants.WEST);
return locator;
}

Regards,
Steve

Le 14/07/2015 13:51, Benjamin Esterl a écrit :
> Hello,
>
> I was wondering if there are further options than the ones provided in the "Label" tab of a "Style" Mapping element on viewpoint specification level.
>
> See this screenshot:
>
> Here it seems like there is only the possibility to set the "Label Position" to "border" or "node", but nothing like left, right, top, bottom.
>
>
> I am looking for options that for example an end user has who is working with such a diagram. For example:
> - Position a label on top, right, left, under a border node
>
> See this screenshot:
>
> Here the label "BorderNode1" is in the default position and the label "BorderNode2" was moved to the left hand side of the border node manually.
>
> Regards,
> Benjamin.
>


--
Steve Monnier - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Different options to specify label position around border node [message #1703183 is a reply to message #1701773] Wed, 29 July 2015 03:39 Go to previous message
Eclipse UserFriend
Hello,

I noticed that I forgot the link to the documentation in my previous answer.

[1]
https://www.eclipse.org/sirius/doc/developer/extensions-provide_custom_style.html

Regards,
Steve

Le 15/07/2015 15:59, Steve Monnier a écrit :
> Hello,
>
> Indeed currently you are not able to specify the label position in the
> GMF. You will have to follow the documentation about how to provide a
> custom style [1].
> Note that in your case the customization will be quite light. First you
> will need to add an extension point on
> "org.eclipse.sirius.diagram.ui.styleConfigurationProvider" to provide
> your own "IStyleConfigurationProvider".
> In your class implementing IStyleConfigurationProvider, implement
> "provides", to return true for your mapping, and
> "createStyleConfiguration" to return your own SimpleStyleConfiguration
> for your mapping.
> In your class extending SimpleStyleConfiguration, override
> getNameBorderItemLocator to return a BorderItemLocator set on your
> prefered side.
> Example for a label always located on the west border:
> public IBorderItemLocator getNameBorderItemLocator(DNode node,
> IFigure mainFigure) {
> BorderItemLocator locator = new
> BorderItemLocator(mainFigure, PositionConstants.WEST);
> return locator;
> }
>
> Regards,
> Steve
>
> Le 14/07/2015 13:51, Benjamin Esterl a écrit :
>> Hello,
>>
>> I was wondering if there are further options than the ones provided in
>> the "Label" tab of a "Style" Mapping element on viewpoint
>> specification level.
>>
>> See this screenshot:
>>
>> Here it seems like there is only the possibility to set the "Label
>> Position" to "border" or "node", but nothing like left, right, top,
>> bottom.
>>
>>
>> I am looking for options that for example an end user has who is
>> working with such a diagram. For example:
>> - Position a label on top, right, left, under a border node
>>
>> See this screenshot:
>>
>> Here the label "BorderNode1" is in the default position and the label
>> "BorderNode2" was moved to the left hand side of the border node
>> manually.
>>
>> Regards,
>> Benjamin.
>>
>
>


--
Steve Monnier - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Programmatically adding elements to a Representation
Next Topic:EEF for Sirius 3
Goto Forum:
  


Current Time: Tue May 20 13:53:27 EDT 2025

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

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

Back to the top