private void addDocument(NodeBoxDocument doc) { doc.setVisible(true); doc.requestFocus(); doc.focusNetworkView(); doc.setActiveNetwork("/"); documents.add(doc); currentDocument = doc; }
public void takeScreenshotOfDocument(String documentFileName) { File documentFile = new File(documentFileName); File documentDirectory = documentFile.getParentFile(); String imageName = FileUtils.getBaseName(documentFile.getName()) + ".png"; File screenshotFile = new File(documentDirectory, imageName); NodeBoxDocument doc = NodeBoxDocument.load(documentFile); addDocument(doc); doc.setVisible(true); doc.takeScreenshot(screenshotFile); doc.close(); }