Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.visualization.gui.overview
Class OverviewPlot<NV extends NumberVector<NV,?>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.visualization.svg.SVGPlot
      extended by de.lmu.ifi.dbs.elki.visualization.gui.overview.OverviewPlot<NV>
Type Parameters:
NV - Number vector type
All Implemented Interfaces:
RedrawListener, EventListener

public class OverviewPlot<NV extends NumberVector<NV,?>>
extends SVGPlot
implements RedrawListener

Generate an overview plot for a set of visualizations.

Author:
Erich Schubert, Remigius Wojdanowski

Nested Class Summary
 class OverviewPlot.SelectPlotEvent
          Event when a plot was selected.
protected  class OverviewPlot.ThumbnailThread
          Thread to update thumbnails in the background.
 
Field Summary
private  Vector<ActionListener> actionListeners
          Action listeners for this plot.
private  Database<? extends DatabaseObject> db
          Database we work on.
private  EventListener hoverer
          React to mouse hover events
private  Element hoverlayer
          Layer for hover elements
static int MAX_DIMENSIONS_DEFAULT
          Maximum number of dimensions to visualize.
private  int maxdim
          Stores the maximum number of dimensions to show.
private  Element plotlayer
          Layer for plot thumbnail
protected  PlotMap<NV> plotmap
          Map of coordinates to plots.
(package private)  Queue<Pair<Element,VisualizationInfo>> queue
          Queue of thumbnails to generate.
private  MultiResult result
          Result we work on.
 int screenheight
          Screen size (used for thumbnail sizing)
 int screenwidth
          Screen size (used for thumbnail sizing)
private  CSSClass selcss
          The CSS class used on "selectable" rectangles.
private  boolean stopped
          Flag to indicate shutdown.
(package private) static Thumbnailer t
          Thumbnailer to use.
private  OverviewPlot.ThumbnailThread thumbnails
          Current thumbnail thread.
private  Collection<Visualizer> vis
          Visualizations
private  HashMap<VisualizationInfo,Element> vistoelem
          Lookup
 
Fields inherited from class de.lmu.ifi.dbs.elki.visualization.svg.SVGPlot
DEFAULT_QUALITY
 
Constructor Summary
OverviewPlot(Database<? extends DatabaseObject> db, MultiResult result, int maxdim)
          Constructor.
 
Method Summary
 void addActionListener(ActionListener actionListener)
          Adds an ActionListener to the plot.
private  void addOrQueueThumbnail(VisualizationInfo vi, Element gg)
          Queue a thumbnail for generation.
 void addVisualizations(Collection<Visualizer> vs)
          Add vis to the plot.
private  void arrangeVisualizations()
          Recompute the layout of visualizations.
 void dispose()
          Cancel the overview, i.e. stop the thumbnailer
protected  void generateThumbnail(Element g, VisualizationInfo vi)
          Generate a single Thumbnail.
 SVGPlot makeDetailPlot(double x, double y)
          Event triggered when a plot was selected.
private  void queueThumbnail(VisualizationInfo vi, Element gg)
          Queue a thumbnail for generation.
private  void recalcViewbox()
          Recompute the view box of the plot.
 void refresh()
          Do a refresh (when visibilities have changed).
 void reinitialize()
          Refresh the overview plot.
private  void setupHoverer()
          Setup the CSS hover effect.
private  void stopThumbnailer()
          Stop a running thumbnailer.
 void triggerRedraw(Visualizer caller)
          Called when a redraw is needed.
protected  void triggerSubplotSelectEvent(double x, double y)
          When a subplot was selected, forward the event to listeners.
private  Database<NV> uglyCastDatabase()
          Ugly cast of the database to a default number vector.
 
Methods inherited from class de.lmu.ifi.dbs.elki.visualization.svg.SVGPlot
dumpDebugFile, getAllIds, getCSSClassManager, getDefs, getDisableInteractions, getDocument, getIdElement, getRoot, getStyle, putIdElement, saveAsANY, saveAsEPS, saveAsJPEG, saveAsJPEG, saveAsPDF, saveAsPNG, saveAsPS, saveAsSVG, scheduleUpdate, setDisableInteractions, svgCircle, svgElement, svgLine, svgRect, svgText, synchronizeWith, transcode, unsynchronizeWith, updateStyleElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_DIMENSIONS_DEFAULT

