Class SelectionToolLineVisualization.Instance

    • 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 context
        task - Task
        plot - Plot to draw to
        width - Embedding width
        height - Embedding height
        proj - Projection
    • Method Detail

      • 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 interface DragableArea.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 interface DragableArea.DragListener
        Parameters:
        startPoint - Drag starting point
        dragPoint - Drag end point
        evt - The event object
        inside - 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 interface DragableArea.DragListener
        Parameters:
        startPoint - Drag starting point
        dragPoint - Drag end point
        evt - The event object
        inside - 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 mode
        p1 - first point of the selected rectangle
        p2 - 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