Exemple #1
0
 private File getImagesDir() {
   PovrayProject proj = renderService.getProject();
   FileObject fob = proj.getImagesFolder(true);
   File result = FileUtil.toFile(fob);
   assert result != null && result.exists();
   return result;
 }
Exemple #2
0
  private File getFileToRender() throws IOException {
    FileObject render = toRender;
    if (render == null) {
      PovrayProject proj = renderService.getProject();
      MainFileProvider provider =
          (MainFileProvider) proj.getLookup().lookup(MainFileProvider.class);
      if (provider == null) {
        throw new IllegalStateException("Main file provider missing");
      }
      render = provider.getMainFile();
      if (render == null) {
        ProjectInformation info =
            (ProjectInformation) proj.getLookup().lookup(ProjectInformation.class);

        // XXX let the user choose
        throw new IOException(
            NbBundle.getMessage(Povray.class, "MSG_NoMainFile", info.getDisplayName()));
      }
    }
    assert render != null;
    File result = FileUtil.toFile(render);
    if (result == null) {
      throw new IOException(NbBundle.getMessage(Povray.class, "MSG_VirtualFile", render.getName()));
    }
    assert result.exists();
    assert result.isFile();
    return result;
  }