
public class SelectionToolLineVisualization extends AbstractParallelVisualization<NumberVector<?,?>> implements DragableArea.DragListener
| Modifier and Type | Class and Description |
|---|---|
static class |
SelectionToolLineVisualization.Factory
Factory for tool visualizations for selecting objects
|
private static class |
SelectionToolLineVisualization.Mode
Input modes
|
| Modifier and Type | Field and Description |
|---|---|
private static String |
CSS_RANGEMARKER
CSS class of the selection rectangle while selecting.
|
(package private) Element |
etag
Element for the rectangle to add listeners
|
private static String |
NAME
A short name characterizing this Visualizer.
|
(package private) Element |
rtag
Element for selection rectangle
|
axsep, proj, relationcontext, layer, pendingRedraw, svgp, task| Constructor and Description |
|---|
SelectionToolLineVisualization(VisualizationTask task)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addCSSClasses(SVGPlot svgp)
Adds the required CSS-Classes
|
private boolean |
checkSelected(int[] ar,
double[] yPos,
double x1,
double x2,
double y1,
double y2) |
private void |
deleteChildren(Element container)
Delete the children of the element
|
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.
|
private int[] |
getAxisRange(double x1,
double x2) |
private SelectionToolLineVisualization.Mode |
getInputMode(Event evt)
Get the current input mode, on each mouse event.
|
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 |
updateSelection(SelectionToolLineVisualization.Mode mode,
org.w3c.dom.svg.SVGPoint p1,
org.w3c.dom.svg.SVGPoint p2)
Updates the selection in the context.
|
getAxisSep, getMarginLeft, getMarginTop, getSizeX, getSizeY, getVisibleAxisX, resultChanged, setupCanvascontentChanged, destroy, getHeight, getLayer, getWidth, incrementalRedraw, resultAdded, resultRemoved, synchronizedRedrawprivate static final String NAME
private static final String CSS_RANGEMARKER
Element rtag
Element etag
public SelectionToolLineVisualization(VisualizationTask task)
task - Taskprotected void redraw()
AbstractVisualizationredraw in class AbstractVisualizationprivate void deleteChildren(Element container)
container - SVG-Elementpublic 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 dragprivate SelectionToolLineVisualization.Mode getInputMode(Event evt)
evt - Mouse event.private void updateSelection(SelectionToolLineVisualization.Mode mode, org.w3c.dom.svg.SVGPoint p1, org.w3c.dom.svg.SVGPoint p2)
mode - Input modep1 - first point of the selected rectanglep2 - second point of the selected rectangleprivate int[] getAxisRange(double x1,
double x2)
private boolean checkSelected(int[] ar,
double[] yPos,
double x1,
double x2,
double y1,
double y2)
protected void addCSSClasses(SVGPlot svgp)
svgp - SVG-Plot