de.lmu.ifi.dbs.elki.visualization.svg
Class UpdateRunner

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.visualization.svg.UpdateRunner

public class UpdateRunner
extends Object

Class to handle updates to an SVG plot, in particular when used in an Apache Batik UI.


Field Summary
private  Queue<Runnable> queue
          The queue of pending updates
private  Object sync
          Owner/Synchronization object
private  Collection<UpdateSynchronizer> synchronizer
          Synchronizer that can block events from being executed right away.
 
Constructor Summary
protected UpdateRunner(Object sync)
          Construct a new update handler
 
Method Summary
 void clear()
          Clear queue.
 void invokeLater(Runnable r)
          Add a new update to run at any appropriate time.
 boolean isEmpty()
          Check whether the queue is empty.
 void runQueue()
          Run the processing queue now.
 void synchronizeWith(UpdateSynchronizer newsync)
          Set a new update synchronizer.
 void unsynchronizeWith(UpdateSynchronizer oldsync)
          Remove an update synchronizer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sync

private Object sync
Owner/Synchronization object


queue

private final Queue<Runnable> queue
The queue of pending updates


synchronizer

private Collection<UpdateSynchronizer> synchronizer
Synchronizer that can block events from being executed right away.

Constructor Detail

UpdateRunner

protected UpdateRunner(Object sync)
Construct a new update handler

Parameters:
sync - Object to synchronize on
Method Detail

invokeLater

public void invokeLater(Runnable r)
Add a new update to run at any appropriate time.

Parameters:
r - New runnable to perform the update

runQueue

public void runQueue()
Run the processing queue now. This should usually be only invoked by the UpdateSynchronizer


clear

public void clear()
Clear queue. For shutdown!


isEmpty

public boolean isEmpty()
Check whether the queue is empty.

Returns:
queue status

synchronizeWith

public void synchronizeWith(UpdateSynchronizer newsync)
Set a new update synchronizer.

Parameters:
newsync - Update synchronizer

unsynchronizeWith

public void unsynchronizeWith(UpdateSynchronizer oldsync)
Remove an update synchronizer

Parameters:
oldsync - Update synchronizer to remove

Release 0.4.0 (2011-09-20_1324)