de.lmu.ifi.dbs.elki.visualization.visualizers.vis2d
Class MoveObjectsToolVisualization<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.MoveObjectsToolVisualization<NV>
Type Parameters:
NV - Type of the NumberVector being visualized.
All Implemented Interfaces:
ResultListener, DragableArea.DragListener, ContextChangeListener, Visualization, EventListener

public class MoveObjectsToolVisualization<NV extends NumberVector<NV,?>>
extends P2DVisualization<NV>
implements DragableArea.DragListener

Tool to move the currently selected objects.


Nested Class Summary
static class MoveObjectsToolVisualization.Factory<NV extends NumberVector<NV,?>>
          Factory for tool visualizations for changing objects in the database
 
Field Summary
protected static String CSS_ARROW
          CSS tag for our event rectangle
private  Element etag
          Element for the rectangle to add listeners
private static String NAME
          A short name characterizing this Visualizer.
private  Element rtag
          Element to contain the drag arrow
 
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
MoveObjectsToolVisualization(VisualizationTask task)
           
 
Method Summary
private  void addCSSClasses(SVGPlot svgp)
          Adds the required CSS-Classes
 void contextChanged(ContextChangedEvent e)
          Method called on context changes (e.g. projection changes).
private  void deleteChildren(Element container)
          Delete the children of the element
 void destroy()
          Destroy the visualization.
 boolean duringDrag(org.w3c.dom.svg.SVGPoint startPoint, org.w3c.dom.svg.SVGPoint dragPoint, Event evt, boolean inside)
          Method called during drags.
 boolean endDrag(org.w3c.dom.svg.SVGPoint startPoint, org.w3c.dom.svg.SVGPoint dragPoint, Event evt, boolean inside)
          Method called when a drag was ended.
protected  void redraw()
          Perform a full redraw.
 boolean startDrag(org.w3c.dom.svg.SVGPoint startPoint, Event evt)
          Action to do on drag start.
private  void updateDB(DBIDs dbids, Vector movingVector)
          Updates the objects with the given DBIDs It will be moved depending on the given Vector
 
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
getHeight, getLayer, getWidth, incrementalRedraw, resultAdded, resultChanged, resultRemoved, 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

CSS_ARROW

protected static final String CSS_ARROW
CSS tag for our event rectangle

See Also:
Constant Field Values

etag

private Element etag
Element for the rectangle to add listeners


rtag

private Element rtag
Element to contain the drag arrow

Constructor Detail

MoveObjectsToolVisualization

public MoveObjectsToolVisualization(VisualizationTask task)
Method Detail

destroy

public void destroy()
Description copied from interface: Visualization
Destroy the visualization. Called after the elements have been removed from the document. Implementations should remove their listeners etc.

Specified by:
destroy in interface Visualization
Overrides:
destroy in class AbstractVisualization

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

updateDB

private void updateDB(DBIDs dbids,
                      Vector movingVector)
Updates the objects with the given DBIDs It will be moved depending on the given Vector

Parameters:
dbids - - DBIDs of the objects to move
movingVector - - Vector for moving object

deleteChildren

private void deleteChildren(Element container)
Delete the children of the element

Parameters:
container - SVG-Element

addCSSClasses

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

Parameters:
svgp - SVGPlot

startDrag

public boolean startDrag(org.w3c.dom.svg.SVGPoint startPoint,
                         Event evt)
Description copied from interface: DragableArea.DragListener
Action to do on drag start.

Specified by:
startDrag in interface DragableArea.DragListener
Parameters:
startPoint - Point where the drag was started.
evt - The event object
Returns:
true to start the drag operation

duringDrag

public boolean duringDrag(org.w3c.dom.svg.SVGPoint startPoint,
                          org.w3c.dom.svg.SVGPoint dragPoint,
                          Event evt,
                          boolean inside)
Description copied from interface: DragableArea.DragListener
Method called during drags.

Specified by:
duringDrag in interface DragableArea.DragListener
Parameters:
startPoint - Drag starting point
dragPoint - Drag end point
evt - The event object
inside - Inside the tracked element
Returns:
true to continue the drag

endDrag

public boolean endDrag(org.w3c.dom.svg.SVGPoint startPoint,
                       org.w3c.dom.svg.SVGPoint dragPoint,
                       Event evt,
                       boolean inside)
Description copied from interface: DragableArea.DragListener
Method called when a drag was ended.

Specified by:
endDrag in interface DragableArea.DragListener
Parameters:
startPoint - Drag starting point
dragPoint - Drag end point
evt - The event object
inside - Whether the end point was inside the area
Returns:
true to complete the drag

Release 0.4.0 (2011-09-20_1324)