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 VisualizerContextcontextOur contextprivate doubleheightHeightprotected org.w3c.dom.ElementlayerLayer storageprotected VisualizationPlotsvgpThe plot we are attached toprotected VisualizationTasktaskThe visualization task we do.private doublewidthWidth
-
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 voidaddListeners()Add the listeners according to the mask.voidcontentChanged(DataStoreEvent e)Invoked after objects of the datastore have been updated, inserted or removed in some way.voiddestroy()Destroy the visualization.abstract voidfullRedraw()Request a full redrawing of the visualization.protected doublegetHeight()Get the heightorg.w3c.dom.ElementgetLayer()Get the SVG layer of the given visualization.protected doublegetWidth()Get the widthvoidincrementalRedraw()Redraw the visualization (maybe incremental).voidresultChanged(java.lang.Object current)Notify that the current result has changed substantially.voidvisualizationChanged(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:VisualizationDestroy the visualization. Called after the elements have been removed from the document. Implementations should remove their listeners etc.- Specified by:
destroyin interfaceVisualization
-
getLayer
public org.w3c.dom.Element getLayer()
Description copied from interface:VisualizationGet the SVG layer of the given visualization.- Specified by:
getLayerin 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:
incrementalRedrawin interfaceVisualization
-
fullRedraw
public abstract void fullRedraw()
Description copied from interface:VisualizationRequest a full redrawing of the visualization.- Specified by:
fullRedrawin interfaceVisualization
-
resultChanged
public void resultChanged(java.lang.Object current)
Description copied from interface:ResultListenerNotify that the current result has changed substantially.- Specified by:
resultChangedin interfaceResultListener- Parameters:
current- Result that has changed.
-
visualizationChanged
public void visualizationChanged(VisualizationItem item)
Description copied from interface:VisualizationListenerVisualization has changed.- Specified by:
visualizationChangedin interfaceVisualizationListener- Parameters:
item- Changed visualization
-
contentChanged
public void contentChanged(DataStoreEvent e)
Description copied from interface:DataStoreListenerInvoked after objects of the datastore have been updated, inserted or removed in some way.- Specified by:
contentChangedin interfaceDataStoreListener- Parameters:
e- the update event
-
-