Custom Figure Implementation Follow
Hello,
I want to implement a custom figure implementation to customize the rendering of diagram nodes.
For that purpose, I found a section in the book "The MPS Language Workbench" by Fabien Camagne. (Page 221)
So, I created a baseLanguage Class in the sandbox.solution
@Figure
public class NewFigure extends View {
}
and now I attempt to do a property field as described in the book:
@FigureParameter
public Property<Integer> width = new ValueProperty<Integer>(100);
but the "Property<PrimitiveType>" as well as "@FigureParameter" is not found in the scope, although I think, I added all necessary models and languages.
Thanks in advance and kindly regards!
Volker
Please sign in to leave a comment.
I have no idea about the diagram-stuff you are trying to do, but in situations like the ones you describe, what I usually do is I search for instances of the nodes I need within the Project Scope and then copy/paste an instance into my root.
So, in your case, I searched for "FigureParameterAttribute" by means of Ctrl/Cmd+N (2x). ThereI opened the find-usages dialog (Ctrl/Cmd+Alt+Shift+F7) and searched like so:
I found a usage in MovableContentView, and upon pasting it into my file, MPS asks me to import the following:
Notice that you seem to can toggle the FigureParameterAttribute only by means of a intention:
This intention only applies for public static fields and if the extended classifiers contain ViewPropertySpec, apparently: