Manually Building Nodes
If you want to build nodes randomly, or based on user input, you need to create the data structure manually within program. The first thing you need to do is build a table and define it's structure. Table construction is a straightforward creation of a table object
Table myTable = new Table();
Attributes are defined with the table objects addColumn function. This function takes two arguments, the name of the table row and the type of data it contains. Any java datatype is useable, just pick one and add a .class to the end.
myTable.addColumn("Name", String.class);
myTable.addColumn("Age", int.class);
Once the structure is created, individual rows are added with the tables addRow function. When called, this function returns an integer representing the row number which can be used later to reference that specific row. Once the row is created, the data fields can be input with the table objects set() function. Arguments to the set function are row number, data field to set, and value :
int row = table.addRow();
myTable.set(row, "Name", "Mickey");
myTable.set(row, "Age", 35);
Once the datastructure is constructed, all that is left is to construct a new graph using the created table object.
Graph myGraph = new Graph(table, false);