Examples of ProgressSupport


Examples of com.bbn.openmap.event.ProgressSupport

            return s.toString();
        }
    }

    public MakeToc() {
        progressSupport = new ProgressSupport(this);
    }
View Full Code Here

Examples of com.bbn.openmap.event.ProgressSupport

    /**
     * Get progress support if needed.
     */
    protected ProgressSupport getProgressSupport() {
        if (progressSupport == null) {
            progressSupport = new ProgressSupport(this);
        }
        return progressSupport;
    }
View Full Code Here

Examples of com.bbn.openmap.event.ProgressSupport

    protected ProgressSupport progressSupport;

    public DTEDCoverageManager(String[] paths, String[] paths2,
            String coverageURL, String coverageFile) {

        progressSupport = new ProgressSupport(this);

        if (!readCoverageFile(coverageURL, coverageFile)) {
            // Swing issues with threading, this is trouble.
            //             ProgressListenerGauge plg = new
            // ProgressListenerGauge("Creating DTED Coverage File");
View Full Code Here

Examples of org.tmatesoft.hg.util.ProgressSupport

      return;
    }
    //
    // in fact, neither cancel nor progress of any use, need them just to check comamnd API
    final CancelSupport noCancel = CancelSupport.Factory.get(null);
    final ProgressSupport noProgress = ProgressSupport.Factory.get(null);
    //
    final Dump dump = new Dump(hgRepo);
    dump.complete(cmdLineOpts.getBoolean("--debug"));
    dump.verbose(cmdLineOpts.getBoolean("-v", "--verbose"));
    final boolean reverseOrder = !cmdLineOpts.getBoolean("--hg4j-order-direct");
View Full Code Here

Examples of org.tmatesoft.hg.util.ProgressSupport

   *
   * @return branch manager instance, never <code>null</code>
   * @throws HgRuntimeException subclass thereof to indicate issues with the library. <em>Runtime exception</em>
   */
  public HgBranches getBranches() throws HgRuntimeException {
    final ProgressSupport ps = ProgressSupport.Factory.get(null);
    if (branches == null) {
      branches = new HgBranches(impl);
      branches.collect(ps);
    } else {
      branches.reloadIfChanged(ps);
View Full Code Here

Examples of org.tmatesoft.hg.util.ProgressSupport

      assert delegate != null;
      inspector = delegate;
      csetBuilder = new ChangesetParser(sessionContext, new RawCsetFactory(true));
      inspectorLifecycle = Adaptable.Factory.getAdapter(delegate, Lifecycle.class, null);
      if (inspectorLifecycle == null) {
        ProgressSupport ph = Adaptable.Factory.getAdapter(delegate, ProgressSupport.class, null);
        CancelSupport cs = Adaptable.Factory.getAdapter(delegate, CancelSupport.class, null);
        if (cs != null || ph != null) {
          lifecycleStub = new LifecycleBridge(ph, cs);
        } else {
          lifecycleStub = null;
View Full Code Here

Examples of org.tmatesoft.hg.util.ProgressSupport

      throw new IllegalArgumentException();
    }
    if (file == null) {
      throw new HgBadArgumentException("Command needs file argument", null);
    }
    final ProgressSupport progress = getProgressSupport(inspector);
    final CancelSupport cancellation = getCancelSupport(inspector, true);
    cancellation.checkCancelled();
    progress.start(200);
    try {
      HgDataFile df = repo.getFileNode(file);
      if (!df.exists()) {
        return;
      }
      final int changesetStart = followRename ? 0 : df.getChangesetRevisionIndex(0);
      final int annotateRevIndex = annotateRevision.get(TIP);
      HgDiffCommand cmd = new HgDiffCommand(repo).file(df);
      cmd.range(changesetStart, annotateRevIndex);
      cmd.set(cancellation);
      cmd.set(new ProgressSupport.Sub(progress, 100));
      //
//      ReverseAnnotateInspector ai = new ReverseAnnotateInspector();
      ForwardAnnotateInspector ai = new ForwardAnnotateInspector();
      cmd.order(ai.iterateDirection());
      //
      cmd.executeAnnotate(ai);
      cancellation.checkCancelled();
      final int lastCsetWithFileChange;
      Nodeid fileRev = repo.getManifest().getFileRevision(annotateRevIndex, df.getPath());
      if (fileRev != null) {
        lastCsetWithFileChange = df.getChangesetRevisionIndex(df.getRevisionIndex(fileRev));
      } else {
        lastCsetWithFileChange = annotateRevIndex;
      }
      ai.report(lastCsetWithFileChange, inspector, new ProgressSupport.Sub(progress, 100), cancellation);
    } catch (HgRuntimeException ex) {
      throw new HgLibraryFailureException(ex);
    }
    progress.done();
  }
View Full Code Here

Examples of org.tmatesoft.hg.util.ProgressSupport

   * @throws HgRemoteConnectionException when failed to communicate with remote repository
   * @throws HgException subclass thereof to indicate specific issue with the command arguments or repository state
   * @throws CancelledException if execution of the command was cancelled
   */
  public List<Nodeid> executeLite() throws HgRemoteConnectionException, HgException, CancelledException {
    final ProgressSupport ps = getProgressSupport(null);
    try {
      return getOutgoingRevisions(ps, getCancelSupport(null, true));
    } catch (HgRuntimeException ex) {
      throw new HgLibraryFailureException(ex);
    } finally {
      ps.done();
    }
  }
View Full Code Here

Examples of org.tmatesoft.hg.util.ProgressSupport

   */
  public void executeFull(final HgChangesetHandler handler) throws HgCallbackTargetException, HgException, CancelledException {
    if (handler == null) {
      throw new IllegalArgumentException("Delegate can't be null");
    }
    final ProgressSupport ps = getProgressSupport(handler);
    final CancelSupport cs = getCancelSupport(handler, true);
    try {
      ps.start(200);
      ChangesetTransformer inspector = new ChangesetTransformer(localRepo, handler, getParentHelper(), new ProgressSupport.Sub(ps, 100), cs);
      inspector.limitBranches(branches);
      List<Nodeid> out = getOutgoingRevisions(new ProgressSupport.Sub(ps, 100), cs);
      int[] outRevIndex = new int[out.size()];
      int i = 0;
      for (Nodeid o : out) {
        outRevIndex[i++] = localRepo.getChangelog().getRevisionIndex(o);
      }
      localRepo.getChangelog().range(inspector, outRevIndex);
      inspector.checkFailure();
    } catch (HgRuntimeException ex) {
      throw new HgLibraryFailureException(ex);
    } finally {
      ps.done();
    }
  }
View Full Code Here

Examples of org.tmatesoft.hg.util.ProgressSupport

   * @throws CancelledException if execution of the command was cancelled
   * @throws HgException subclass thereof to indicate specific issue with the command arguments or repository state
   */
  public void executeAnnotate(HgBlameInspector insp) throws HgCallbackTargetException, CancelledException, HgException {
    checkFile();
    ProgressSupport progress = null;
    try {
      if (!df.exists()) {
        return;
      }
      final CancelSupport cancel = getCancelSupport(insp, true);
      BlameHelper bh = new BlameHelper(insp);
      final int startRevIndex = clogRevIndexStart.get(0);
      final int endRevIndex = clogRevIndexEnd.get(TIP);
      FileHistory fileHistory = bh.prepare(df, startRevIndex, endRevIndex);
      //
      cancel.checkCancelled();
      int totalWork = 0;
      for (FileRevisionHistoryChunk fhc : fileHistory.iterate(iterateDirection)) {
        totalWork += fhc.revisionCount();
      }
      progress = getProgressSupport(insp);
      progress.start(totalWork + 1);
      progress.worked(1); // BlameHelper.prepare
      //
      int[] fileClogParentRevs = new int[2];
      int[] fileParentRevs = new int[2];
      for (FileRevisionHistoryChunk fhc : fileHistory.iterate(iterateDirection)) {
        for (int fri : fhc.fileRevisions(iterateDirection)) {
          int clogRevIndex = fhc.changeset(fri);
          // the way we built fileHistory ensures we won't walk past [changelogRevIndexStart..changelogRevIndexEnd]
          assert clogRevIndex >= startRevIndex;
          assert clogRevIndex <= endRevIndex;
          fhc.fillFileParents(fri, fileParentRevs);
          fhc.fillCsetParents(fri, fileClogParentRevs);
          bh.annotateChange(fri, clogRevIndex, fileParentRevs, fileClogParentRevs);
          progress.worked(1);
          cancel.checkCancelled();
        }
      }
    } catch (HgRuntimeException ex) {
      throw new HgLibraryFailureException(ex);
    } finally {
      if (progress != null) {
        progress.done();
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.