{
checkGroupExists(group); // check before adding sub-tables
String ngroup = PrefuseLib.getGroupName(group, Graph.NODES);
String egroup = PrefuseLib.getGroupName(group, Graph.EDGES);
VisualTable nt, et;
nt = addTable(ngroup, graph.getNodeTable(), filter, nodeSchema);
et = addTable(egroup, graph.getEdgeTable(), filter, edgeSchema);
VisualGraph vg = new VisualGraph(nt, et,
graph.isDirected(), graph.getNodeKeyField(),
graph.getEdgeSourceField(), graph.getEdgeTargetField());
vg.setVisualization(this);
vg.setGroup(group);
addDataGroup(group, vg, graph);
TupleManager ntm = new TupleManager(nt, vg, TableNodeItem.class);
TupleManager etm = new TupleManager(et, vg, TableEdgeItem.class);
nt.setTupleManager(ntm);
et.setTupleManager(etm);
vg.setTupleManagers(ntm, etm);
return vg;
}