Graph g = null;
// a IO that delegates to correct I/O depending on the file extension (NET, DNE and XMLBIF by default)
FileExtensionIODelegator ioDelegator = PluginAwareFileExtensionIODelegator.newInstance();
// ioDelegator.getDelegators().add(UbfIO.getInstance()); // adding UBF compatibility into delegator
try {
g = ioDelegator.load(file);
} catch (FileExtensionIODelegator.MoreThanOneCompatibleIOException e) {
// OBS. FileExtensionIODelegator.MoreThanOneCompatibleIOException is managed
// differently by load and save. This is because load is done by the module and the
// save is done by IO (on load, we are not sure what module to use, but on save we
// are sure that we should use the currently active module/window).