de.lmu.ifi.dbs.elki.visualization.visualizers.thumbs
Class ThumbnailVisualization

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.visualization.visualizers.AbstractVisualization
      extended by de.lmu.ifi.dbs.elki.visualization.visualizers.thumbs.ThumbnailVisualization
All Implemented Interfaces:
DataStoreListener, ResultListener, ContextChangeListener, ThumbnailThread.Listener, Visualization, EventListener

public class ThumbnailVisualization
extends AbstractVisualization
implements ThumbnailThread.Listener, DataStoreListener

Thumbnail visualization.


Field Summary
private  int mask
          The event mask.
static int ON_DATA
          Constant to listen for data changes
static int ON_SELECTION
          Constant to listen for selection changes
protected  ThumbnailThread.Task pendingThumbnail
          Pending redraw
protected  File thumb
          The thumbnail file.
protected  int tresolution
          Thumbnail resolution
protected  VisFactory visFactory
          Visualizer factory
 
Fields inherited from class de.lmu.ifi.dbs.elki.visualization.visualizers.AbstractVisualization
context, layer, pendingRedraw, svgp, task
 
Constructor Summary
ThumbnailVisualization(VisFactory visFactory, VisualizationTask task, int mask)
          Constructor.
 
Method Summary
 void contentChanged(DataStoreEvent e)
          Invoked after objects of the datastore have been updated, inserted or removed in some way.
 void contextChanged(ContextChangedEvent e)
          Method called on context changes (e.g. projection changes).
 void destroy()
          Destroy the visualization.
 void doThumbnail(Thumbnailer t)
          Callback when to (re-)compute the thumbnail.
 Element getLayer()
          Get the SVG layer of the given visualization.
protected  void incrementalRedraw()
          Redraw the visualization (maybe incremental).
protected  void redraw()
          Perform a full redraw.
protected  void refreshThumbnail()
           
 void resultChanged(Result current)
          Notify that the current result has changed substantially.
protected  boolean testRedraw(ContextChangedEvent e)
          Override this method to add additional redraw triggers!
 
Methods inherited from class de.lmu.ifi.dbs.elki.visualization.visualizers.AbstractVisualization
getHeight, getWidth, resultAdded, resultRemoved, synchronizedRedraw
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ON_DATA

public static final int ON_DATA
Constant to listen for data changes

See Also:
Constant Field Values

ON_SELECTION

public static final int ON_SELECTION
Constant to listen for selection changes

See Also:
Constant Field Values

visFactory

protected final VisFactory visFactory
Visualizer factory


thumb

protected File thumb
The thumbnail file.


pendingThumbnail

protected ThumbnailThread.Task pendingThumbnail
Pending redraw


tresolution

protected int tresolution
Thumbnail resolution


mask

private int mask
The event mask. See ON_DATA, ON_SELECTION

Constructor Detail

ThumbnailVisualization

public ThumbnailVisualization(VisFactory visFactory,
                              VisualizationTask task,
                              int mask)
Constructor.

Parameters:
visFactory - Visualizer Factory to use
task - Task to use
mask - Event mask (for auto-updating)
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
Overrides:
destroy in class AbstractVisualization

getLayer

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

Specified by:
getLayer in interface Visualization
Overrides:
getLayer in class AbstractVisualization
Returns:
layer

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
Overrides:
contextChanged in class AbstractVisualization
Parameters:
e - Change event

testRedraw

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

Overrides:
testRedraw in class AbstractVisualization
Parameters:
e - Event
Returns:
Test result

contentChanged

public void contentChanged(DataStoreEvent e)
Description copied from interface: DataStoreListener
Invoked after objects of the datastore have been updated, inserted or removed in some way.

Specified by:
contentChanged in interface DataStoreListener
Parameters:
e - the update event

incrementalRedraw

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

Overrides:
incrementalRedraw in class AbstractVisualization

redraw

protected void redraw()
Perform a full redraw.

Specified by:
redraw in class AbstractVisualization

doThumbnail

public void doThumbnail(Thumbnailer t)
Description copied from interface: ThumbnailThread.Listener
Callback when to (re-)compute the thumbnail.

Specified by:
doThumbnail in interface ThumbnailThread.Listener
Parameters:
t - Thumbnailer to use

refreshThumbnail

protected void refreshThumbnail()

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
Overrides:
resultChanged in class AbstractVisualization
Parameters:
current - Result that has changed.

Release 0.4.0 (2011-09-20_1324)