public class OPTICSPlotSelectionVisualization.Instance extends AbstractOPTICSVisualization implements DragableArea.DragListener
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
CSS_MARKER
CSS class for markers
|
protected static java.lang.String |
CSS_RANGEMARKER
CSS class for markers
|
private org.w3c.dom.Element |
mtag
Element for the marker
|
optics, plotheight, plotwidth
context, layer, svgp, task
Constructor and Description |
---|
Instance(VisualizerContext context,
VisualizationTask task,
VisualizationPlot plot,
double width,
double height,
Projection proj)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private void |
addCSSClasses()
Adds the required CSS-Classes
|
void |
addMarker()
Add marker for the selected IDs to mtag
|
org.w3c.dom.Element |
addMarkerRect(double x1,
double width)
Create a rectangle as marker (Marker higher than plot!)
|
boolean |
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 OPTICSPlotSelectionVisualization.Mode |
getInputMode(org.w3c.dom.events.Event evt)
Get the current input mode, on each mouse event.
|
private int |
getSelectedIndex(ClusterOrder order,
org.w3c.dom.svg.SVGPoint cPt)
Gets the Index of the ClusterOrderEntry where the event occurred
|
boolean |
startDrag(org.w3c.dom.svg.SVGPoint startPoint,
org.w3c.dom.events.Event evt)
Action to do on drag start.
|
protected void |
updateSelection(OPTICSPlotSelectionVisualization.Mode mode,
int begin,
int end)
Updates the selection for the given ClusterOrderEntry.
|
getClusterOrder, makeLayerElement
addListeners, contentChanged, destroy, getHeight, getLayer, getWidth, incrementalRedraw, resultAdded, resultChanged, resultRemoved, visualizationChanged
protected static final java.lang.String CSS_MARKER
protected static final java.lang.String CSS_RANGEMARKER
private org.w3c.dom.Element mtag
public Instance(VisualizerContext context, VisualizationTask task, VisualizationPlot plot, double width, double height, Projection proj)
context
- Visualizer contexttask
- Visualization taskplot
- Plot to draw towidth
- Embedding widthheight
- Embedding heightproj
- Projectionpublic void fullRedraw()
Visualization
fullRedraw
in interface Visualization
fullRedraw
in class AbstractVisualization
public void addMarker()
public org.w3c.dom.Element addMarkerRect(double x1, double width)
x1
- X-Value for the markerwidth
- Width of an entrypublic boolean startDrag(org.w3c.dom.svg.SVGPoint startPoint, org.w3c.dom.events.Event evt)
DragableArea.DragListener
startDrag
in interface DragableArea.DragListener
startPoint
- 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, org.w3c.dom.events.Event evt, boolean inside)
DragableArea.DragListener
duringDrag
in interface DragableArea.DragListener
startPoint
- 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, org.w3c.dom.events.Event evt, boolean inside)
DragableArea.DragListener
endDrag
in interface DragableArea.DragListener
startPoint
- Drag starting pointdragPoint
- Drag end pointevt
- The event objectinside
- Whether the end point was inside the areatrue
to complete the dragprivate OPTICSPlotSelectionVisualization.Mode getInputMode(org.w3c.dom.events.Event evt)
evt
- Mouse event.private int getSelectedIndex(ClusterOrder order, org.w3c.dom.svg.SVGPoint cPt)
order
- List of ClusterOrderEntriescPt
- clicked pointprotected void updateSelection(OPTICSPlotSelectionVisualization.Mode mode, int begin, int end)
mode
- Input modebegin
- first index to selectend
- last index to selectprivate void addCSSClasses()
Copyright © 2019 ELKI Development Team. License information.