GEnginePS engine = new GEnginePS();
GContext context = graph.getContext();
GEngine oldEngine = context.engine;
context.setEngine(engine);
graph.draw();
context.setEngine(oldEngine);
XJUtils.writeStringToFile(engine.getPSText(), file);
} catch (Exception e) {
window.consoleTab.println(e);