Edge touching real border of custom non-rectangular polygon [message #1734917] |
Mon, 13 June 2016 12:46  |
Eclipse User |
|
|
|
Hi!
I am trying to create a custom style, with a non-rectangular polygon. (The attached image is a simple example.)
To provide a nice user experience, I would like to ensure that any edge will actually touch the border of the shape itself, rather than the bounding shape.
I know this is possible in GMF itself by overriding the createNodePlate method, but it seems that in Sirius I cannot do this because my edit part is embedded in a CustomStyle edit part. Is this correct? And, if so, is there any obvious way around this?
I had considered an SVG image with transparent background as an alternative, but there the label text spills over into the transparent part of the shape, which is also not ideal. Or is there a clear way to customise this as well?
Many thanks in advance!
|
|
|
Re: Edge touching real border of custom non-rectangular polygon [message #1735115 is a reply to message #1734917] |
Wed, 15 June 2016 11:39   |
Eclipse User |
|
|
|
Hello,
Indeed, I think that it will be easier to use a workspace image style
with a SVG image having a transparent background. You can then customize
the label edit part and SiriusWrapLabel to compute the size you need to
keep it "inside the drawn shape". You can find how to customize the
style in this documentation:
https://www.eclipse.org/sirius/doc/developer/extensions-provide_custom_style.html
Regards,
Steve
Le 14/06/2016 à 16:00, Iain Whiteside a écrit :
> Hi!
>
> I am trying to create a custom style, with a non-rectangular polygon. (The attached image is a simple example.)
>
> To provide a nice user experience, I would like to ensure that any edge will actually touch the border of the shape itself, rather than the bounding shape.
>
> I know this is possible in GMF itself by overriding the createNodePlate method, but it seems that in Sirius I cannot do this because my edit part is embedded in a CustomStyle edit part. Is this correct? And, if so, is there any obvious way around this?
>
> I had considered an SVG image with transparent background as an alternative, but there the label text spills over into the transparent part of the shape, which is also not ideal. Or is there a clear way to customise this as well?
>
> Many thanks in advance!
>
--
Steve Monnier - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Re: Edge touching real border of custom non-rectangular polygon [message #1735231 is a reply to message #1735120] |
Thu, 16 June 2016 09:13  |
Eclipse User |
|
|
|
Hello,
I cannot recall of any code snippets doing this unfortunatelly. I guess
that in your own EditPart, in createMainFigure() you should add a
SiriusWrapLabel and then compute its bounds to set a size that will keep
it inside the painted shape.
Regards,
Steve
Le 15/06/2016 à 18:14, Iain Whiteside a écrit :
> Thanks for the quick reply. I have already looked at the custom style,
> but couldn't see the appropriate methods in my custom StyleConfiguration
> being called for a workspace image (I did for a normal node).
>
> Do you know of any code snippets I could look at along these lines?
>
--
Steve Monnier - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Powered by
FUDForum. Page generated in 0.03040 seconds