
NV - Type of the NumberVector being visualized.public class MoveObjectsToolVisualization<NV extends NumberVector<NV,?>> extends P2DVisualization<NV> implements DragableArea.DragListener
| Modifier and Type | Class and Description |
|---|---|
static class |
MoveObjectsToolVisualization.Factory<NV extends NumberVector<NV,?>>
Factory for tool visualizations for changing objects in the database
|
| Modifier and Type | Field and Description |
|---|---|
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
|
proj, relcontext, layer, pendingRedraw, svgp, task| Constructor and Description |
|---|
MoveObjectsToolVisualization(VisualizationTask task) |
| Modifier and Type | Method and Description |
|---|---|
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
|
setupCanvasgetHeight, getLayer, getWidth, incrementalRedraw, resultAdded, resultChanged, resultRemoved, synchronizedRedraw, testRedrawprivate static final String NAME
protected static final String CSS_ARROW
private Element etag
private Element rtag
public MoveObjectsToolVisualization(VisualizationTask task)
public void destroy()
Visualizationdestroy in interface Visualizationdestroy in class AbstractVisualizationpublic void contextChanged(ContextChangedEvent e)
ContextChangeListenercontextChanged in interface ContextChangeListenercontextChanged in class AbstractVisualizatione - Change eventprotected void redraw()
AbstractVisualizationredraw in class AbstractVisualizationprivate void updateDB(DBIDs dbids, Vector movingVector)
dbids - - DBIDs of the objects to movemovingVector - - Vector for moving objectprivate void deleteChildren(Element container)
container - SVG-Elementprivate void addCSSClasses(SVGPlot svgp)
svgp - SVGPlotpublic boolean startDrag(org.w3c.dom.svg.SVGPoint startPoint, Event evt)
DragableArea.DragListenerstartDrag in interface DragableArea.DragListenerstartPoint - Point where the drag was started.evt - The event objecttrue to start the drag operationpublic boolean duringDrag(org.w3c.dom.svg.SVGPoint startPoint, org.w3c.dom.svg.SVGPoint dragPoint, Event evt, boolean inside)
DragableArea.DragListenerduringDrag in interface DragableArea.DragListenerstartPoint - Drag starting pointdragPoint - Drag end pointevt - The event objectinside - Inside the tracked elementtrue to continue the dragpublic boolean endDrag(org.w3c.dom.svg.SVGPoint startPoint, org.w3c.dom.svg.SVGPoint dragPoint, Event evt, boolean inside)
DragableArea.DragListenerendDrag in interface DragableArea.DragListenerstartPoint - Drag starting pointdragPoint - Drag end pointevt - The event objectinside - Whether the end point was inside the areatrue to complete the drag