Class SilhouettePlotSelectionToolVisualization.Instance
- java.lang.Object
-
- elki.visualization.visualizers.AbstractVisualization
-
- elki.visualization.visualizers.silhouette.AbstractSilhouetteVisualization
-
- elki.visualization.visualizers.silhouette.SilhouettePlotSelectionToolVisualization.Instance
-
- All Implemented Interfaces:
DataStoreListener
,ResultListener
,DragableArea.DragListener
,VisualizationListener
,Visualization
,java.util.EventListener
- Enclosing class:
- SilhouettePlotSelectionToolVisualization
public static class SilhouettePlotSelectionToolVisualization.Instance extends AbstractSilhouetteVisualization implements DragableArea.DragListener
Instance.- Author:
- Robert Gehde
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
CSS_MARKER
CSS class for markersprotected static java.lang.String
CSS_RANGEMARKER
CSS class for markersprivate org.w3c.dom.Element
mtag
Element for the markerprivate int
plotSize
Nmber of points pllus spaces in the plot-
Fields inherited from class elki.visualization.visualizers.silhouette.AbstractSilhouetteVisualization
plotheight, plotwidth, silhouette
-
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 void
addCSSClasses()
Adds the required CSS-Classesorg.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 SilhouettePlotSelectionToolVisualization.Mode
getInputMode(org.w3c.dom.events.Event evt)
Get the current input mode, on each mouse event.private int
getSelectedIndex(org.w3c.dom.svg.SVGPoint cPt)
Gets the Index of the ClusterOrderEntry where the event occurredboolean
startDrag(org.w3c.dom.svg.SVGPoint startPoint, org.w3c.dom.events.Event evt)
Action to do on drag start.protected void
updateSelection(SilhouettePlotSelectionToolVisualization.Mode mode, int begin, int end)
Updates the selection for the given ClusterOrderEntry.-
Methods inherited from class elki.visualization.visualizers.silhouette.AbstractSilhouetteVisualization
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
-
plotSize
private int plotSize
Nmber of points pllus spaces in the plot
-
-
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:Visualization
Request a full redrawing of the visualization.- Specified by:
fullRedraw
in interfaceVisualization
- Specified by:
fullRedraw
in classAbstractVisualization
-
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.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 SilhouettePlotSelectionToolVisualization.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(org.w3c.dom.svg.SVGPoint cPt)
Gets the Index of the ClusterOrderEntry where the event occurred- Parameters:
cPt
- clicked point- Returns:
- Index of the object
-
updateSelection
protected void updateSelection(SilhouettePlotSelectionToolVisualization.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
-
-