3.2. Creation

A SecGraph can be created as a java object during the simulation to either store an existing structure or to create a new one. It will always need a context as an initial parameter e.g. the workbench.

An empty SecGraph can be created simply with:

    SecGraph sg = new SecGraph(workbench());

If an additional node is provided this node is added cloned and added to the root of the new SecGraph.

    SecGraph sg = new SecGraph(workbench(),new Box());
    SecGraph sg2 = new SecGraph(workbench(),first((*RGGRoot > Node*));

This cloning can includes the graph structure below the selected node. This can also be used with the reference object as shown in the examples:SecGraphSaveandLoadExample.