cz.polous.andaria
Class ProgressBar

java.lang.Object
  extended by cz.polous.andaria.ProgressBar
Direct Known Subclasses:
PatcherQueue

public class ProgressBar
extends java.lang.Object

Take cares about progress bar and labels. Universal class used by Installer and Downloader.

Author:
Martin Polehla

Nested Class Summary
static class ProgressBar.BARS
           
 
Field Summary
private  Log log
           
private  long singleMax
           
private  long singleProgress
           
private  java.text.NumberFormat speedFormat
           
private  long totalMax
           
private  long totalProgress
           
 
Constructor Summary
protected ProgressBar()
          Constructor
 
Method Summary
(package private)  long getSingleMax()
           
(package private)  long getSingleProgress()
           
(package private)  java.lang.String getSpeedLabelText()
           
(package private)  long getTotalMax()
           
(package private)  long getTotalProgress()
           
 void removeFromTotalProgress(long i)
           
(package private)  void resetProgressBar(int bar)
           
(package private)  void resetProgressBar(int bar, long max)
           
(package private)  void setLabelSpeed(double speed)
          Set patchers speed label
(package private)  void setLabelText(java.lang.String s)
           
 void setSingleMax(long i)
           
 void setSingleProgress(long i)
          Set single file progress to a value (it shouldn't be more than singlDoneMax).
(package private)  void setSingleProgressPercents(int perc)
           
 void setTotalMax(long i)
           
 void setTotalProgress(long i)
           
protected  void updateProgressBar(int bar)
          Update progressbar component and repaint it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private Log log

totalProgress

private long totalProgress

totalMax

private long totalMax

singleProgress

private long singleProgress

singleMax

private long singleMax

speedFormat

private java.text.NumberFormat speedFormat
Constructor Detail

ProgressBar

protected ProgressBar()
Constructor

Method Detail

updateProgressBar

protected void updateProgressBar(int bar)
Update progressbar component and repaint it. (count from totalDone / totalAmount percent).


setLabelText

void setLabelText(java.lang.String s)

getSpeedLabelText

java.lang.String getSpeedLabelText()

setLabelSpeed

void setLabelSpeed(double speed)
Set patchers speed label

Parameters:
i - (double) speed in bytes per second

setSingleProgress

public void setSingleProgress(long i)
Set single file progress to a value (it shouldn't be more than singlDoneMax). Also updates totalProgress value.

Parameters:
i - (double) value

resetProgressBar

void resetProgressBar(int bar,
                      long max)

resetProgressBar

void resetProgressBar(int bar)

removeFromTotalProgress

public void removeFromTotalProgress(long i)

getTotalProgress

long getTotalProgress()

getTotalMax

long getTotalMax()

getSingleProgress

long getSingleProgress()

getSingleMax

long getSingleMax()

setTotalProgress

public void setTotalProgress(long i)

setTotalMax

public void setTotalMax(long i)

setSingleMax

public void setSingleMax(long i)

setSingleProgressPercents

void setSingleProgressPercents(int perc)