Esempio n. 1
0
 private File generateImageFromGraph(
     final boolean refresh, final String format, DotGraphView view) {
   File dotFile = DotFileUtils.write(view.currentDot);
   File image =
       DotNativeDrawer.renderImage(
           new File(GraphvizPreferencePage.getDotPathFromPreferences()), dotFile, format, null);
   if (view.currentFile == null) {
     return image;
   }
   File copy =
       DotFileUtils.copySingleFile(
           view.currentFile.getParentFile(),
           view.currentFile.getName() + "." + format,
           image); //$NON-NLS-1$
   if (refresh) {
     refreshParent(view.currentFile);
   }
   return copy;
 }
Esempio n. 2
0
 private boolean updateGraph(File file) {
   if (file == null || !file.exists()) {
     return false;
   }
   String dotString = currentDot;
   if (file.getName().endsWith("." + EXTENSION)) { // $NON-NLS-1$
     dotString = DotFileUtils.read(file);
   } else {
     dotString = new DotExtractor(file).getDotString();
   }
   currentDot = dotString;
   currentFile = file;
   setGraphAsync(dotString, file);
   return true;
 }