Esempio n. 1
0
  private boolean refreshDir() throws IOException, InterruptedException, ExecutionException {
    final Map<File, Future<List<GeneratedImage>>> createdFiles2 = dirWatcher.buildCreatedFiles();
    boolean changed = false;

    for (Map.Entry<File, Future<List<GeneratedImage>>> ent : createdFiles2.entrySet()) {
      final File file = ent.getKey();
      removeAllThatUseThisFile(file);
      final Future<List<GeneratedImage>> future = ent.getValue();
      final SimpleLine2 simpleLine = new SimpleLine2(file, null, future);
      currentDirectoryListing2.add(simpleLine);
      changed = true;
    }

    for (SimpleLine2 line : new ArrayList<SimpleLine2>(currentDirectoryListing2)) {
      if (line.pendingAndFinished()) {
        currentDirectoryListing2.remove(line);
        changed = true;
        final Future<List<GeneratedImage>> future = line.getFuture();
        for (GeneratedImage im : future.get()) {
          mayRefreshImageWindow(im.getPngFile());
          final SimpleLine2 simpleLine = new SimpleLine2(line.getFile(), im, null);
          currentDirectoryListing2.add(simpleLine);
        }
      }
    }
    Collections.sort(currentDirectoryListing2);
    return changed;
  }
Esempio n. 2
0
 private boolean doFile(final File f, final SourceFileReader sourceFileReader)
     throws IOException, InterruptedException {
   final Collection<GeneratedImage> result = sourceFileReader.getGeneratedImages();
   boolean error = false;
   for (GeneratedImage g : result) {
     if (OptionFlags.getInstance().isVerbose()) {
       myLog(g + " " + g.getDescription());
     }
     nbFiles.addAndGet(1);
     if (g.lineErrorRaw() != -1) {
       error = true;
     }
   }
   if (error) {
     myLog("Error: " + f.getCanonicalPath());
   }
   if (error && option.isFailfastOrFailfast2()) {
     return true;
   }
   return false;
 }