Package elki.visualization.gui.overview
Class OverviewPlot
- java.lang.Object
-
- elki.visualization.gui.overview.OverviewPlot
-
- All Implemented Interfaces:
ResultListener,VisualizationListener,java.util.EventListener
public class OverviewPlot extends java.lang.Object implements ResultListener, VisualizationListener
Generate an overview plot for a set of visualizations.- Since:
- 0.3
- Author:
- Erich Schubert, Remigius Wojdanowski
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.ArrayList<java.awt.event.ActionListener>actionListenersAction listeners for this plot.private VisualizerContextcontextVisualizer contextprivate static booleanDEBUG_LAYOUTDraw red borders around items.private org.w3c.dom.events.EventListenerhovererReact to mouse hover eventsprivate org.w3c.dom.ElementhoverlayerLayer for hover elementsprivate static LoggingLOGOur logging classstatic java.lang.StringOVERVIEW_REFRESHEDEvent when the overview plot was refreshed.static java.lang.StringOVERVIEW_REFRESHINGEvent when the overview plot started refreshing.(package private) java.util.concurrent.atomic.AtomicReference<java.lang.Runnable>pendingRefreshPending refresh, for lazy refreshingprivate VisualizationPlotplotThe SVG plot object.private org.w3c.dom.ElementplotlayerLayer for plot thumbnailprotected RectangleArranger<PlotItem>plotmapMap of coordinates to plots.private doubleratioScreen ratioprivate booleanreinitOnRefreshReinitialize on refreshintscreenheightScreen size (used for thumbnail sizing)intscreenwidthScreen size (used for thumbnail sizing)private CSSClassselcssThe CSS class used on "selectable" rectangles.private booleansingleSingle view modeprivate LayerMapvistoelemLookup
-
Constructor Summary
Constructors Constructor Description OverviewPlot(VisualizerContext context, boolean single)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddActionListener(java.awt.event.ActionListener actionListener)Adds anActionListenerto the plot.private RectangleArranger<PlotItem>arrangeVisualizations(double width, double height)Recompute the layout of visualizations.voiddestroy()Destroy this overview plot.private VisualizationembedOrThumbnail(int thumbsize, PlotItem it, VisualizationTask task, org.w3c.dom.Element parent)Produce thumbnail for a visualizer.SVGPlotgetPlot()Get the SVGPlot object.doublegetRatio()voidinitialize(double ratio)Initialize the plot.private voidinitializePlot()Initialize the SVG plot.voidlazyRefresh()Trigger a redraw, but avoid excessive redraws.DetailViewmakeDetailView(PlotItem it)Event triggered when a plot was selected.private voidrecalcViewbox()Recompute the view box of the plot.(package private) voidrefresh()Do a refresh (when visibilities have changed).private voidreinitialize()Refresh the overview plot.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)protected voidtriggerSubplotSelectEvent(PlotItem it)When a subplot was selected, forward the event to listeners.protected booleanvisibleInOverview(VisualizationTask task)Test whether a task should be displayed in the overview plot.voidvisualizationChanged(VisualizationItem child)Visualization has changed.
-
-
-
Field Detail
-
LOG
private static final Logging LOG
Our logging class
-
OVERVIEW_REFRESHING
public static final java.lang.String OVERVIEW_REFRESHING
Event when the overview plot started refreshing.- See Also:
- Constant Field Values
-
OVERVIEW_REFRESHED
public static final java.lang.String OVERVIEW_REFRESHED
Event when the overview plot was refreshed.- See Also:
- Constant Field Values
-
DEBUG_LAYOUT
private static final boolean DEBUG_LAYOUT
Draw red borders around items.- See Also:
- Constant Field Values
-
context
private VisualizerContext context
Visualizer context
-
plot
private VisualizationPlot plot
The SVG plot object.
-
plotmap
protected RectangleArranger<PlotItem> plotmap
Map of coordinates to plots.
-
actionListeners
private java.util.ArrayList<java.awt.event.ActionListener> actionListeners
Action listeners for this plot.
-
single
private boolean single
Single view mode
-
screenwidth
public int screenwidth
Screen size (used for thumbnail sizing)
-
screenheight
public int screenheight
Screen size (used for thumbnail sizing)
-
hoverer
private org.w3c.dom.events.EventListener hoverer
React to mouse hover events
-
vistoelem
private LayerMap vistoelem
Lookup
-
plotlayer
private org.w3c.dom.Element plotlayer
Layer for plot thumbnail
-
hoverlayer
private org.w3c.dom.Element hoverlayer
Layer for hover elements
-
selcss
private CSSClass selcss
The CSS class used on "selectable" rectangles.
-
ratio
private double ratio
Screen ratio
-
pendingRefresh
java.util.concurrent.atomic.AtomicReference<java.lang.Runnable> pendingRefresh
Pending refresh, for lazy refreshing
-
reinitOnRefresh
private boolean reinitOnRefresh
Reinitialize on refresh
-
-
Constructor Detail
-
OverviewPlot
public OverviewPlot(VisualizerContext context, boolean single)
Constructor.- Parameters:
context- Visualizer contextsingle- Single view mode
-
-
Method Detail
-
arrangeVisualizations
private RectangleArranger<PlotItem> arrangeVisualizations(double width, double height)
Recompute the layout of visualizations.- Parameters:
width- Initial widthheight- Initial height- Returns:
- Arrangement
-
initialize
public void initialize(double ratio)
Initialize the plot.- Parameters:
ratio- Initial ratio
-
reinitialize
private void reinitialize()
Refresh the overview plot.
-
initializePlot
private void initializePlot()
Initialize the SVG plot.
-
embedOrThumbnail
private Visualization embedOrThumbnail(int thumbsize, PlotItem it, VisualizationTask task, org.w3c.dom.Element parent)
Produce thumbnail for a visualizer.- Parameters:
thumbsize- Thumbnail sizeit- Plot itemtask- Taskparent- Parent element to draw to
-
refresh
void refresh()
Do a refresh (when visibilities have changed).
-
visibleInOverview
protected boolean visibleInOverview(VisualizationTask task)
Test whether a task should be displayed in the overview plot.- Parameters:
task- Task to display- Returns:
- visibility
-
recalcViewbox
private void recalcViewbox()
Recompute the view box of the plot.
-
makeDetailView
public DetailView makeDetailView(PlotItem it)
Event triggered when a plot was selected.- Parameters:
it- Plot item selected- Returns:
- sub plot
-
addActionListener
public void addActionListener(java.awt.event.ActionListener actionListener)
Adds anActionListenerto the plot.- Parameters:
actionListener- theActionListenerto be added
-
triggerSubplotSelectEvent
protected void triggerSubplotSelectEvent(PlotItem it)
When a subplot was selected, forward the event to listeners.- Parameters:
it- PlotItem selected
-
destroy
public void destroy()
Destroy this overview plot.
-
getPlot
public SVGPlot getPlot()
Get the SVGPlot object.- Returns:
- SVG plot
-
getRatio
public double getRatio()
- Returns:
- the ratio
-
setRatio
public void setRatio(double ratio)
- Parameters:
ratio- the ratio to set
-
lazyRefresh
public final void lazyRefresh()
Trigger a redraw, but avoid excessive redraws.
-
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 child)
Description copied from interface:VisualizationListenerVisualization has changed.- Specified by:
visualizationChangedin interfaceVisualizationListener- Parameters:
child- Changed visualization
-
-