Class OPTICSPlotSelectionVisualization.Instance
- java.lang.Object
-
- elki.visualization.visualizers.AbstractVisualization
-
- elki.visualization.visualizers.optics.AbstractOPTICSVisualization
-
- elki.visualization.visualizers.optics.OPTICSPlotSelectionVisualization.Instance
-
- All Implemented Interfaces:
DataStoreListener,ResultListener,DragableArea.DragListener,VisualizationListener,Visualization,java.util.EventListener
- Enclosing class:
- OPTICSPlotSelectionVisualization
public static class OPTICSPlotSelectionVisualization.Instance extends AbstractOPTICSVisualization implements DragableArea.DragListener
Instance.- Author:
- Heidi Kolb, Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringCSS_MARKERCSS class for markersprotected static java.lang.StringCSS_RANGEMARKERCSS class for markersprivate org.w3c.dom.ElementmtagElement for the marker-
Fields inherited from class elki.visualization.visualizers.optics.AbstractOPTICSVisualization
optics, plotheight, plotwidth
-
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 private voidaddCSSClasses()Adds the required CSS-ClassesvoidaddMarker()Add marker for the selected IDs to mtagorg.w3c.dom.ElementaddMarkerRect(double x1, double width)Create a rectangle as marker (Marker higher than plot!)booleanduringDrag(org.w3c.dom.svg.SVGPoint startPoint, org.w3c.dom.svg.SVGPoint dragPoint, org.w3c.dom.events.Event evt, boolean inside)Method called during drags.booleanendDrag(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.voidfullRedraw()Request a full redrawing of the visualization.private OPTICSPlotSelectionVisualization.ModegetInputMode(org.w3c.dom.events.Event evt)Get the current input mode, on each mouse event.private intgetSelectedIndex(ClusterOrder order, org.w3c.dom.svg.SVGPoint cPt)Gets the Index of the ClusterOrderEntry where the event occurredbooleanstartDrag(org.w3c.dom.svg.SVGPoint startPoint, org.w3c.dom.events.Event evt)Action to do on drag start.protected voidupdateSelection(OPTICSPlotSelectionVisualization.Mode mode, int begin, int end)Updates the selection for the given ClusterOrderEntry.-
Methods inherited from class elki.visualization.visualizers.optics.AbstractOPTICSVisualization
getClusterOrder, makeLayerElement
-
Methods inherited from class elki.visualization.visualizers.AbstractVisualization
addListeners, contentChanged, destroy, getHeight, getLayer, getWidth, incrementalRedraw, resultChanged, visualizationChanged
-
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_MARKER
protected static final java.lang.String CSS_MARKER
CSS class for markers- See Also:
- Constant Field Values
-
CSS_RANGEMARKER
protected static final java.lang.String CSS_RANGEMARKER
CSS class for markers- See Also:
- Constant Field Values
-
mtag
private org.w3c.dom.Element mtag
Element for the marker
-
-
Constructor Detail
-
Instance
public Instance(VisualizerContext context, VisualizationTask task, VisualizationPlot plot, double width, double height, Projection proj)
Constructor.- Parameters:
context- Visualizer contexttask- Visualization taskplot- Plot to draw towidth- Embedding widthheight- Embedding heightproj- Projection
-
-
Method Detail
-
fullRedraw
public void fullRedraw()
Description copied from interface:VisualizationRequest a full redrawing of the visualization.- Specified by:
fullRedrawin interfaceVisualization- Specified by:
fullRedrawin classAbstractVisualization
-
addMarker
public void addMarker()
Add marker for the selected IDs to mtag
-
addMarkerRect
public org.w3c.dom.Element addMarkerRect(double x1, double width)Create a rectangle as marker (Marker higher than plot!)- Parameters:
x1- X-Value for the markerwidth- Width of an entry- Returns:
- SVG-Element svg-rectangle
-
startDrag
public boolean startDrag(org.w3c.dom.svg.SVGPoint startPoint, org.w3c.dom.events.Event evt)Description copied from interface:DragableArea.DragListenerAction to do on drag start.- Specified by:
startDragin interfaceDragableArea.DragListener- Parameters:
startPoint- Point where the drag was started.evt- The event object- Returns:
trueto 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.DragListenerMethod called during drags.- Specified by:
duringDragin interfaceDragableArea.DragListener- Parameters:
startPoint- Drag starting pointdragPoint- Drag end pointevt- The event objectinside- Inside the tracked element- Returns:
trueto 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.DragListenerMethod called when a drag was ended.- Specified by:
endDragin interfaceDragableArea.DragListener- Parameters:
startPoint- Drag starting pointdragPoint- Drag end pointevt- The event objectinside- Whether the end point was inside the area- Returns:
trueto complete the drag
-
getInputMode
private OPTICSPlotSelectionVisualization.Mode getInputMode(org.w3c.dom.events.Event evt)
Get the current input mode, on each mouse event.- Parameters:
evt- Mouse event.- Returns:
- Input mode
-
getSelectedIndex
private int getSelectedIndex(ClusterOrder order, org.w3c.dom.svg.SVGPoint cPt)
Gets the Index of the ClusterOrderEntry where the event occurred- Parameters:
order- List of ClusterOrderEntriescPt- clicked point- Returns:
- Index of the object
-
updateSelection
protected void updateSelection(OPTICSPlotSelectionVisualization.Mode mode, int begin, int end)
Updates the selection for the given ClusterOrderEntry.- Parameters:
mode- Input modebegin- first index to selectend- last index to select
-
addCSSClasses
private void addCSSClasses()
Adds the required CSS-Classes
-
-