de.lmu.ifi.dbs.elki.visualization.gui.overview
Class OverviewPlot

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.visualization.svg.SVGPlot
      extended by de.lmu.ifi.dbs.elki.visualization.gui.overview.OverviewPlot
All Implemented Interfaces:
ResultListener, EventListener

public class OverviewPlot
extends SVGPlot
implements ResultListener

Generate an overview plot for a set of visualizations.


Nested Class Summary
 class OverviewPlot.SelectPlotEvent
          Event when a plot was selected.
 
Field Summary
private  Vector<ActionListener> actionListeners
          Action listeners for this plot.
private  VisualizerContext context
          Visualizer context
private  EventListener hoverer
          React to mouse hover events
private  Element hoverlayer
          Layer for hover elements
private static Logging logger
          Our logging class
(package private)  Runnable pendingRefresh
          Pending refresh, for lazy refreshing
private  Element plotlayer
          Layer for plot thumbnail
protected  RectangleArranger<PlotItem> plotmap
          Map of coordinates to plots.
private  double ratio
          Screen ratio
private  boolean reinitOnRefresh
          Reinitialize on refresh
private  HierarchicalResult result
          Result we work on.
 int screenheight
          Screen size (used for thumbnail sizing)
 int screenwidth
          Screen size (used for thumbnail sizing)
private  CSSClass selcss
          The CSS class used on "selectable" rectangles.
private  HashMap<Pair<PlotItem,VisualizationTask>,Element> vistoelem
          Lookup
 
Fields inherited from class de.lmu.ifi.dbs.elki.visualization.svg.SVGPlot
DEFAULT_QUALITY
 
Constructor Summary
OverviewPlot(HierarchicalResult result, VisualizerContext context)
          Constructor.
 
Method Summary
 void addActionListener(ActionListener actionListener)
          Adds an ActionListener to the plot.
private  void arrangeVisualizations()
          Recompute the layout of visualizations.
 void dispose()
          Cancel the overview, i.e. stop the thumbnailer
 double getRatio()
           
 void lazyRefresh()
          Trigger a redraw, but avoid excessive redraws.
 DetailView makeDetailView(PlotItem it)
          Event triggered when a plot was selected.
private  void makeThumbnail(int thumbsize, PlotItem it, VisualizationTask task, Element parent)
          Produce thumbnail for a visualizer.
private  void recalcViewbox()
          Recompute the view box of the plot.
(package private)  void refresh()
          Do a refresh (when visibilities have changed).
private  void reinitialize()
          Refresh the overview plot.
 void resultAdded(Result child, Result parent)
          A new derived result was added.
 void resultChanged(Result current)
          Notify that the current result has changed substantially.
 void resultRemoved(Result child, Result parent)
          A result was removed.
 void setRatio(double ratio)
           
private  void setupHoverer()
          Setup the CSS hover effect.
protected  void triggerSubplotSelectEvent(PlotItem it)
          When a subplot was selected, forward the event to listeners.
 
Methods inherited from class de.lmu.ifi.dbs.elki.visualization.svg.SVGPlot
addCSSClassOrLogError, dumpDebugFile, elementCoordinatesFromEvent, getAllIds, getCSSClassManager, getDefs, getDisableInteractions, getDocument, getIdElement, getRoot, getStyle, putIdElement, saveAsANY, saveAsEPS, saveAsJPEG, saveAsJPEG, saveAsPDF, saveAsPNG, saveAsPS, saveAsSVG, scheduleUpdate, setDisableInteractions, svgCircle, svgElement, svgLine, svgRect, svgText, synchronizeWith, transcode, unsynchronizeWith, updateStyleElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final Logging logger
Our logging class


context

private VisualizerContext context
Visualizer context


result

private HierarchicalResult result
Result we work on. Currently unused, but kept for future requirements.


plotmap

protected RectangleArranger<PlotItem> plotmap
Map of coordinates to plots.


actionListeners

private Vector<ActionListener> actionListeners
Action listeners for this plot.


screenwidth

public int screenwidth
Screen size (used for thumbnail sizing)


screenheight

public int screenheight
Screen size (used for thumbnail sizing)


hoverer

private EventListener hoverer
React to mouse hover events


vistoelem

private HashMap<Pair<PlotItem,VisualizationTask>,Element> vistoelem
Lookup


plotlayer

private Element plotlayer
Layer for plot thumbnail


hoverlayer

private Element hoverlayer
Layer for hover elements


selcss

private CSSClass selcss
The CSS class used on "selectable" rectangles.


ratio

private double ratio
Screen ratio


pendingRefresh

Runnable pendingRefresh
Pending refresh, for lazy refreshing


reinitOnRefresh

private boolean reinitOnRefresh
Reinitialize on refresh

Constructor Detail

OverviewPlot

public OverviewPlot(HierarchicalResult result,
                    VisualizerContext context)
Constructor.

Parameters:
result - Result to visualize
context - Visualizer context
Method Detail

arrangeVisualizations

private void arrangeVisualizations()
Recompute the layout of visualizations.


reinitialize

private void reinitialize()
Refresh the overview plot.


makeThumbnail

private void makeThumbnail(int thumbsize,
                           PlotItem it,
                           VisualizationTask task,
                           Element parent)
Produce thumbnail for a visualizer.

Parameters:
thumbsize - Thumbnail size
it - Plot item
task - Task
parent - Parent element to draw to

refresh

void refresh()
Do a refresh (when visibilities have changed).


recalcViewbox

private void recalcViewbox()
Recompute the view box of the plot.


setupHoverer

private void setupHoverer()
Setup the CSS hover effect.


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(ActionListener actionListener)
Adds an ActionListener to the plot.

Parameters:
actionListener - the ActionListener to be added

triggerSubplotSelectEvent

protected void triggerSubplotSelectEvent(PlotItem it)
When a subplot was selected, forward the event to listeners.

Parameters:
it - PlotItem selected

dispose

public void dispose()
Cancel the overview, i.e. stop the thumbnailer

Overrides:
dispose in class SVGPlot

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(Result child,
                        Result parent)
Description copied from interface: ResultListener
A new derived result was added.

Specified by:
resultAdded in interface ResultListener
Parameters:
child - New child result added
parent - Parent result that was added to

resultChanged

public void resultChanged(Result current)
Description copied from interface: ResultListener
Notify that the current result has changed substantially.

Specified by:
resultChanged in interface ResultListener
Parameters:
current - Result that has changed.

resultRemoved

public void resultRemoved(Result child,
                          Result parent)
Description copied from interface: ResultListener
A result was removed.

Specified by:
resultRemoved in interface ResultListener
Parameters:
child - result that was removed
parent - Parent result that was removed from

Release 0.4.0 (2011-09-20_1324)