Skip to content
Stephan Grein edited this page Mar 18, 2015 · 4 revisions

Functions

protected void evaluationRequest(Script script);

Called at runtime, script is actually a Groovy data structure which is populated by the Groovy Parser at runtime, right after the evaluation of the ParamInfo annotation, i. e. the option string is evaluated and parsed as Groovy code. This is especially used for type representations to evaluate options for the type.

Example: @ParamInfo(name="Foo", options="a=3; b=4") => "a=3; b=4" get's parsed by the Groovy interpreter on the JVM, then set's the properties a and b to 3 respectively 4 in the Groovy data structure with name script, then your type representation calls evaluationRequest to determine e. g. the parameters you supplied in the options string.

Note however, the options string can be any Groovy code.

public void setElementInputInfo(ParamInfo info)

Consider the case, when you have developed a new type representation, e. g. FooType. Now, consider you want to have an array-like type of TypeFoo, e. g. FooArrayType.

If your type FooType has options, e. g. cols and rows which you use in options in an ParamInfo annotation, and you want to pass these options from the FooArrayType to the FooType (which is one element of the array) then the setElementInputInfo can be used, to set these options for the elements.

Example: Implement ParamInfo interface or make use of DefaultParamInfo, i. e. setElementInputInfo(new DefaultParamInfo("", "cols=COLS;rows=ROWS", "default"), or just implement a custom ParamInfo class, i. e. FooParaminfo implements ParamInfo.

Questions

Can one use @OutputInfo and @MethodInfo in conjunction?

No, the very last annotation in sequence overrides all the previous annotations; at least for me.

How to add a certain method automatically / make visible on the canvas when a component is dragged onto the canvas?

Use hide=false in the @MethodInfo annotation of the given method.