⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 progressmonitorconsole.java

📁 基于java的3d开发库。对坐java3d的朋友有很大的帮助。
💻 JAVA
字号:
//===========================================================================//=-------------------------------------------------------------------------=//= Module history:                                                         =//= - March 19 2006 - Oscar Chavarro: Original base version                 =//===========================================================================package vsdk.toolkit.gui;public class ProgressMonitorConsole extends ProgressMonitor {    private double currentPercent;    private double jumpPercent;    private int lastPrintedLabel;    public ProgressMonitorConsole()    {    }    public void begin()    {        currentPercent = 0;        lastPrintedLabel = 0;        jumpPercent = 2;        System.out.print("[ 0% ");    }    public void end()    {        System.out.println(" 100% ]");    }    private boolean    testLabelLimit(int limit)    {        if ( limit == lastPrintedLabel ) return false;        if ( currentPercent - 6*jumpPercent/10 < limit &&             currentPercent + 6*jumpPercent/10 > limit )        {            System.out.print(" " + limit + "% ");            lastPrintedLabel = limit;            return true;        }        return false;    }    public void    update(double minValue, double maxValue, double currentValue)    {        double v = 100 * (currentValue - minValue) / (maxValue - minValue);        while ( currentPercent + jumpPercent < v ) {            currentPercent += jumpPercent;            if ( !testLabelLimit(25) &&                 !testLabelLimit(50) &&                  !testLabelLimit(75) ) {                System.out.print("-");            }        }    }}//===========================================================================//= EOF                                                                     =//===========================================================================

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -