Package elki.visualization.visualizers
Class AbstractVisualization
- java.lang.Object
-
- elki.visualization.visualizers.AbstractVisualization
-
- All Implemented Interfaces:
DataStoreListener
,ResultListener
,VisualizationListener
,Visualization
,java.util.EventListener
- Direct Known Subclasses:
AbstractHistogramVisualization
,AbstractOPTICSVisualization
,AbstractParallelVisualization
,AbstractScatterplotVisualization
,AbstractSilhouetteVisualization
,CircleSegmentsVisualizer.Instance
,DendrogramVisualization.Instance
,KeyVisualization.Instance
,PixmapVisualizer.Instance
,SimilarityMatrixVisualizer.Instance
,StaticVisualizationInstance
,ThumbnailVisualization
public abstract class AbstractVisualization extends java.lang.Object implements Visualization, ResultListener, VisualizationListener, DataStoreListener
Abstract base class for visualizations.- Since:
- 0.4.0
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description protected VisualizerContext
context
Our contextprivate double
height
Heightprotected org.w3c.dom.Element
layer
Layer storageprotected VisualizationPlot
svgp
The plot we are attached toprotected VisualizationTask
task
The visualization task we do.private double
width
Width
-
Constructor Summary
Constructors Constructor Description AbstractVisualization(VisualizerContext context, VisualizationTask task, VisualizationPlot plot, double width, double height)
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addListeners()
Add the listeners according to the mask.void
contentChanged(DataStoreEvent e)
Invoked after objects of the datastore have been updated, inserted or removed in some way.void
destroy()
Destroy the visualization.abstract void
fullRedraw()
Request a full redrawing of the visualization.protected double
getHeight()
Get the heightorg.w3c.dom.Element
getLayer()
Get the SVG layer of the given visualization.protected double
getWidth()
Get the widthvoid
incrementalRedraw()
Redraw the visualization (maybe incremental).void
resultChanged(java.lang.Object current)
Notify that the current result has changed substantially.void
visualizationChanged(VisualizationItem item)
Visualization has changed.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.result.ResultListener
resultAdded, resultRemoved
-
-
-
-
Field Detail
-
task
protected final VisualizationTask task
The visualization task we do.
-
context
protected final VisualizerContext context
Our context
-
svgp
protected final VisualizationPlot svgp
The plot we are attached to
-
layer
protected org.w3c.dom.Element layer
Layer storage
-
width
private double width
Width
-
height
private double height
Height
-
-
Constructor Detail
-
AbstractVisualization
public AbstractVisualization(VisualizerContext context, VisualizationTask task, VisualizationPlot plot, double width, double height)
Constructor.- Parameters:
context
- Visualizer contexttask
- Visualization taskplot
- Plot to draw towidth
- Embedding widthheight
- Embedding height
-
-
Method Detail
-
addListeners
protected void addListeners()
Add the listeners according to the mask.
-
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 interfaceVisualization
-
getLayer
public org.w3c.dom.Element getLayer()
Description copied from interface:Visualization
Get the SVG layer of the given visualization.- Specified by:
getLayer
in interfaceVisualization
- Returns:
- layer
-
getWidth
protected double getWidth()
Get the width- Returns:
- the width
-
getHeight
protected double getHeight()
Get the height- Returns:
- the height
-
incrementalRedraw
public void incrementalRedraw()
Redraw the visualization (maybe incremental). Optional - by default, it will do a full redraw, which often is faster!- Specified by:
incrementalRedraw
in interfaceVisualization
-
fullRedraw
public abstract void fullRedraw()
Description copied from interface:Visualization
Request a full redrawing of the visualization.- Specified by:
fullRedraw
in interfaceVisualization
-
resultChanged
public void resultChanged(java.lang.Object current)
Description copied from interface:ResultListener
Notify that the current result has changed substantially.- Specified by:
resultChanged
in interfaceResultListener
- Parameters:
current
- Result that has changed.
-
visualizationChanged
public void visualizationChanged(VisualizationItem item)
Description copied from interface:VisualizationListener
Visualization has changed.- Specified by:
visualizationChanged
in interfaceVisualizationListener
- Parameters:
item
- Changed visualization
-
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 interfaceDataStoreListener
- Parameters:
e
- the update event
-
-