This is an old revision of the document!
Table of Contents
Parameter manager
Parameter manager
Default
By default all parameters are added to the current default parameter manager. It is possible to change the default parameter manager of an rgg file with the annotation de.grogra.xl.parameter.DefaultParameterManager. The annotation has two arguments: a name and a class. Only the class is required. If no name is given, one is generated automatically.
By default, the parameter manager is of the type text file.
Custom
It is possible to declare a new parameter manager with the annotation de.grogra.xl.parameter.AddParameterManager, which take two required arguments: a type and a name.
Implementations
A parameter manager only requirement is to provide access to a set of Node's attributes. How the parameters are processed then depends on its implementation. To properly work with the XL compiler, a non abstract ParameterManager must implements the static method: public static void findPMandAddParameter(String name, Parameter p) {}
Declare parameters
In order to be a parameter, an attribute need to have one of the two annotations de.grogra.xl.parameter.IsParameter, or de.grogra.xl.parameter.AllAsParameter. These two annotations can have two arguments: a class, a name. Neither is required. The arguments are:
- A name: the name has to match the name of a declared parameter manager. That parameter manager will be used for this parameter.
- A class: The class has to extend ParameterManager. It will use the “default” manager of that class.
Edit
Parameter managers can be edited from both within the project and at GroIMP start up.
Save
A file parameter manager can save the current value of its parameters in a Parameter file, with either the GUI (save btn in the parameter manager editor), or the code pm.save()
Load
A file parameter manager can load values for its parameters from a Parameter file, with either the GUI (load btn in the parameter manager editor), or the code pm.load()
