To use types (classes/ methods/ modules/ …) that are defined in a library into your project, the type needs to be imported.
There are several level of imports:
Groimp enables to includes default imports in files when compiling them. These imports are defined in the registry under. /io/filter/xx where xx is the filter type to manage.
Currently only the rgg filter is modified, thus, all .rgg files are compiled with additional default imports.
The paths of default imports are :
/io/filter/rgg/packageimports: equivalent to import pckname.*, where pckname is the name of a java package (e.g. java.lang)./io/filter/rgg/singletypeimports: equivalent to import pck.ClassName, where pck.ClassName represent the complete name of a type (e.g. de.grogra.graph.impl.Node)./io/filter/rgg/statictypeimports: equivalent to import static pck.ClassName. .
These are the imports of type from within the current project. Within a project all files are viewed at the same level, without including the directory. Thus, the project contains a file named Model.rgg, which declare a type named A. The type A, can be imported in any of the other files of the project with import Model.A;.
These are the imports from packages available within GroIMP. e.g. import de.grogra.gpuflux.tracer.FluxTracer;.
Module libraries are project that have been exported as library. These libraries can be added in GroIMP as plugins, and then all of their types can be used as plugin imports.
See here to see how to export a project as a library.
Third party libraries can be added to your project in the file explorer (see here for more details).
Once imported, they can be imported normally: import my.pckg.Class;.
Note that some third party library are included in some GroIMP plugins. Thus, already available as plugin imports.