Class AbstractTooltipVisualization
- java.lang.Object
-
- elki.visualization.visualizers.AbstractVisualization
-
- elki.visualization.visualizers.scatterplot.AbstractScatterplotVisualization
-
- elki.visualization.visualizers.scatterplot.AbstractTooltipVisualization
-
- All Implemented Interfaces:
DataStoreListener,ResultListener,VisualizationListener,Visualization,java.util.EventListener
- Direct Known Subclasses:
TooltipScoreVisualization.Instance,TooltipStringVisualization.Instance
public abstract class AbstractTooltipVisualization extends AbstractScatterplotVisualization implements DataStoreListener
General base class for a tooltip visualizer.- Since:
- 0.4.0
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description (package private) org.w3c.dom.events.EventListenerhovererOur event listener.static java.lang.StringTOOLTIP_AREAGeneric tag to indicate the type of element.static java.lang.StringTOOLTIP_HIDDENGeneric tag to indicate the type of element.static java.lang.StringTOOLTIP_STICKYGeneric tag to indicate the type of element.static java.lang.StringTOOLTIP_VISIBLEGeneric tag to indicate the type of element.-
Fields inherited from class elki.visualization.visualizers.scatterplot.AbstractScatterplotVisualization
proj, rel, sample
-
Fields inherited from class elki.visualization.visualizers.AbstractVisualization
context, layer, svgp, task
-
-
Constructor Summary
Constructors Constructor Description AbstractTooltipVisualization(VisualizerContext context, VisualizationTask task, VisualizationPlot plot, double width, double height, Projection proj)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidfullRedraw()Request a full redrawing of the visualization.protected voidhandleHoverEvent(org.w3c.dom.events.Event evt)Handle the hover events.protected abstract org.w3c.dom.ElementmakeTooltip(DBIDRef id, double x, double y, double dotsize)Make a tooltip Element for this id.protected abstract voidsetupCSS(SVGPlot svgp)Registers the Tooltip-CSS-Class at a SVGPlot.protected voidtoggleTooltip(org.w3c.dom.Element elem, java.lang.String type)Toggle the Tooltip of an element.-
Methods inherited from class elki.visualization.visualizers.scatterplot.AbstractScatterplotVisualization
setupCanvas, setupCanvas, visualizationChanged
-
Methods inherited from class elki.visualization.visualizers.AbstractVisualization
addListeners, contentChanged, destroy, getHeight, getLayer, getWidth, incrementalRedraw, resultChanged
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.database.datastore.DataStoreListener
contentChanged
-
Methods inherited from interface elki.result.ResultListener
resultAdded, resultRemoved
-
-
-
-
Field Detail
-
TOOLTIP_HIDDEN
public static final java.lang.String TOOLTIP_HIDDEN
Generic tag to indicate the type of element. Used in IDs, CSS-Classes etc.- See Also:
- Constant Field Values
-
TOOLTIP_VISIBLE
public static final java.lang.String TOOLTIP_VISIBLE
Generic tag to indicate the type of element. Used in IDs, CSS-Classes etc.- See Also:
- Constant Field Values
-
TOOLTIP_STICKY
public static final java.lang.String TOOLTIP_STICKY
Generic tag to indicate the type of element. Used in IDs, CSS-Classes etc.- See Also:
- Constant Field Values
-
TOOLTIP_AREA
public static final java.lang.String TOOLTIP_AREA
Generic tag to indicate the type of element. Used in IDs, CSS-Classes etc.- See Also:
- Constant Field Values
-
hoverer
org.w3c.dom.events.EventListener hoverer
Our event listener.
-
-
Constructor Detail
-
AbstractTooltipVisualization
public AbstractTooltipVisualization(VisualizerContext context, VisualizationTask task, VisualizationPlot plot, double width, double height, Projection proj)
Constructor.- Parameters:
context- Visualizer contexttask- Visualization taskplot- Plot to draw towidth- Embedding widthheight- Embedding heightproj- Projection
-
-
Method Detail
-
fullRedraw
public void fullRedraw()
Description copied from interface:VisualizationRequest a full redrawing of the visualization.- Specified by:
fullRedrawin interfaceVisualization- Specified by:
fullRedrawin classAbstractVisualization
-
makeTooltip
protected abstract org.w3c.dom.Element makeTooltip(DBIDRef id, double x, double y, double dotsize)
Make a tooltip Element for this id.- Parameters:
id- Id to make a tooltip forx- X positiony- Y positiondotsize- Size of a dot- Returns:
- Element
-
handleHoverEvent
protected void handleHoverEvent(org.w3c.dom.events.Event evt)
Handle the hover events.- Parameters:
evt- Event.
-
toggleTooltip
protected void toggleTooltip(org.w3c.dom.Element elem, java.lang.String type)Toggle the Tooltip of an element.- Parameters:
elem- Elementtype- Event type
-
setupCSS
protected abstract void setupCSS(SVGPlot svgp)
Registers the Tooltip-CSS-Class at a SVGPlot.- Parameters:
svgp- the SVGPlot to register the Tooltip-CSS-Class.
-
-