当前位置: 首页>>代码示例>>Java>>正文


Java ProgressBar类代码示例

本文整理汇总了Java中me.tongfei.progressbar.ProgressBar的典型用法代码示例。如果您正苦于以下问题:Java ProgressBar类的具体用法?Java ProgressBar怎么用?Java ProgressBar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ProgressBar类属于me.tongfei.progressbar包,在下文中一共展示了ProgressBar类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: mark

import me.tongfei.progressbar.ProgressBar; //导入依赖的package包/类
/**
 * Marks all of the submissions.
 * @param threads The thread-pool size to use in marking the assignments
 */
public void mark(final int threads)
    throws Exception {
    final ProgressBar pb = new ProgressBar("Marking", this.submissions.size());
    pb.start();
    final CountDownLatch latch = new CountDownLatch(this.submissions.size());
    final ThreadPoolExecutor executor = new ThreadPoolExecutor(
        threads,
        threads,
        0L,
        TimeUnit.MILLISECONDS,
        new ArrayBlockingQueue<>(threads),
        new ThreadPoolExecutor.CallerRunsPolicy()
    );
    for (Submission s : this.submissions) {
        executor.submit(() -> {
            try {
                s.results(this.markingResults(s.directory()));
                pb.step();
            } catch (Exception e) {
                throw new RuntimeException(e);
            } finally {
                latch.countDown();
            }
        });
    }
    executor.shutdown();
    latch.await();
    pb.stop();
}
 
开发者ID:jachinte,项目名称:grade-buddy,代码行数:34,代码来源:AutomatedMarking.java

示例2: ProgressStream

import me.tongfei.progressbar.ProgressBar; //导入依赖的package包/类
/**
 * ProgressStream implements an extends InputStream while also writing out the read progress on
 * console. ProgressStream can be used as a direct replacement for any InputStream compatible
 * input.
 * 
 * @param msg Custom message string.
 * @param style Custom progress bar style.
 * @param size Size of the progress bar.
 * @param stream InputStream to be wrapped.
 * @throws IOException For any exception generated by the InputStream.
 */
public ProgressStream(String msg, ProgressBarStyle style, long size, InputStream stream)
    throws IOException {
  super();

  // Allocate the reader.
  this.in = stream;

  // Initialize progress bar.
  this.pb = new ProgressBar(msg, size, style);
  this.pb.start();
}
 
开发者ID:minio,项目名称:minio-java,代码行数:23,代码来源:ProgressStream.java

示例3: printBar

import me.tongfei.progressbar.ProgressBar; //导入依赖的package包/类
public void printBar(ProgressGauge progressGauge) {
    PrintStream os = new PrintStream(new WriterOutputStream(rawPrint ? pw : console.getOutput()));
    String label = app().config().i18nEnabled() ? i18n("act.progress.capFirst") : "Progress";
    ProgressBar pb = new ProgressBar(label, progressGauge.maxHint(), 200, os, ProgressBarStyle.UNICODE_BLOCK);
    pb.start();
    while (!progressGauge.done()) {
        pb.maxHint(progressGauge.maxHint());
        pb.stepTo(progressGauge.currentSteps());
        flush();
    }
    pb.stepTo(pb.getMax());
    pb.stop();
}
 
开发者ID:actframework,项目名称:actframework,代码行数:14,代码来源:CliContext.java

示例4: message

import me.tongfei.progressbar.ProgressBar; //导入依赖的package包/类
@Override
public void message(ProgressBar pb) {
	pb.setExtraMessage("Getting BibText informations...");
}
 
开发者ID:jacksonpradolima,项目名称:csv2bib,代码行数:5,代码来源:SpringerBibTex.java

示例5: message

import me.tongfei.progressbar.ProgressBar; //导入依赖的package包/类
@Override
public void message(ProgressBar pb) {
	pb.setExtraMessage("Getting RIS informations...");
}
 
开发者ID:jacksonpradolima,项目名称:csv2bib,代码行数:5,代码来源:SpringerRis.java

示例6: message

import me.tongfei.progressbar.ProgressBar; //导入依赖的package包/类
/**
 * Put message to Progress Bar
 * @param pb
 */
default void message(ProgressBar pb) {
	pb.setExtraMessage("Getting Information");
}
 
开发者ID:jacksonpradolima,项目名称:csv2bib,代码行数:8,代码来源:SpringerExporter.java


注:本文中的me.tongfei.progressbar.ProgressBar类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。