Class SelectionToolLineVisualization.Instance
- java.lang.Object
-
- elki.visualization.visualizers.AbstractVisualization
-
- elki.visualization.visualizers.parallel.AbstractParallelVisualization<NumberVector>
-
- elki.visualization.visualizers.parallel.selection.SelectionToolLineVisualization.Instance
-
- All Implemented Interfaces:
DataStoreListener
,ResultListener
,DragableArea.DragListener
,VisualizationListener
,Visualization
,java.util.EventListener
- Enclosing class:
- SelectionToolLineVisualization
public class SelectionToolLineVisualization.Instance extends AbstractParallelVisualization<NumberVector> implements DragableArea.DragListener
Instance.- Author:
- Robert Rödler
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
CSS_RANGEMARKER
CSS class of the selection rectangle while selecting.(package private) org.w3c.dom.Element
rtag
Element for selection rectangle-
Fields inherited from class elki.visualization.visualizers.parallel.AbstractParallelVisualization
axsep, proj, relation
-
Fields inherited from class elki.visualization.visualizers.AbstractVisualization
context, layer, svgp, task
-
-
Constructor Summary
Constructors Constructor Description Instance(VisualizerContext context, VisualizationTask task, VisualizationPlot plot, double width, double height, Projection proj)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addCSSClasses(SVGPlot svgp)
Adds the required CSS-Classesprivate boolean
checkSelected(int[] ar, double[] yPos, double x1, double x2, double y1, double y2)
private void
deleteChildren(org.w3c.dom.Element container)
Delete the children of the elementboolean
duringDrag(org.w3c.dom.svg.SVGPoint startPoint, org.w3c.dom.svg.SVGPoint dragPoint, org.w3c.dom.events.Event evt, boolean inside)
Method called during drags.boolean
endDrag(org.w3c.dom.svg.SVGPoint startPoint, org.w3c.dom.svg.SVGPoint dragPoint, org.w3c.dom.events.Event evt, boolean inside)
Method called when a drag was ended.void
fullRedraw()
Request a full redrawing of the visualization.private int[]
getAxisRange(double x1, double x2)
private SelectionToolLineVisualization.Mode
getInputMode(org.w3c.dom.events.Event evt)
Get the current input mode, on each mouse event.boolean
startDrag(org.w3c.dom.svg.SVGPoint startPoint, org.w3c.dom.events.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.-
Methods inherited from class elki.visualization.visualizers.parallel.AbstractParallelVisualization
getAxisSep, getMarginLeft, getMarginTop, getSizeX, getSizeY, getVisibleAxisX, setupCanvas, visualizationChanged
-
Methods inherited from class elki.visualization.visualizers.AbstractVisualization
addListeners, contentChanged, destroy, getHeight, getLayer, getWidth, incrementalRedraw, resultChanged
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.result.ResultListener
resultAdded, resultRemoved
-
-
-
-
Field Detail
-
CSS_RANGEMARKER
private static final java.lang.String CSS_RANGEMARKER
CSS class of the selection rectangle while selecting.- See Also:
- Constant Field Values
-
rtag
org.w3c.dom.Element rtag
Element for selection rectangle
-
-
Constructor Detail
-
Instance
public Instance(VisualizerContext context, VisualizationTask task, VisualizationPlot plot, double width, double height, Projection proj)
Constructor.- Parameters:
context
- Visualizer contexttask
- Taskplot
- Plot to draw towidth
- Embedding widthheight
- Embedding heightproj
- Projection
-
-
Method Detail
-
fullRedraw
public void fullRedraw()
Description copied from interface:Visualization
Request a full redrawing of the visualization.- Specified by:
fullRedraw
in interfaceVisualization
- Overrides:
fullRedraw
in classAbstractParallelVisualization<NumberVector>
-
deleteChildren
private void deleteChildren(org.w3c.dom.Element container)
Delete the children of the element- Parameters:
container
- SVG-Element
-
startDrag
public boolean startDrag(org.w3c.dom.svg.SVGPoint startPoint, org.w3c.dom.events.Event evt)
Description copied from interface:DragableArea.DragListener
Action to do on drag start.- Specified by:
startDrag
in interfaceDragableArea.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, org.w3c.dom.events.Event evt, boolean inside)
Description copied from interface:DragableArea.DragListener
Method called during drags.- Specified by:
duringDrag
in interfaceDragableArea.DragListener
- Parameters:
startPoint
- Drag starting pointdragPoint
- Drag end pointevt
- The event objectinside
- 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, org.w3c.dom.events.Event evt, boolean inside)
Description copied from interface:DragableArea.DragListener
Method called when a drag was ended.- Specified by:
endDrag
in interfaceDragableArea.DragListener
- Parameters:
startPoint
- Drag starting pointdragPoint
- Drag end pointevt
- The event objectinside
- Whether the end point was inside the area- Returns:
true
to complete the drag
-
getInputMode
private SelectionToolLineVisualization.Mode getInputMode(org.w3c.dom.events.Event evt)
Get the current input mode, on each mouse event.- Parameters:
evt
- Mouse event.- Returns:
- current input mode
-
updateSelection
private void updateSelection(SelectionToolLineVisualization.Mode mode, org.w3c.dom.svg.SVGPoint p1, org.w3c.dom.svg.SVGPoint p2)
Updates the selection in the context.- Parameters:
mode
- Input modep1
- first point of the selected rectanglep2
- second point of the selected rectangle
-
getAxisRange
private int[] getAxisRange(double x1, double x2)
-
checkSelected
private boolean checkSelected(int[] ar, double[] yPos, double x1, double x2, double y1, double y2)
-
addCSSClasses
protected void addCSSClasses(SVGPlot svgp)
Adds the required CSS-Classes- Parameters:
svgp
- SVG-Plot
-
-