public static final int MAX_DIMENSIONS_DEFAULT
Maximum number of dimensions to visualize. TODO: Erich: add scrolling function for higher dimensionality!

See Also:
Constant Field Values

maxdim

private int maxdim
Stores the maximum number of dimensions to show.


vis

private Collection<Visualizer> vis
Visualizations


db

private Database<? extends DatabaseObject> db
Database we work on.


result

private MultiResult result
Result we work on. Currently unused, but kept for future requirements.


plotmap

protected PlotMap<NV extends NumberVector<NV,?>> plotmap
Map of coordinates to plots.


t

static Thumbnailer t
Thumbnailer to use.


actionListeners

private Vector<ActionListener> actionListeners
Action listeners for this plot.


thumbnails

private OverviewPlot.ThumbnailThread thumbnails
Current thumbnail thread.


queue

Queue<Pair<Element,VisualizationInfo>> queue
Queue of thumbnails to generate.


screenwidth

public int screenwidth
Screen size (used for thumbnail sizing)


screenheight

public int screenheight
Screen size (used for thumbnail sizing)


hoverer

private EventListener hoverer
React to mouse hover events


vistoelem

private HashMap<VisualizationInfo,Element> vistoelem
Lookup


plotlayer

private Element plotlayer
Layer for plot thumbnail


hoverlayer

private Element hoverlayer
Layer for hover elements


selcss

private CSSClass selcss
The CSS class used on "selectable" rectangles.


stopped

private boolean stopped
Flag to indicate shutdown.

Constructor Detail

OverviewPlot

public OverviewPlot(Database<? extends DatabaseObject> db,
                    MultiResult result,
                    int maxdim)
Constructor.

Parameters:
db - Database
result - Result to visualize
maxdim - Maximum number of dimensions
Method Detail

addVisualizations

public void addVisualizations(Collection<Visualizer> vs)
Add vis to the plot. Call refresh() when done.

Parameters:
vs - vis.

arrangeVisualizations

private void arrangeVisualizations()
Recompute the layout of visualizations.


reinitialize

public void reinitialize()
Refresh the overview plot.


refresh

public void refresh()
Do a refresh (when visibilities have changed).


addOrQueueThumbnail

private void addOrQueueThumbnail(VisualizationInfo vi,
                                 Element gg)
Queue a thumbnail for generation.

Parameters:
vi - VisualizationInfo
gg - Thumbnail element

queueThumbnail

private void queueThumbnail(VisualizationInfo vi,
                            Element gg)
Queue a thumbnail for generation.

Parameters:
vi - VisualizationInfo
gg - Thumbnail element

recalcViewbox

private void recalcViewbox()
Recompute the view box of the plot.


stopThumbnailer

private void stopThumbnailer()
Stop a running thumbnailer.


setupHoverer

private void setupHoverer()
Setup the CSS hover effect.


generateThumbnail

protected void generateThumbnail(Element g,
                                 VisualizationInfo vi)
Generate a single Thumbnail.

Parameters:
g - Parent element to insert the thumbnail into.
vi - Visualization.

uglyCastDatabase

private Database<NV> uglyCastDatabase()
Ugly cast of the database to a default number vector.

Returns:
Database

makeDetailPlot

public SVGPlot makeDetailPlot(double x,
                              double y)
Event triggered when a plot was selected.

Parameters:
x - X coordinate
y - Y coordinate
Returns:
sub plot

addActionListener

public void addActionListener(ActionListener actionListener)
Adds an ActionListener to the plot.

Parameters:
actionListener - the ActionListener to be added

triggerSubplotSelectEvent

protected void triggerSubplotSelectEvent(double x,
                                         double y)
When a subplot was selected, forward the event to listeners.

Parameters:
x - X coordinate
y - Y coordinate

dispose

public void dispose()
Cancel the overview, i.e. stop the thumbnailer


triggerRedraw

public void triggerRedraw(Visualizer caller)
Description copied from interface: RedrawListener
Called when a redraw is needed.

Specified by:
triggerRedraw in interface RedrawListener
Parameters:
caller - Visualization that requested a redraw.

Release 0.3 (2010-03-31_1612)