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 11:51 |
Benjamin Esterl Messages: 4 Registered: May 2015 |
Junior Member |
|
|
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.
|
|
|
Re: Different options to specify label position around border node [message #1701773 is a reply to message #1701606] |
Wed, 15 July 2015 13:59 |
|
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
Steve Monnier - Obeo Canada
Need training or 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 07:39 |
|
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
Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Goto Forum:
Current Time: Fri Apr 19 10:29:41 GMT 2024
Powered by FUDForum. Page generated in 0.02558 seconds
|