org.miv.jism.core.ProgressHandler Class Reference

Describe progress of an action. More...

List of all members.

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.


Detailed Description

Describe progress of an action.

This object is used to handle progression of an action. It can be used on a graphic interface as a JProgressBar.

Author:
Guilhelm Savin
See also:
javax.swing.JProgressBar

Constructor & Destructor Documentation

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.

Parameters:
name name of the action


Member Function Documentation

boolean org.miv.jism.core.ProgressHandler.setProgressValue ( int  v  ) 

Set the progress value.

If new value changes the progress percent, method will return true.

Parameters:
v new value
Returns:
true if percent change

float org.miv.jism.core.ProgressHandler.getRatio (  ) 

Get the progress ratio as float.

Returns:
progress ratio

int org.miv.jism.core.ProgressHandler.getPercent (  ) 

Get the progress ratio as percent.

Returns:
progress percent

void org.miv.jism.core.ProgressHandler.reset ( int  max  ) 

Reset this handler.

Current value will be set to 0.

Parameters:
max max progress value


Member Data Documentation

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 )
                {
                }
        }
A null progress handler.

Methods are overriden to do nothing.


The documentation for this class was generated from the following file:
Generated on Fri Apr 18 10:49:00 2008 for JisM by  doxygen 1.5.3