Java Reference
In-Depth Information
/**
* Percent error.
*/
private double errorPercent;
/**
* Construct a SpiderStats object.
*
* @param config
* A path to a spider configuration file.
* @throws IOException
* Thrown if an I/O error occurs.
* @throws SpiderException
* Thrown if the options can not be loaded.
*/
public SpiderStats(String config)
throws IOException, SpiderException {
this.options = new SpiderOptions();
this.options.load(config);
this.thread = new Thread(this);
this.thread.start();
}
/**
* Display the stats.
*
* @param g
* The graphics object.
*/
public void displayStats(Graphics g) {
final String stat1 = "Total URL\'s Encountered:";
final String stat2 = "Completed URL\'s:";
final String stat3 = "Waiting URL\'s:";
final String stat4 = "URL\'s Currently Processing:";
final String stat5 = "URL\'s with Errors:";
final String stat6 = "Deepest URL\'s found:";
FontMetrics fm = g.getFontMetrics();
int y = fm.getHeight();
g.setColor(Color.WHITE);
g.fillRect(0, 0, getWidth(), getHeight());
g.setColor(Color.BLACK);
int total = this.processing + this.error
+ this.done + this.waiting;
NumberFormat numFormat = NumberFormat.getInstance();
Search WWH ::




Custom Search