Class AbstractScatterPlotHitDetector

    • Constructor Detail

      • AbstractScatterPlotHitDetector

        public AbstractScatterPlotHitDetector()
        Initializes the hit detector (constructor only for GOE) with no owner.
      • AbstractScatterPlotHitDetector

        public AbstractScatterPlotHitDetector​(AbstractScatterPlotPaintlet owner)
        Initializes the hit detector.
        Parameters:
        owner - the paintlet that uses this detector
    • Method Detail

      • findClosestXs

        protected int[] findClosestXs​(double x,
                                      double wobble)
        Determines the indices of the X values that are closest to the provided x.
        Parameters:
        x - the X value to look for
        wobble - the "fuzziness"
        Returns:
        the indices
      • isHit

        protected abstract int[] isHit​(MouseEvent e)
        Checks for a hit.
        Specified by:
        isHit in class AbstractHitDetector<int[],​String>
        Parameters:
        e - the MouseEvent (for coordinates)
        Returns:
        the associated object with the hit, otherwise null
      • processHit

        protected String processHit​(MouseEvent e,
                                    int[] hit)
        Performs the action when a hit is detected.
        Specified by:
        processHit in class AbstractHitDetector<int[],​String>
        Parameters:
        e - the MouseEvent (for coordinates)
        hit - the object that got determined by the hit
        Returns:
        the generated appendix for the tiptext