de.lmu.ifi.dbs.elki.visualization.visualizers
Class AbstractVisualization

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.visualization.visualizers.AbstractVisualization
All Implemented Interfaces:
ResultListener, ContextChangeListener, Visualization, EventListener
Direct Known Subclasses:
AbstractOPTICSVisualization, P1DVisualization, P2DVisualization, PixmapVisualizer, SimilarityMatrixVisualizer, StaticVisualization, ThumbnailVisualization

public abstract class AbstractVisualization
extends Object
implements Visualization, ContextChangeListener, ResultListener

Abstract base class for visualizations.


Field Summary
protected  VisualizerContext context
          Our context
protected  Element layer
          Layer storage
protected  Runnable pendingRedraw
          Pending redraw
protected  SVGPlot svgp
          The plot we are attached to
protected  VisualizationTask task
          The visualization task we do.
 
Constructor Summary
AbstractVisualization(VisualizationTask task)
          Constructor.
 
Method Summary
 void contextChanged(ContextChangedEvent e)
          Method called on context changes (e.g. projection changes).
 void destroy()
          Destroy the visualization.
protected  double getHeight()
          Get the height
 Element getLayer()
          Get the SVG layer of the given visualization.
protected  double getWidth()
          Get the width
protected  void incrementalRedraw()
          Redraw the visualization (maybe incremental).
protected abstract  void redraw()
          Perform a full redraw.
 void resultAdded(Result child, Result parent)
          A new derived result was added.
 void resultChanged(Result current)
          Notify that the current result has changed substantially.
 void resultRemoved(Result child, Result parent)
          A result was removed.
protected  void synchronizedRedraw()
          Trigger a redraw, but avoid excessive redraws.
protected  boolean testRedraw(ContextChangedEvent e)
          Override this method to add additional redraw triggers!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

task

protected final VisualizationTask task
The visualization task we do.


context

protected final VisualizerContext context
Our context


svgp

protected final SVGPlot svgp
The plot we are attached to


pendingRedraw

protected Runnable pendingRedraw
Pending redraw


layer

protected Element layer
Layer storage

Constructor Detail

AbstractVisualization

public AbstractVisualization(VisualizationTask task)
Constructor.

Parameters:
task - Visualization task
Method Detail

destroy

public void destroy()
Description copied from interface: Visualization
Destroy the visualization. Called after the elements have been removed from the document. Implementations should remove their listeners etc.

Specified by:
destroy in interface Visualization

getLayer

public Element getLayer()
Description copied from interface: Visualization
Get the SVG layer of the given visualization.

Specified by:
getLayer in interface Visualization
Returns:
layer

getWidth

protected double getWidth()
Get the width

Returns:
the width

getHeight

protected double getHeight()
Get the height

Returns:
the height

contextChanged

public void contextChanged(ContextChangedEvent e)
Description copied from interface: ContextChangeListener
Method called on context changes (e.g. projection changes). Usually, this should trigger a redraw!

Specified by:
contextChanged in interface ContextChangeListener
Parameters:
e - Change event

testRedraw

protected boolean testRedraw(ContextChangedEvent e)
Override this method to add additional redraw triggers!

Parameters:
e - Event
Returns:
Test result

synchronizedRedraw

protected final void synchronizedRedraw()
Trigger a redraw, but avoid excessive redraws.


incrementalRedraw

protected void incrementalRedraw()
Redraw the visualization (maybe incremental). Optional - by default, it will do a full redraw, which often is faster!


redraw

protected abstract void redraw()
Perform a full redraw.


resultAdded

public void resultAdded(Result child,
                        Result parent)
Description copied from interface: ResultListener
A new derived result was added.

Specified by:
resultAdded in interface ResultListener
Parameters:
child - New child result added
parent - Parent result that was added to

resultChanged

public void resultChanged(Result current)
Description copied from interface: ResultListener
Notify that the current result has changed substantially.

Specified by:
resultChanged in interface ResultListener
Parameters:
current - Result that has changed.

resultRemoved

public void resultRemoved(Result child,
                          Result parent)
Description copied from interface: ResultListener
A result was removed.

Specified by:
resultRemoved in interface ResultListener
Parameters:
child - result that was removed
parent - Parent result that was removed from

Release 0.4.0 (2011-09-20_1324)