de.lmu.ifi.dbs.elki.visualization.batikutil
Class JSVGUpdateSynchronizer

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.visualization.batikutil.JSVGUpdateSynchronizer
All Implemented Interfaces:
UpdateSynchronizer

 class JSVGUpdateSynchronizer
extends Object
implements UpdateSynchronizer

This class is used to synchronize SVG updates with an JSVG canvas.


Nested Class Summary
private  class JSVGUpdateSynchronizer.JSVGSynchronizedRunner
          Update Runner that will be placed in the Components UpdateManagers queue.
private  class JSVGUpdateSynchronizer.UMAdapter
          Adapter that will track the component for UpdateManager changes.
 
Field Summary
private  WeakReference<org.apache.batik.swing.svg.JSVGComponent> cref
          A weak reference to the component the plot is in.
private  WeakReference<JSVGUpdateSynchronizer.JSVGSynchronizedRunner> syncrunner
          The current Runnable scheduled
private  JSVGUpdateSynchronizer.UMAdapter umadapter
          Adapter to track component changes
private  List<WeakReference<UpdateRunner>> updaterunner
          The UpdateRunner we are put into
 
Constructor Summary
protected JSVGUpdateSynchronizer(org.apache.batik.swing.svg.JSVGComponent component)
          Create an updateSynchronizer for the given component.
 
Method Summary
 void activate()
          This method is called whenever a new pending event was added.
 void addUpdateRunner(UpdateRunner updateRunner)
          Set an update runner to use.
protected  void forgetSynchronizedRunner()
          Forget the current update runner.
private  JSVGUpdateSynchronizer.JSVGSynchronizedRunner getSynchronizedRunner()
          Get the current update runner.
protected  void invokeFromRunner(JSVGUpdateSynchronizer.JSVGSynchronizedRunner caller)
          Invoke from the SVGs run queue.
protected  void makeRunnerIfNeeded()
          Join the runnable queue of a component.
private  void setSynchronizedRunner(JSVGUpdateSynchronizer.JSVGSynchronizedRunner newrunner)
          Set the current update runner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cref

private final WeakReference<org.apache.batik.swing.svg.JSVGComponent> cref
A weak reference to the component the plot is in.


updaterunner

private List<WeakReference<UpdateRunner>> updaterunner
The UpdateRunner we are put into


umadapter

private final JSVGUpdateSynchronizer.UMAdapter umadapter
Adapter to track component changes


syncrunner

private WeakReference<JSVGUpdateSynchronizer.JSVGSynchronizedRunner> syncrunner
The current Runnable scheduled

Constructor Detail

JSVGUpdateSynchronizer

protected JSVGUpdateSynchronizer(org.apache.batik.swing.svg.JSVGComponent component)
Create an updateSynchronizer for the given component.

Parameters:
component - Component to manage updates on.
Method Detail

activate

public void activate()
Description copied from interface: UpdateSynchronizer
This method is called whenever a new pending event was added.

Specified by:
activate in interface UpdateSynchronizer

makeRunnerIfNeeded

protected void makeRunnerIfNeeded()
Join the runnable queue of a component.


addUpdateRunner

public void addUpdateRunner(UpdateRunner updateRunner)
Description copied from interface: UpdateSynchronizer
Set an update runner to use.

Specified by:
addUpdateRunner in interface UpdateSynchronizer

setSynchronizedRunner

private void setSynchronizedRunner(JSVGUpdateSynchronizer.JSVGSynchronizedRunner newrunner)
Set the current update runner

Parameters:
newrunner -

getSynchronizedRunner

private JSVGUpdateSynchronizer.JSVGSynchronizedRunner getSynchronizedRunner()
Get the current update runner.

Returns:
current update runner

invokeFromRunner

protected void invokeFromRunner(JSVGUpdateSynchronizer.JSVGSynchronizedRunner caller)
Invoke from the SVGs run queue.

Parameters:
caller - For consistency checks

forgetSynchronizedRunner

protected void forgetSynchronizedRunner()
Forget the current update runner. Called when the update manager is stopped.


Release 0.4.0 (2011-09-20_1324)