Exemplo n.º 1
0
 public boolean quit() {
   // Because documents will disappear from the list once they are closed,
   // make a copy of the list.
   java.util.List<NodeBoxDocument> documents = new ArrayList<NodeBoxDocument>(getDocuments());
   for (NodeBoxDocument d : documents) {
     if (!d.close()) return false;
   }
   System.exit(0);
   return true;
 }
Exemplo n.º 2
0
 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();
 }