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) VisualizerContextcontextThe visualizer contextprivate doubleheightThe created heightprivate PlotItemitemMeta information on the visualizers contained.private static LoggingLOGClass logger(package private) java.util.concurrent.atomic.AtomicReference<java.lang.Runnable>pendingRefreshPending refresh, for lazy refreshing(package private) doubleratioRatio of this view.(package private) java.util.Map<VisualizationTask,Visualization>taskmapMap from tasks to visualizations.private doublewidthThe 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 voidaddBackground(VisualizerContext context)Create a background node.voiddestroy()Cleanup function.voiddispose()Clean up the plot.PlotItemgetPlotItem()Get the item visualized by this view.doublegetRatio()Get the plot ratio.private voidinitialize()private VisualizationinstantiateVisualization(VisualizationTask task)Instantiate a visualization.private voidlazyRefresh()Trigger a refresh.protected voidredraw()Redraw all pending updates.private voidrefresh()Do a refresh (when visibilities have changed).voidresultAdded(java.lang.Object child, java.lang.Object parent)A new derived result was added.voidresultChanged(java.lang.Object current)Notify that the current result has changed substantially.voidresultRemoved(java.lang.Object child, java.lang.Object parent)A result was removed.voidsetRatio(double ratio)Set the plot ratiovoidvisualizationChanged(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:SVGPlotClean 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:ResultListenerA new derived result was added.- Specified by:
resultAddedin 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:ResultListenerNotify that the current result has changed substantially.- Specified by:
resultChangedin interfaceResultListener- Parameters:
current- Result that has changed.
-
resultRemoved
public void resultRemoved(java.lang.Object child, java.lang.Object parent)Description copied from interface:ResultListenerA result was removed.- Specified by:
resultRemovedin interfaceResultListener- Parameters:
child- result that was removedparent- Parent result that was removed from
-
visualizationChanged
public void visualizationChanged(VisualizationItem current)
Description copied from interface:VisualizationListenerVisualization has changed.- Specified by:
visualizationChangedin interfaceVisualizationListener- Parameters:
current- Changed visualization
-
redraw
protected void redraw()
Description copied from class:VisualizationPlotRedraw all pending updates.- Overrides:
redrawin classVisualizationPlot
-
getPlotItem
public PlotItem getPlotItem()
Get the item visualized by this view.- Returns:
- Plot item
-
-