de.lmu.ifi.dbs.elki.visualization.visualizers.vis2d
Class ToolBox2DVisualization<NV extends NumberVector<NV,?>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.visualization.visualizers.AbstractVisualization
      extended by de.lmu.ifi.dbs.elki.visualization.visualizers.vis2d.P2DVisualization<NV>
          extended by de.lmu.ifi.dbs.elki.visualization.visualizers.vis2d.ToolBox2DVisualization<NV>
Type Parameters:
NV - Type of the NumberVector being visualized.
All Implemented Interfaces:
ResultListener, ContextChangeListener, Visualization, EventListener

public class ToolBox2DVisualization<NV extends NumberVector<NV,?>>
extends P2DVisualization<NV>

Renders a tool box on the left of the 2D visualization


Nested Class Summary
static class ToolBox2DVisualization.Factory<NV extends NumberVector<NV,?>>
          Factory for visualizers for a toolbox
 
Field Summary
private  Element container
          The container
static String CSS_TOOL_BUTTON
          CSS class for a tool button
static String CSS_TOOL_BUTTON_SELECTED
          CSS class for a tool button
static String CSS_TOOL_CAPTION
          CSS class for the tool button caption
private static Logging logger
          The logger for this class.
private static String NAME
          A short name characterizing this Visualizer.
 
Fields inherited from class de.lmu.ifi.dbs.elki.visualization.visualizers.vis2d.P2DVisualization
proj, rel
 
Fields inherited from class de.lmu.ifi.dbs.elki.visualization.visualizers.AbstractVisualization
context, layer, pendingRedraw, svgp, task
 
Constructor Summary
ToolBox2DVisualization(VisualizationTask task)
          Constructor.
 
Method Summary
private  void addCSSClasses(SVGPlot svgp)
          Adds the required CSS-Classes
private  void addEventListener(Element tag, VisualizationTask tool)
          Add an event listener to the Element
private  void buildToolBox()
          Build the toolbox
 void contextChanged(ContextChangedEvent e)
          Method called on context changes (e.g. projection changes).
private  void deleteChildren(Element container)
          Deletes the children of the container
protected  void handleMouseClick(VisualizationTask tool)
          Handle the mouseClick - change the selected tool in the context
protected  void redraw()
          Perform a full redraw.
 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.
 
Methods inherited from class de.lmu.ifi.dbs.elki.visualization.visualizers.vis2d.P2DVisualization
setupCanvas
 
Methods inherited from class de.lmu.ifi.dbs.elki.visualization.visualizers.AbstractVisualization
destroy, getHeight, getLayer, getWidth, incrementalRedraw, synchronizedRedraw, testRedraw
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

private static final String NAME
A short name characterizing this Visualizer.

See Also:
Constant Field Values

logger

private static final Logging logger
The logger for this class.


CSS_TOOL_BUTTON

public static final String CSS_TOOL_BUTTON
CSS class for a tool button

See Also:
Constant Field Values

CSS_TOOL_CAPTION

public static final String CSS_TOOL_CAPTION
CSS class for the tool button caption

See Also:
Constant Field Values

CSS_TOOL_BUTTON_SELECTED

public static final String CSS_TOOL_BUTTON_SELECTED
CSS class for a tool button

See Also:
Constant Field Values

container

private Element container
The container

Constructor Detail

ToolBox2DVisualization

public ToolBox2DVisualization(VisualizationTask task)
Constructor.

Parameters:
task - Task
Method Detail

contextChanged

public void contextChanged(ContextChangedEvent e)
Description copied from interface: ContextChangeListener
Method called on context changes (e.g. projection changes). Usually, this should trigger a redraw!

Specified by:
contextChanged in interface ContextChangeListener
Overrides:
contextChanged in class AbstractVisualization
Parameters:
e - Change event

redraw

protected void redraw()
Description copied from class: AbstractVisualization
Perform a full redraw.

Specified by:
redraw in class AbstractVisualization

deleteChildren

private void deleteChildren(Element container)
Deletes the children of the container

Parameters:
container - Element to delete children

buildToolBox

private void buildToolBox()
Build the toolbox


addCSSClasses

private void addCSSClasses(SVGPlot svgp)
Adds the required CSS-Classes

Parameters:
svgp - SVG-Plot

addEventListener

private void addEventListener(Element tag,
                              VisualizationTask tool)
Add an event listener to the Element

Parameters:
tag - Element to add the listener
tool - Tool represented by the Element

handleMouseClick

protected void handleMouseClick(VisualizationTask tool)
Handle the mouseClick - change the selected tool in the context

Parameters:
tool - Selected Tool

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
Overrides:
resultAdded in class AbstractVisualization
Parameters:
child - New child result added
parent - Parent result that was added to

resultRemoved

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

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

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
Overrides:
resultChanged in class AbstractVisualization
Parameters:
current - Result that has changed.

Release 0.4.0 (2011-09-20_1324)