edu.jhu.ece.iacl.jist.pipeline.view.input
Class Refresher

java.lang.Object
  extended by edu.jhu.ece.iacl.jist.pipeline.view.input.Refresher
All Implemented Interfaces:
java.lang.Runnable

public class Refresher
extends java.lang.Object
implements java.lang.Runnable

The Class Refresher.


Field Summary
protected  boolean disabled
           
protected  int disabledCount
           
protected  java.util.Vector<Refreshable> objs
          The objs.
protected static Refresher refresher
          The refresher.
 
Constructor Summary
Refresher()
          Constructs new refresher for refreshable view.
 
Method Summary
 void add(Refreshable obj)
          add item to monitor.
 void disable()
           
 void enable()
           
static Refresher getInstance()
          Get singleton reference to constructor.
 long getRefreshInterval()
          Get refreshing interval.
 void pauseAll()
          Pause all refreshing.
 void refreshAll()
           
 boolean remove(Refreshable obj)
          Remove refreshable object.
 void removeAll()
          Remove all refreshable objects.
 void resumeAll()
          Resume all refreshing.
 void run()
          Periodically refresh view.
 void setRefreshInterval(long refreshInterval)
          Set refresh interval.
 void start()
          Start refresher.
 void stop()
          Force refresher to stop prematurely.
 void stopAll()
          Stop refresher.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

refresher

protected static Refresher refresher
The refresher.


objs

protected java.util.Vector<Refreshable> objs
The objs.


disabled

protected boolean disabled

disabledCount

protected int disabledCount
Constructor Detail

Refresher

public Refresher()
Constructs new refresher for refreshable view. Starts refresher thread.

Method Detail

getInstance

public static Refresher getInstance()
Get singleton reference to constructor.

Returns:
the instance

disable

public void disable()

enable

public void enable()

add

public void add(Refreshable obj)
add item to monitor.

Parameters:
obj - refreshable object

getRefreshInterval

public long getRefreshInterval()
Get refreshing interval.

Returns:
time in milliseconds

pauseAll

public void pauseAll()
Pause all refreshing.


remove

public boolean remove(Refreshable obj)
Remove refreshable object.

Parameters:
obj - refreshable object
Returns:
true if removed successfully

removeAll

public void removeAll()
Remove all refreshable objects.


resumeAll

public void resumeAll()
Resume all refreshing.


run

public void run()
Periodically refresh view.

Specified by:
run in interface java.lang.Runnable

refreshAll

public void refreshAll()

setRefreshInterval

public void setRefreshInterval(long refreshInterval)
Set refresh interval. The default is 1 second.

Parameters:
refreshInterval - Refresh interval in milliseconds

start

public void start()
Start refresher.


stop

public void stop()
Force refresher to stop prematurely.


stopAll

public void stopAll()
Stop refresher.