|
Re: Get and set Text size in any DNode and DEdge [message #1743163 is a reply to message #1743160] |
Mon, 12 September 2016 19:53 |
|
*Decription elements are part of the VSM (.odesign), not part of the representations (.aird). They should be treated as immutable, as any change to them will not persist (in particular when the VSM is loaded from a plug-in).
If you want to customize the style of the elements from a representation, you need to update directly their style. However this is not enough by itself, because any change on a Style will by default be overridden by the next Sirius refresh (it's the whole point of the refresh to synchronize the state of the representation according to the definitions from the VSM). To tell Sirius not to apply the synchronization for the features you customized explicitly, you need to add the corresponding EStructuralFeature to the style's customFeatures references.
In pseudo-code:
Node node = ...;
node.getStyle().setLabelSize(16);
node.getCustomFeatures().add(ViewpointPackage.Literals.BASIC_LABEL_STYLE__LABEL_SIZE);
Regards,
Pierre-Charles David
Pierre-Charles David - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
|
Re: Get and set Text size in any DNode and DEdge [message #1743303 is a reply to message #1743204] |
Wed, 14 September 2016 08:48 |
|
The font used is not defined in the VSM, it's a GMF-only attribute. You'll need to update the FontStyle element of the underlying GMF Notation View object. It's a little indirect to obtain it, you'll need something like view.getStyle(NotationPackage.eINSTANCE.getFontStyle()), where 'view' is a GMF view.
If you have the edit part, it looks like this:
FontStyle fontStyle = (FontStyle) part.getNotationView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
Pierre-Charles David - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Powered by
FUDForum. Page generated in 0.03464 seconds