Java Reference
In-Depth Information
NumberFormat percentFormat =
NumberFormat.getPercentInstance();
if ((this.waiting + this.processing + this.done) == 0) {
this.donePercent = 0;
} else {
this.donePercent = (double) this.done
/ (double) (this.waiting + this.processing + this.done);
}
if (total == 0) {
this.errorPercent = 0;
} else {
this.errorPercent = (double) this.error / (double) total;
}
g.drawString(stat1, 10, y);
g.drawString("" + numFormat.format(total), 200, y);
y += fm.getHeight();
g.drawString(stat2, 10, y);
g.drawString("" + numFormat.format(this.done) + "("
+ percentFormat.format(this.donePercent) + ")", 200, y);
y += fm.getHeight();
g.drawString(stat3, 10, y);
g.drawString("" + numFormat.format(this.waiting), 200, y);
y += fm.getHeight();
g.drawString(stat4, 10, y);
g.drawString("" + numFormat.format(this.processing), 200, y);
y += fm.getHeight();
g.drawString(stat5, 10, y);
g.drawString("" + numFormat.format(this.error) + "("
+ percentFormat.format(this.errorPercent) + ")", 200, y);
y += fm.getHeight();
g.drawString(stat6, 10, y);
g.drawString("" + numFormat.format(this.depth), 200, y);
y += fm.getHeight();
displayProgressBar(g, y);
}
Search WWH ::




Custom Search