Hooking into Sirius font changing [message #1784857] |
Wed, 04 April 2018 16:43  |
Eclipse User |
|
|
|
Hello,
In my use case we have custom edit parts and figures for nodes, and each node has a Label for their "name" and a FlowPage for their "description". Currently the font attributes (size, font type, color, etc) are hard coded. We would like for these attributes to be customizeable by the user via the appearance properties tab, sirius tabbar, diagram menu, etc.
How would I hook into these things to change the font attributes of the nodes when these things are selected/changed by the user?
Thanks,
Louis
[Updated on: Wed, 04 April 2018 17:58] by Moderator
|
|
|
Re: Hooking into Sirius font changing [message #1784978 is a reply to message #1784857] |
Fri, 06 April 2018 09:45   |
Eclipse User |
|
|
|
Hi,
IIRC, even when using custom edit parts, at the model level you should have the same kinds of elements as for a normal Sirius node, i.e. a GMF Notation 'Node', a Sirius 'DNode' and a style, which in this case would be a 'org.eclipse.sirius.diagram.CustomStyle' (that inherits from the normal NodeStyle and thus have all the usual properties). When you select your edit part do you have the usual properties tabs (notably 'Style' and 'Appearance') available? They should be wired to the model elements mentioned. To take into account the current values you need to override your edit part's refreshVisuals() method, read the current values configured on the model side, and reconfigure your Figure accordingly. See for example how it's done in UML Designer.
Regards,
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06769 seconds