Public Member Functions | |
ProgressHandler (String name) | |
Create a new ProgressHandler with a given name. | |
boolean | setProgressValue (int v) |
Set the progress value. | |
float | getRatio () |
Get the progress ratio as float. | |
int | getPercent () |
Get the progress ratio as percent. | |
void | reset (int max) |
Reset this handler. | |
Static Public Attributes | |
static final long | serialVersionUID = 0x10050001 |
static final Color | STEP_1_COLOR = new Color( 211, 0, 28 ) |
static final Color | STEP_2_COLOR = new Color( 255, 68, 0 ) |
static final Color | STEP_3_COLOR = new Color( 123, 211, 0 ) |
static final ProgressHandler | NULL |
A null progress handler. |
This object is used to handle progression of an action. It can be used on a graphic interface as a JProgressBar.
org.miv.jism.core.ProgressHandler.ProgressHandler | ( | String | name | ) |
Create a new ProgressHandler with a given name.
Name is used to identified action which handle this progression. If handler is used in a gui, name will be displayed on the progress bar.
name | name of the action |
boolean org.miv.jism.core.ProgressHandler.setProgressValue | ( | int | v | ) |
Set the progress value.
If new value changes the progress percent, method will return true.
v | new value |
float org.miv.jism.core.ProgressHandler.getRatio | ( | ) |
Get the progress ratio as float.
int org.miv.jism.core.ProgressHandler.getPercent | ( | ) |
Get the progress ratio as percent.
void org.miv.jism.core.ProgressHandler.reset | ( | int | max | ) |
Reset this handler.
Current value will be set to 0.
max | max progress value |
final ProgressHandler org.miv.jism.core.ProgressHandler.NULL [static] |
Initial value:
new ProgressHandler( "null" ) { public static final long serialVersionUID = 0x10051001; public boolean setProgressValue( int v ) { return false; } public float getRatio() { return 0; } public int getPercent() { return 0; } public void reset( int max ) { } }
Methods are overriden to do nothing.