Package elki.visualization.gui.detail
Class DetailView
- java.lang.Object
-
- elki.visualization.svg.SVGPlot
-
- elki.visualization.gui.VisualizationPlot
-
- elki.visualization.gui.detail.DetailView
-
- All Implemented Interfaces:
ResultListener
,VisualizationListener
,java.util.EventListener
public class DetailView extends VisualizationPlot implements ResultListener, VisualizationListener
Manages a detail view.- Since:
- 0.4.0
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description (package private) VisualizerContext
context
The visualizer contextprivate double
height
The created heightprivate PlotItem
item
Meta information on the visualizers contained.private static Logging
LOG
Class logger(package private) java.util.concurrent.atomic.AtomicReference<java.lang.Runnable>
pendingRefresh
Pending refresh, for lazy refreshing(package private) double
ratio
Ratio of this view.(package private) java.util.Map<VisualizationTask,Visualization>
taskmap
Map from tasks to visualizations.private double
width
The created width-
Fields inherited from class elki.visualization.gui.VisualizationPlot
pendingRedraw, updateQueue
-
Fields inherited from class elki.visualization.svg.SVGPlot
DEFAULT_QUALITY, NO_EXPORT_ATTRIBUTE
-
-
Constructor Summary
Constructors Constructor Description DetailView(VisualizerContext context, PlotItem vis, double ratio)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addBackground(VisualizerContext context)
Create a background node.void
destroy()
Cleanup function.void
dispose()
Clean up the plot.PlotItem
getPlotItem()
Get the item visualized by this view.double
getRatio()
Get the plot ratio.private void
initialize()
private Visualization
instantiateVisualization(VisualizationTask task)
Instantiate a visualization.private void
lazyRefresh()
Trigger a refresh.protected void
redraw()
Redraw all pending updates.private void
refresh()
Do a refresh (when visibilities have changed).void
resultAdded(java.lang.Object child, java.lang.Object parent)
A new derived result was added.void
resultChanged(java.lang.Object current)
Notify that the current result has changed substantially.void
resultRemoved(java.lang.Object child, java.lang.Object parent)
A result was removed.void
setRatio(double ratio)
Set the plot ratiovoid
visualizationChanged(VisualizationItem current)
Visualization has changed.-
Methods inherited from class elki.visualization.gui.VisualizationPlot
requestRedraw, synchronizedRedraw
-
Methods inherited from class elki.visualization.svg.SVGPlot
addCSSClassOrLogError, cloneDocument, dumpDebugFile, elementCoordinatesFromEvent, getAllIds, getCSSClassManager, getDefs, getDisableInteractions, getDocument, getDomImpl, getIdElement, getRoot, makeAWTImage, putIdElement, saveAsANY, saveAsEPS, saveAsJPEG, saveAsJPEG, saveAsPDF, saveAsPNG, saveAsPS, saveAsSVG, scheduleUpdate, setDisableInteractions, svgCircle, svgElement, svgElement, svgLine, svgRect, svgText, synchronizeWith, transcode, unsynchronizeWith, updateStyleElement
-
-
-
-
Field Detail
-
LOG
private static final Logging LOG
Class logger
-
item
private PlotItem item
Meta information on the visualizers contained.
-
ratio
double ratio
Ratio of this view.
-
context
VisualizerContext context
The visualizer context
-
taskmap
java.util.Map<VisualizationTask,Visualization> taskmap
Map from tasks to visualizations.
-
width
private double width
The created width
-
height
private double height
The created height
-
pendingRefresh
java.util.concurrent.atomic.AtomicReference<java.lang.Runnable> pendingRefresh
Pending refresh, for lazy refreshing
-
-
Constructor Detail
-
DetailView
public DetailView(VisualizerContext context, PlotItem vis, double ratio)
Constructor.- Parameters:
vis
- Visualizations to useratio
- Plot ratio
-
-
Method Detail
-
addBackground
private void addBackground(VisualizerContext context)
Create a background node. Note: don't call this at arbitrary times - the background may cover already drawn parts of the image!- Parameters:
context
-
-
initialize
private void initialize()
-
refresh
private void refresh()
Do a refresh (when visibilities have changed).
-
instantiateVisualization
private Visualization instantiateVisualization(VisualizationTask task)
Instantiate a visualization.- Parameters:
task
- Task to instantiate- Returns:
- Visualization
-
destroy
public void destroy()
Cleanup function. To remove listeners.
-
dispose
public void dispose()
Description copied from class:SVGPlot
Clean up the plot.
-
getRatio
public double getRatio()
Get the plot ratio.- Returns:
- the current ratio
-
setRatio
public void setRatio(double ratio)
Set the plot ratio- Parameters:
ratio
- the new ratio to set
-
lazyRefresh
private void lazyRefresh()
Trigger a refresh.
-
resultAdded
public void resultAdded(java.lang.Object child, java.lang.Object parent)
Description copied from interface:ResultListener
A new derived result was added.- Specified by:
resultAdded
in interfaceResultListener
- Parameters:
child
- New child result addedparent
- Parent result that was added to
-
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.
-
resultRemoved
public void resultRemoved(java.lang.Object child, java.lang.Object parent)
Description copied from interface:ResultListener
A result was removed.- Specified by:
resultRemoved
in interfaceResultListener
- Parameters:
child
- result that was removedparent
- Parent result that was removed from
-
visualizationChanged
public void visualizationChanged(VisualizationItem current)
Description copied from interface:VisualizationListener
Visualization has changed.- Specified by:
visualizationChanged
in interfaceVisualizationListener
- Parameters:
current
- Changed visualization
-
redraw
protected void redraw()
Description copied from class:VisualizationPlot
Redraw all pending updates.- Overrides:
redraw
in classVisualizationPlot
-
getPlotItem
public PlotItem getPlotItem()
Get the item visualized by this view.- Returns:
- Plot item
-
-