tutorials:import-object-in-groimp
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| tutorials:import-object-in-groimp [2025/11/01 05:15] – [Importing though RGG code] Tim | tutorials:import-object-in-groimp [2025/11/01 08:24] (current) – [Importing though RGG code] Tim | ||
|---|---|---|---|
| Line 85: | Line 85: | ||
| //Maybe you have to change the path to fit your file system | //Maybe you have to change the path to fit your file system | ||
| importNodeFromFile(getPathToHomeDirectory()+" | importNodeFromFile(getPathToHomeDirectory()+" | ||
| + | } | ||
| </ | </ | ||
| + | |||
| + | |||
| + | The same function could also be used with an input stream. For example you can add the dtd file to the file explorer by using '' | ||
| + | |||
| + | Afterwards the following code can be used to add the file directly from the GroIMP file system: | ||
| + | |||
| + | <code java importNodeFromStream.rgg> | ||
| + | public void load(){ | ||
| + | importNodeFromStream(getInputStreamFromProject(" | ||
| + | } | ||
| + | </ | ||
| + | |||
| === Import and return node === | === Import and return node === | ||
| - | loadNodeFromFile(" | + | With the same parameters as above we can also use the loadNodeFromFile |
| + | These functions return the root of the imported structure and therefore allow us to place it at any position in our graph. For example lats place the dtd tree twice in the graph once at 0,0,0 and once at 2, | ||
| - | loadNodeFromFile(Stream,"memeType") | + | <code java loadNodeFromFile.rgg> |
| + | protected void init()[ | ||
| + | | ||
| + | loadNodeFromFile(getPathToHomeDirectory()+" | ||
| + | [ | ||
| + | | ||
| + | | ||
| + | ]; | ||
| + | ] | ||
| - | e.g. | + | </ |
| - | A ==> loadNodeFromFile(" | ||
| ==== Using the Object explorer ==== | ==== Using the Object explorer ==== | ||
tutorials/import-object-in-groimp.1761970530.txt.gz · Last modified: 2025/11/01 05:15 by Tim
